Covariance - Maple Help

ScientificErrorAnalysis

 Covariance
 return the covariance between two quantities-with-error

 Calling Sequence Covariance( obj1, obj2 )

Parameters

 obj1 - quantity-with-error obj2 - quantity-with-error

Description

 • The Covariance( obj1, obj2 ) command returns the covariance between the quantities-with-error obj1 and obj2.
 • Either of the quantities-with-error obj1 and obj2 can have functional dependence on other quantities-with-error.
 If neither of the quantities-with-error obj1 and obj2 has functional dependence on other quantities-with-error, the correlation between obj1 and obj2 is accessed and converted to the covariance.
 The relationship between the correlation $r\left({z}_{1},{z}_{2}\right)$ and covariance $u\left({z}_{1},{z}_{2}\right)$ is

$u\left({z}_{1},{z}_{2}\right)=r\left({z}_{1},{z}_{2}\right)u\left({z}_{1}\right)u\left({z}_{2}\right)$

 where $u\left({z}_{1}\right)$ and $u\left({z}_{2}\right)$ are the errors in ${z}_{1}$ and ${z}_{2}$, respectively.
 If either of the quantities-with-error obj1 and obj2 has functional dependence on other quantities-with-error, the covariance is calculated using the usual formula of error analysis involving a first-order expansion with the dependent forms and covariances between the other quantities-with-error. This process can be recursive.
 The covariance $u\left({z}_{1},{z}_{2}\right)$ between ${z}_{1}$ and ${z}_{2}$, where ${z}_{1}$ depends on the ${x}_{i}$, and ${z}_{2}$ depends on the ${y}_{j}$, is

$u\left({z}_{1},{z}_{2}\right)=\sum _{i=1}^{N}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\sum _{j=1}^{M}\left(\frac{\partial }{\partial {x}_{i}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{z}_{1}\right)\left(\frac{\partial }{\partial {y}_{j}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{z}_{2}\right)u\left({x}_{i},{y}_{j}\right)$

 where $u\left({x}_{i},{y}_{j}\right)$ is the covariance between ${x}_{i}$ and ${y}_{j}$, and the partials are evaluated at the central values of the ${x}_{i}$ and ${y}_{j}$.
 • Covariances involving physical constants are calculated naturally and correctly in the implied system of units because central values and errors are obtained from the interface to ScientificConstants.
 Unusual cases are possible involving the covariance between the same physical constant in different systems of units, but correct results are obtained. In the case of a nonderived constant, the identical identifiers obtained from the interface to ScientificConstants cause Covariance to obtain the uncertainty from both objects. In the case of a derived constant, the general double summation of the error analysis formula is evaluated as usual (over the same functional form).

Examples

 > $\mathrm{with}\left(\mathrm{ScientificConstants}\right):$
 > $\mathrm{with}\left(\mathrm{ScientificErrorAnalysis}\right):$
 > $a≔\mathrm{Quantity}\left(10.,2.\right):$
 > $b≔\mathrm{Quantity}\left(20.,1.\right):$
 > $\mathrm{Covariance}\left(a,b\right)$
 ${0}$ (1)
 > $\mathrm{SetCorrelation}\left(a,b,0.1\right)$
 > $\mathrm{Covariance}\left(a,b\right)$
 ${0.2}$ (2)
 > $\mathrm{GetConstant}\left(m\left[e\right]\right)$
 ${\mathrm{electron_mass}}{,}{\mathrm{symbol}}{=}{{m}}_{{e}}{,}{\mathrm{derive}}{=}\frac{{2}{}{{R}}_{{\mathrm{\infty }}}{}{h}}{{c}{}{{\mathrm{\alpha }}}^{{2}}}$ (3)
 > $\mathrm{Covariance}\left(\mathrm{Constant}\left(m\left[e\right]\right),\mathrm{Constant}\left(h\right)\right)$
 ${9.019239049}{×}{{10}}^{{-80}}$ (4)
 > $\frac{\mathrm{evalf}\left(\mathrm{Constant}\left(m\left[e\right]\right)\right)\mathrm{evalf}\left(\mathrm{Constant}\left(h\right)\right)}{}$
 ${1.494255581}{×}{{10}}^{{-16}}$ (5)