Open agarie opened 9 years ago
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:
Distribution::Normal
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.
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:What about having named parameters? The interesting part of not having named parameters is that I can provide an Array as in
However, with named params:
Probably better.