<commit_before>module Distribution
	class Poisson < BaseDistribution
		attr_accessor :k
		attr_reader :mean

		def initialize(opts = {})
			@mean = opts[:mean]
			@k =  Vector.alloc( opts[:k] || [0] )
		end

		def pdf
			@k.collect { |k|  GSL::Ran.poisson_pdf(k,@mean.to_f).round(3) }
		end

		def cdf(lower_tail=true)
			method_to_call = if lower_tail
				:poisson_P
			else
				:poisson_Q
			end
			@k.collect { |k| Cdf.send(method_to_call,k, @mean.to_f).round(3) }
		end

		def sigma
			sqrt(@mean)
		end

		def kurtosis
			(3 + 1/@mean.to_f).round(3)
		end

		def skewness
			(1/sqrt(@mean.to_f)).round(3)
		end

	end
end<commit_msg>added precision as param to the initializer method: poisson<commit_after>module Distribution
	class Poisson < BaseDistribution
		attr_accessor :k
		attr_reader :mean

		def initialize(opts = {})
			@mean = opts[:mean]
			@k =  Vector.alloc( opts[:k] || [0] )
			@precision = opts[:precision] || 3
		end

		def pdf
			@k.collect { |k|  GSL::Ran.poisson_pdf(k,@mean.to_f).round(3) }
		end

		def cdf(lower_tail=true)
			method_to_call = if lower_tail
				:poisson_P
			else
				:poisson_Q
			end
			@k.collect { |k| Cdf.send(method_to_call,k, @mean.to_f).round(@precision) }
		end

		def sigma
			sqrt(@mean)
		end

		def kurtosis
			(3 + 1/@mean.to_f).round(@precision)
		end

		def skewness
			(1/sqrt(@mean.to_f)).round(@precision)
		end

	end
end
{'fraction_non_alphanumeric': 0.13646209386281588, 'fraction_numerical': 0.010108303249097473, 'mean_word_length': 3.187311178247734, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6689796', 'n_tokens_mistral': 667, 'n_tokens_neox': 556, 'n_words': 116}