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