Draft Forbes Group Website (Build by Nikola). The official site is hosted at:
License: GPL3
ubuntu2004
The primary purpose of the uncertainties package is to represent quantities with correlated errors:
Here =x
represents a quantity with nominal value 1.0
and error 0.1
in the sense of one standard deviation. I.e. we assume that the parameter represents a normally distributed random variable with a Gaussian probability distribution function (PDF)
where is the mean of the distribution and is the variance.
Base quantities can be combined in such a way that the errors propagate forward using standard error analysis techniques. This propagation of errors assumes that the errors represent 1 standard deviation of normal Gaussian errors and that the errors are small enough for any functional dependence to be well approximated by a linear relationship. For example, we can demonstrate the following simple rules for adding uncorrelated errors:
Addition: Absolute errors add in quadrature.
Multiplication/Division: Relative errors add in quadrature.
Powers: Relative errors add in quadrature weighted by factors of the square of the power.
Correlations
One great feature is the ability to track correlations. Thus, if we , then the errors in and are correlated.
These correlations are described through the covariance matrix ParseError: KaTeX parse error: Undefined control sequence: \mat at position 1: \̲m̲a̲t̲{\Sigma} which generalizes the variance of a single variable:
ParseError: KaTeX parse error: Undefined control sequence: \mat at position 1: \̲m̲a̲t̲{\Sigma} = \bra…In the same way that for a single variable the interval describes the deviations of a single parameter with 68.3% of the values lying with , 95.4% lying within etc., the distribution of the correlated parameters is described by the ellipsoid
ParseError: KaTeX parse error: Undefined control sequence: \mat at position 22: …\vect{x}^T\cdot\̲m̲a̲t̲{\Sigma}^{-1}\c…The matrix ParseError: KaTeX parse error: Undefined control sequence: \mat at position 1: \̲m̲a̲t̲{Q} = \mat{\Sig… is sometimes called the precision matrix which is equivalent to the Fisher information matrix in the special case of Gaussian errors.
As shown above, for any two variables, one can plot the corresponding covariance region by extracting the corresponding sub-matrix. Here we demonstrate this covariance region to show the meaning of the errors reported by the uncertainty package:
Example
Here we determine the period, phase, and amplitude of a sine wave using a least squares fit. To simulate the errors, we provide Guassian samples of the errors.
Above we demonstrate the difference between correlated and uncorrelated errors in the model parameters.
Here we use the Cholesky decomposition of the covariance matrix ParseError: KaTeX parse error: Undefined control sequence: \mat at position 1: \̲m̲a̲t̲{C}=pcov
to generate correlated random values for the parameters. We check with a histogram that these are indeed correctly generated:
To Do
As an exercise, use such randomly generated data to check that the parameter estimates are correct.