weighted_mean_variance

sofia_redux.toolkit.resampling.weighted_mean_variance(variance, weights, weightsum=None)[source]

Calculated mean weighted variance.

Propagate variance as:

\[\bar{V} = \frac{\sum_{i=1}^{N}{w_i^2 V_i}} {(\sum_{i=1}^{N}{w_i})^2}\]
Parameters:
variancenumpy.ndarray (ndata,)

Variance array.

weightsnumpy.ndarray (ndata,)

Weights.

weightsumint or float, optional

Sum of weights. Passed in for speed if pre-calculated.

Returns:
mean_variancefloat

The propagated variance.