Extracts the median value of this uncertain quantity, depending on its distribution: - A [`Uniform`] distribution's interval determines its median value, which is the arithmetic average of the interval endpoints. - An [`Exponential`] distribution's median is calculable by the formula `offset + ln(2) / λ`, where `λ` is the (non-negative) rate. - A [`Gaussian`] distribution's median is equal to its
(&self)
| 141 | /// - A [`Generic`] distribution _may_ have it explicitly, or this information |
| 142 | /// may be absent. |
| 143 | pub fn median(&self) -> Result<ScalarValue> { |
| 144 | match &self { |
| 145 | Uniform(u) => u.median(), |
| 146 | Exponential(e) => e.median(), |
| 147 | Gaussian(g) => Ok(g.median().clone()), |
| 148 | Bernoulli(b) => b.median(), |
| 149 | Generic(u) => Ok(u.median().clone()), |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | /// Extracts the variance value of this uncertain quantity, depending on |
| 154 | /// its distribution: |
no test coverage detected