Review of Uncertainty

PHYS375 Experimental Lab

Mean and Standard Deviation

When we discuss means and standard deviations, we must remember that we are trying to estimate some unknowable value defined in terms of making an infinite number of measurements.  In that regard the mean is defined as:

μ ≡ (lim_(N ->  ∞))(1/N)(∑_(i = 1)^N) (Subscript[x, i]).

We define the variance as the square of the standard deviation:

(σ^2) ≡ (lim_(N ->  ∞))(1/N)(∑_(i = 1)^N)((((Subscript[x, i])-μ))^2).

Since it is impractical to make an infinite number of measurements, the best we can do is to estimate μ and σ by the sample mean, \(TraditionalForm\`x\&_\), and sample variance, (s^2), as:

\(TraditionalForm\`x\&_\) = (1/N)(∑_(i = 1)^N) (Subscript[x, i]) and

(s^2) = (1/(N - 1))(∑_(i = 1)^N)((((Subscript[x, i]) - \(x\&_\)))^2).

It should be understood that \(TraditionalForm\`x\&_\) is only a good approximation to μ when the measurements (Subscript[x, i]) are distributed according to the Gaussian distribution.  That is, the mean, median and most probable value all coincide.  It turns out this is often a good assumption.

Combining Uncertainty Components

Assume the x depends on variables u, v, ... according to some functional dependence:

x = f( u, v, ...).

Then the most probable value of x, in general, will be given by:

\(TraditionalForm\`x\&_\) = f( \(TraditionalForm\`u\&_\), \(TraditionalForm\`v\&_\), ...).

The variance,  ((Subscript[σ, x])^2), will be related to ((Subscript[σ, u])^2), ((Subscript[σ, v])^2), ... We can determine this relationship by making a Taylor expansion of ((Subscript[σ, x])^2) about \(TraditionalForm\`u\&_\), etc.

((Subscript[σ, x])^2) ≃ (lim_(N ->  ∞))(1/N)(∑_(i = 1)^N)(([((Subscript[u, i])- \(u\&_\))(∂(x/∂)u)+ ((Subscript[v, i])- \(v\&_\))(∂(x/∂)v) + ···])^2)

    ≃ (lim_(N ->  ∞))(1/N)(∑_(i = 1)^N)[((((Subscript[u, i])- \(u\&_\)))^2)(((∂(x/∂)u))^2)+ ((((Subscript[v, i])- \(v\&_\)))^2)(((∂(x/∂)v) )^2)+ 
2((Subscript[u, i])- \(u\&_\))((Subscript[v, i])- \(v\&_\))(∂(x/∂)u)(∂(x/∂)v) +···]

≃ ((((Subscript[σ, u])^2)(∂(x/∂)u))^2)+ \(\(\(\(σ\_v\^2\)(∂x\/∂v)\)\(\ \)\)\^2\)+ 2(Subscript[σ, uv])(∂(x/∂)u)(∂(x/∂)v) +···

where

((Subscript[σ, u])^2) ≡ (lim_(N ->  ∞))(1/N)(∑_(i = 1)^N)((((Subscript[u, i])-\(u\&_\)))^2).

((Subscript[σ, v])^2) ≡ (lim_(N ->  ∞))(1/N)(∑_(i = 1)^N)((((Subscript[v, i])-\(v\&_\)))^2).

((Subscript[σ, uv])^2) ≡ (lim_(N ->  ∞))(1/N)(∑_(i = 1)^N)((Subscript[u, i])-\(u\&_\))((Subscript[v, i])-\(v\&_\)).

The last relationship is the covariance between variables u and v.  In cases where the parameters are uncoupled the covariance terms can be neglected.  There are two special cases that  frequently occur.  The first is x = au ± bv.  The variance in this case takes the form:

There are two special cases that frequently occur. The first is x=au±bv.  The variance in this case takes the form:

((Subscript[σ, x])^2) ≃ a((Subscript[σ, u])^2)+ b((Subscript[σ, v])^2)± 2ab((Subscript[σ, uv])^2).

The second is x = (Cu^a)(v^b)then

((((Subscript[σ, x])^2) )/((x^2)))≃ (a^2)((((Subscript[σ, u])^2))/((u^2)))+ (b^2)((((Subscript[σ, v])^2))/((v^2)))+ 2ab(((Subscript[σ, uv])^2)/uv).

Weighted Mean and Standard Deviation

For a Gaussian distribution,the probability for making an observation of(Subscript[x, i])is given by:

(Subscript[P, i])(μ) = (1/((Subscript[σ, i]) (Sqrt[2  π])))exp[-(1/2)((((((Subscript[x, i]) - μ)/((Subscript[σ, i])))))^2)],

with uncertainties (Subscript[σ, i]), which are in general different for each observation.  Now if we make N observations, the probability for observing a particular set will be given by the product:

P(μ) = (∏_(i = 1)^N) (Subscript[P, i])(μ)

                                                         = \(TraditionalForm\`\((∏\+\(i = 1\)\%N 1\/\(\(σ\_i\) \@\(2  π\)\))\)\)exp[-(1/2)(∑_(i = 1)^N)((((((Subscript[x, i]) - μ)/((Subscript[σ, i])))))^2)].

The probability will be maximized when the argument of the exponential is minimized. That is when,

(d/d)μ[-(1/2)(∑_(i = 1)^N)((((((Subscript[x, i]) - μ)/((Subscript[σ, i])))))^2)] = 0.

Solving this leads to:

\(x\&_\) =(((∑_(i = 1)^N)(((Subscript[x, i])/((Subscript[σ, i])^2))))/((∑_(i = 1)^N)((1/((Subscript[σ, i])^2))))) (Underscript[-> , (Subscript[σ, i]) = σ]) (1/N)(∑_(i = 1)^N)(Subscript[x, i]).

The average to the right is or ordinary definition of the mean when all the uncertainties are the same.  The middle expression defines our weighted average.

Uncertainty in Weighted Mean

The uncertainty in the weighted mean can be determined by combining errors.  Specifically, the uncertainty in \(TraditionalForm\`x\&_\) is related to each uncertainty (Subscript[σ, i]) so,

\(\(\(σ\_x\&_\  = \ ∑\+\(i = 1\)\%N\([\(σ\_i\^2\) \((∂x\&_\/∂x\_i)\)\^2]\)\)\(,\)\)\)

\(where\ we\ have\ assumed\ each\ σ\_i\ is\ independent\ and\ uncorrelated\ with\ the\ rest . \ \ We\ must\ evaluate\ \(\(∂x\&_\/∂x\_i\)\(.\)\)\)

\(∂x\&_\/∂x\_i\)=(∂/∂)(Subscript[x, i])(((∑_(i = 1)^N)(((Subscript[x, i])/((Subscript[σ, i])^2))))/((∑_(i = 1)^N)((1/(Subscript[σ, i])))))=(((1/((Subscript[σ, i])^2)))/((∑_(i = 1)^N)((1/((Subscript[σ, i])^2))))).

\(If\ we\ substitute\ this\ in\ for\ our\ expression\ of\ σ\_x\&_\ \ we\ \(\(get\)\(:\)\)\)

\(σ\_x\&_\) = (∑_(i = 1)^N)((Subscript[σ, i])^2)((((((1/((Subscript[σ, i])^2)))/((∑_(i = 1)^N)((1/((Subscript[σ, i])^2)))))))^2)= (1/((∑_(i = 1)^N)((1/((Subscript[σ, i])^2))))).

When all the uncertainties are the same and equal to σ this reduces to:

\(σ\_x\&_\) = (((σ^2))/N).

Mathematica Program Calls

To generate means and standard deviations of a numbers you will need to load the package  Statistics`DescriptiveStatistics`.  This should be done as follows:

Needs["Statistics`DescriptiveStatistics`"]

Mean[data]						\(TraditionalForm\`x\&_\)      = (1/N) (∑_(i = 1)^N) (Subscript[x, i])

Variance[data]						(s^2)    =\(\(1\/\(N - 
                1\)\) \(∑\+\(i = 1\)\%N\((x\_i - x\&_)\)\^2\)\)

VarianceOfSampleMean[data]				((Subscript[σ, μ])^2) = (1/N)"\!\(\*StyleBox[\"\\\"Variance[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"data\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\)"

StandardDeviation[data]				σ     = (Sqrt["\!\(\*StyleBox[\"\\\"Variance[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"data\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) "])

StandardErrorOfSampleMean[data]			(Subscript[σ, μ])   = (Sqrt["\!\(\*StyleBox[\"\\\"Variance[\\\"\", \"MR\"]\)\!\(\*StyleBox[\"\\\"data\\\"\", \"TI\"]\)\!\(\*StyleBox[\"\\\"]\\\"\", \"MR\"]\) "])

You can create functions to calculate the weighted means and standard deviations.