Class Estimate
-
template<typename T, typename U = T>
class Estimate Estimates with a value, \( x \), and a variance, \( \sigma^2 \).
Where \( y = f (x_1, x_2, ... x_n) \), then \( \sigma_y^2 = \sum_{i=1}^n ({\partial f \over \partial x_i})^2\sigma_i^2 \)
See http://mathworld.wolfram.com/ErrorPropagation.html
Note that all variables are assumed independent, even if identical. For example, the following code will underestimate the variance of xsq.
Estimate<double> x; Estimate<double> xsq = x*x;
To correctly handle error propagation through equations in which variables appear more than once, please see the MEAL::ScalarMath class in the meal library.
Public Functions
-
inline Estimate(T _val = 0, U _var = 0)
Construct from a value, \( x \), and its variance, \( \sigma_x^2 \).
-
template<typename V, typename W>
inline Estimate(const Estimate<V, W> &d) Construct from another Estimate.
-
template<typename V, typename W>
inline Estimate(const MeanEstimate<V, W> &m) Construct from MeanEstimate.
-
template<typename V, typename W>
inline Estimate(const MeanRadian<V, W> &m) Construct from MeanRadian.
Friends
-
inline friend Estimate exp(const Estimate &u)
See http://mathworld.wolfram.com/ErrorPropagation.html Equation (15).
-
inline friend Estimate log(const Estimate &u)
See http://mathworld.wolfram.com/ErrorPropagation.html Equation (17).
-
inline friend Estimate sqrt(const Estimate &u)
\( {\partial\over\partial x} x^{1\over2} = {1\over2}x^{-{1\over2}} \)
-
inline friend Estimate sin(const Estimate &u)
\( \left({\partial\sin x\over\partial x}\right)^2 = (1-\sin^2x) \)
-
inline friend Estimate cos(const Estimate &u)
\( \left({\partial\cos x\over\partial x}\right)^2 = (1-\cos^2x) \)
-
inline friend Estimate acos(const Estimate &u)
\( {\partial\over\partial x} \cos^{-1} (x) = -(1-x^2)^{-1/2} \)
-
inline friend Estimate atan(const Estimate &u)
\( {\partial\over\partial x} \tan^{-1} (x) = (1+x^2)^{-1} \)
-
inline friend Estimate atan2(const Estimate &s, const Estimate &c)
\( {\partial\over\partial x} \tan^{-1} (x) = (1+x^2)^{-1} \)
-
inline friend Estimate sinh(const Estimate &u)
\( \left({\partial\sinh x\over\partial x}\right)^2 = 1+\sinh^2x \)
-
inline Estimate(T _val = 0, U _var = 0)