GaussianΒΆ
Normal distribution with parameters mu and sigma.
ParametersΒΆ
-
seed β defaults to
None
Random number generator seed for reproducibility.
AttributesΒΆ
-
mode
The most likely value in the distribution.
-
mu
-
n_samples
The number of observed samples.
-
sigma
ExamplesΒΆ
>>> from river import proba
>>> p = proba.Gaussian().update(6).update(7)
>>> p
π©(ΞΌ=6.500, Ο=0.707)
>>> p(6.5)
0.564189
>>> p.revert(7)
π©(ΞΌ=6.000, Ο=0.000)
MethodsΒΆ
call
Probability mass/density function.
Parameters
- x (Any)
cdf
Cumulative density function, i.e. P(X <= x).
Parameters
- x (float)
revert
Reverts the parameters of the distribution for a given observation.
Parameters
- x (float)
- w β defaults to
1.0
sample
Sample a random value from the distribution.
update
Updates the parameters of the distribution given a new observation.
Parameters
- x (float)
- w β defaults to
1.0