Tuesday, January 29, 2013

Calculating Standard Deviation

Whenever calculations are made from observed data using some relation there will be an error in these calculations which is known as standard deviation. Now, exactly what this error is varies between the relationship used and the actual data obtained.


The standard deviation is usually represented by the \( \sigma_A \) (sigma) Greek letter, where \( A \) is the thing whose error we are finding. For example, if we calculated some value for gravity (let's call it \( g \)) the standard deviation of the calculated gravity would be represented as \( \sigma_g\). Pretty straight forward, huh?

Equations

Let's first talk about some general equations. For simplicity, let's call our calculated value \( Z \).

If \( Z \) is represented as a sum or difference of terms, \( Z = A_1 + A_2 + ... + A_n\), then \( \sigma_Z = \sqrt{ \sigma_{A_1}^2 + \sigma_{A_2}^2 + ... + \sigma_{A_n}^2 } \).

For example:
\[
  Z = A + B - C \Rightarrow \sigma_Z = \sqrt{ \sigma_A^2 + \sigma_B^2 + \sigma_C^2 }
\]

If \( Z \) is represented as a product or quotient of terms, \( Z = \frac{ A_1 \times A_2 \times ... \times A_n }{ B_1 \times B_2 \times ... \times B_n } \), then its relative standard deviation is given by \( \frac{\sigma_Z}{ Z } = \sqrt{ \left( \frac{\sigma_{A_1}}{A_1} \right)^2 + ... + \left( \frac{\sigma_{A_n}}{A_n} \right)^2 + \left( \frac{\sigma_{B_1}}{B_1} \right)^2 + ... + \left( \frac{\sigma_{B_n}}{B_n} \right)^2} \). Relative standard deviation is just the standard deviation over the calculated value itself. Ergo to get just the standard deviation we just multiply the whole thing by our calculated value.

For example:
\[
  Z = \frac{ A B }{ C } \Rightarrow \sigma_Z = Z \sqrt{ \left( \frac{\sigma_{A}}{A} \right)^2 + \left( \frac{\sigma_{B}}{B} \right)^2 + \left( \frac{\sigma_{C}}{C} \right)^2 }
\]
 If \( Z \) is represented as another variable to a power, \( Z = A^n \), then its relative standard deviation is given by \( \frac{ \sigma_Z }{ Z } = n \frac{ \sigma_A }{ A } \). Like before, to get \( \sigma_Z \), we just multiply by our calculated \( Z \).

For example:
\[
  Z = A^7 \Rightarrow \sigma_Z = 7 Z \frac{ \sigma_A }{ A }

\]


Those are the basic equations that you need to find the standard deviation. For more on techniques, see the following example.

Example

Suppose we want to find the standard deviation of a calculated value, let's call it \( Z\), where:
\[
  Z = A + \frac{ B^2 C}{D}

\]
To make things easier, let \( U = \frac{ B^2 C }{ D } \) and also let \( V = B^2 \). So,
\[
  Z = A + U \Rightarrow \sigma_Z = \sqrt{ \sigma_A^2 + \sigma_U^2 }

\]
So, we need to find \( \sigma_U \), and since \( V = B^2 \),
\[
  U =  \frac{ V C }{ D } \Rightarrow \sigma_U = U \sqrt{ \left( \frac{ \sigma_V }{ V } \right)^2 + \left( \frac{ \sigma_C }{ C } \right)^2 + \left( \frac{ \sigma_D }{ D } \right)^2}

\]
Lastly, we need to find \( \frac{ \sigma_V }{ V } \),
\[
  V = B^2 \Rightarrow \frac { \sigma_V }{ V } = 2 \frac{ \sigma_B }{ B }

\]
Subbing \( 2 \frac{ \sigma_B }{ B } \) in for \( \frac{ \sigma_V }{ V } \), and \(  \frac{B^2 C}{ D } \) for \( U \) we get,
\[
 U =  \frac{ V C }{ D } \Rightarrow \sigma_U = \frac{B^2 C}{ D } \sqrt{ \left( 2 \frac{ \sigma_B }{ B } \right)^2 + \left( \frac{ \sigma_C }{ C } \right)^2 + \left( \frac{ \sigma_D }{ D } \right)^2}
\]
Finally, subbing this new \( \sigma_U \) into the equation for \( \sigma_Z \), we get,
\[
   \sigma_Z = \sqrt{ \sigma_A^2 + \left( \frac{B^2 C}{ D } \sqrt{ \left( 2 \frac{ \sigma_B }{ B } \right)^2 + \left( \frac{ \sigma_C }{ C } \right)^2 + \left( \frac{ \sigma_D }{ D } \right)^2}  \right)^2 }
\]
Which can be more simply written as,
\[
    \sigma_Z = \sqrt{ \sigma_A^2 + \left( \frac{B^2 C}{ D } \right)^2 \left[ \left( 2 \frac{ \sigma_B }{ B } \right)^2 + \left( \frac{ \sigma_C }{ C } \right)^2 + \left( \frac{ \sigma_D }{ D } \right)^2 \right] }
\]

No comments:

Post a Comment