MCPcopy Create free account
hub / github.com/apache/datafusion / variance

Method variance

datafusion/expr-common/src/statistics.rs:164–172  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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:

Callers 3

evaluate_statisticsMethod · 0.45
combine_gaussiansFunction · 0.45
compute_varianceFunction · 0.45

Calls 7

widthMethod · 0.80
mul_checkedMethod · 0.80
sub_checkedMethod · 0.80
cloneMethod · 0.45
data_typeMethod · 0.45
cast_toMethod · 0.45
divMethod · 0.45

Tested by

no test coverage detected