Extracts the variance value of this uncertain quantity, depending on its distribution: - A [`Uniform`] distribution's interval determines its variance value, which is calculable by the formula `(upper - lower) ^ 2 / 12`. - An [`Exponential`] distribution's variance is calculable by the formula `1 / (λ ^ 2)`, where `λ` is the (non-negative) rate. - A [`Gaussian`] distribution's variance is specifie
(&self)
| 162 | /// - A [`Generic`] distribution _may_ have it explicitly, or this information |
| 163 | /// may be absent. |
| 164 | pub fn variance(&self) -> Result<ScalarValue> { |
| 165 | match &self { |
| 166 | Uniform(u) => u.variance(), |
| 167 | Exponential(e) => e.variance(), |
| 168 | Gaussian(g) => Ok(g.variance.clone()), |
| 169 | Bernoulli(b) => b.variance(), |
| 170 | Generic(u) => Ok(u.variance.clone()), |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | /// Extracts the range of this uncertain quantity, depending on its |
| 175 | /// distribution: |
no test coverage detected