gradientVariance

fiducia.stats.gradientVariance(yUnc, x=None, dx=1.0)[source]

Propogates uncertainty for the gradient operator of an array of a given step size.

Parameters
  • yUnc (list, numpy.ndarray) – The list of uncertainities, referenced as :math:’sigma_i’.

  • x (list, numpy.ndarray, optional) – The sampling points for which the uncertainites ‘’y’’ were found. Must be the same length as ‘’y’’. If none are provided, then the step size will be uniform and set with ‘’dx’’. The default is None.

  • dx (list, numpy.ndarray, optional) – Step size. Only applies if sampling points aren’t specified with ‘’x’’. The default is 1.0.

Returns

variance – The total variance (\(\sigma^2\)) found by propagating ‘’y’’.

Return type

float

Notes

\[\operatorname{Var}(\nabla y_i) = \frac{h_{i-1}^2 \sigma_{i+1}^2 + (h_i^2 + h_{i-1}^2)^2 \sigma_i^2 - h_i^4 \sigma_{i-1}^2}{(h_i h_{i-1}(h_i + h_{i-1}))^2}\]

At the boundaries

\[\operatorName{Var}(\nabla y_0) = \frac{\sigma_1^2 - \sigma_0^2}{h_0^2}, \operatorName{Var}(\nabla y_{N-1}) = \frac{\sigma_{N-1}^2 - \sigma_{N-2}^2}{h_{N-2}^2}\]

Examples