All normal distribution functions should accept mean and stddev parameters
agarie opened this issue · 0 comments
agarie commented
The functions in Distribution::Normal
doesn't accept mean and standard deviation parameters. Alright, we can scale the results ourselves, but this is awful practice. For example:
require 'distribution'
Distribution::Normal.rng(4.3, 0.3)
Distribution::Normal.cdf(3, 5)
What about having named parameters? The interesting part of not having named parameters is that I can provide an Array as in
params = [4.3, 0.3]
Distribution::Normal.rng(*params)
However, with named params:
named_params = { mean: 4.3, stddev: 0.3 }
Distribution::Normal.rng(**named_params)
named2 = { mean: 4.3, stddev: 0.3, stuff: nil }
Distribution::Normal.rng(**named2) # => ArgumentError: unknown keyword: stuff
Probably better.