Extracts the mean value of this uncertain quantity, depending on its distribution: - A [`Uniform`] distribution's interval determines its mean value, which is the arithmetic average of the interval endpoints. - An [`Exponential`] distribution's mean is calculable by the formula `offset + 1 / λ`, where `λ` is the (non-negative) rate. - A [`Gaussian`] distribution contains the mean explicitly. - A [
(&self)
| 119 | /// - A [`Generic`] distribution _may_ have it explicitly, or this information |
| 120 | /// may be absent. |
| 121 | pub fn mean(&self) -> Result<ScalarValue> { |
| 122 | match &self { |
| 123 | Uniform(u) => u.mean(), |
| 124 | Exponential(e) => e.mean(), |
| 125 | Gaussian(g) => Ok(g.mean().clone()), |
| 126 | Bernoulli(b) => Ok(b.mean().clone()), |
| 127 | Generic(u) => Ok(u.mean().clone()), |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | /// Extracts the median value of this uncertain quantity, depending on its |
| 132 | /// distribution: |
no test coverage detected