The convention of what self.variance means in this struct is inconsistent. The struct definition defines it as "squared scale", as with the Wikipedia page. The pdf with this convention is then defined
$$f(x) = \frac{\exp( -\frac{(x-\mu)^2}{2\sigma^2})}{\sigma \sqrt{2\pi}}.$$
In particular, self.variance should not be squared in exponential. Similarly an inconsistency was found in the implementation of Distribution::cf().
Note the old formulas passed tests because tests were run for $\sigma^2 = 1$, which is obviously constant upon taking powers.
The convention of what
self.variance
means in this struct is inconsistent. The struct definition defines it as "squared scale", as with the Wikipedia page. The pdf with this convention is then defined $$f(x) = \frac{\exp( -\frac{(x-\mu)^2}{2\sigma^2})}{\sigma \sqrt{2\pi}}.$$ In particular,self.variance
should not be squared in exponential. Similarly an inconsistency was found in the implementation ofDistribution::cf()
.Note the old formulas passed tests because tests were run for $\sigma^2 = 1$, which is obviously constant upon taking powers.