Mathematics/Statistics/Core Measurements: Difference between revisions

From Dev Wiki
Jump to navigation Jump to search
(Add mean notation)
(Create variance section)
Line 18: Line 18:
  Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_{n}]:
  Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_{n}]:
   
   
  <math>\frac{1}{n} * \sum_{i=1}^n x_i</math>
  <math>\bar{x} = \frac{1}{n} * \sum_{i=1}^n x_i</math>


Direct Notation:
Direct Notation:
  Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_n]:
  Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_n]:
  &nbsp;
  &nbsp;
  <math>\frac{n_0 + n_1 +, ..., + x_{n-1} + x_n}{n}</math>
  <math>\bar{x} = \frac{n_0 + n_1 +, ..., + x_{n-1} + x_n}{n}</math>


Example:
Example:
Line 37: Line 37:
  Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_{n}], with associated weights [w_0, w_1, ..., w_{n-1}, w_{n}]:
  Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_{n}], with associated weights [w_0, w_1, ..., w_{n-1}, w_{n}]:
  &nbsp;
  &nbsp;
  <math>\frac{\sum_{i=1}^n w_ix_i}{\sum_{i=1}^n w_i}</math>
  <math>\bar{x} = \frac{\sum_{i=1}^n w_ix_i}{\sum_{i=1}^n w_i}</math>


Direct Notation:
Direct Notation:
  Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_n], with associated weights [w_0, w_1, ..., w_{n-1}, w_{n}]:
  Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_n], with associated weights [w_0, w_1, ..., w_{n-1}, w_{n}]:
  &nbsp;
  &nbsp;
  <math>\frac{w_0n_0 + w_1n_1 +, ..., + w_{n-1}x_{n-1} + w_nx_n}{w_0 + w_1 +, ..., + w_{n-1}, w_n}</math>
  <math>\bar{x} = \frac{w_0n_0 + w_1n_1 +, ..., + w_{n-1}x_{n-1} + w_nx_n}{w_0 + w_1 +, ..., + w_{n-1}, w_n}</math>


Example:
Example:
Line 76: Line 76:
  Thus, the range is 8 - 2 = 6
  Thus, the range is 8 - 2 = 6


Note that this can be less than useful when the data set has outliers.<br>
Note that this can be less than useful when the data set has outliers. This is because it only uses extreme endpoints.<br>
{{ ToDo | Link to outlier description. }}
{{ ToDo | Link to outlier description. }}
  If we introduce a new value of 100 to our above list, we get [2, 4, 5, 7, 8, 100].
  If we introduce a new value of 100 to our above list, we get [2, 4, 5, 7, 8, 100].
Line 82: Line 82:
  Thus, the range is now 100 - 2 = 98.
  Thus, the range is now 100 - 2 = 98.
  This isn't very descriptive of our data anymore.
  This isn't very descriptive of our data anymore.
== Variance ==
This is an alternative to the Range, which also attempts to measure how much values tend to spread apart in a given set.<br>
Unlike Range, this approach handles outliers much better, so the result is generally more representative of your data.
This is one of the more regularly used values in statistics, and fairly important to understand.<br>
For a full, detailed explanation, see [[https://www.youtube.com/watch?v=sOb9b_AtwDg this youtube video]].
{{ Tip | Often, this is represented as <math>\sigma^2</math>, which is the lowercase character for "sigma".}}
Scientific Notation:
<math>\sigma^2 = \frac{\sum_{i=1}^n (x_i - \bar{x})^2}{n}</math>
Direct Notation:
Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_n] with a mean of <math>\bar{x}</math>:
&nbsp;
<math>\sigma^2 = \frac{(n_0 - \bar{x})^2 + (n_1 - \bar{x})^2 +, ..., + (x_{n-1} - \bar{x})^2 + (x_n - \bar{x})^2}{n}</math>
Example:
Using our above [[#Mean/Average]] example, we have a list of [1, 4, 7, 5, 9, 9, 2, 10] with a mean of 5.875.
&nbsp;
Step 1) Sum with mean: <math>(1 - 5.875)^2 + (4 - 5.875)^2 + (7 - 5.875)^2 + (5 - 5.875)^2 + (9 - 5.875)^2 + (9 - 5.875)^2 + (2 - 5.875)^2 + (10 - 5.875)^2</math>
Step 2) Sum result: 80.875
Step 3) Divide sum by count: <math>\frac{80.875}{8}</math> = 10.109375

Revision as of 14:20, 11 May 2020

Below are some of the most basic, and regularly used forms of measurements in statistics.
All of these measurements are used to gather information about a list of items.

Note: Most of these are easier to use when the list of items is sorted by some meaningful ordering. For some, such as #Median, they will only work on sorted lists.


Mean/Average

The "mean" and "average" are effectively two different words for the same thing.
Effectively, this attempts to get the most "middle" value given a set of items.

Tip: Often, this is represented as , pronounced "x bar".

Standard (Unweighted) Mean

Unweighted Mean is what most people think of when someone says "mean" or "average.
Effectively, take all values in a list and add them together. Then divide this sum by the total count of original values.

Scientific Notation:

Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_{n}]:
 

Direct Notation:

Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_n]:
 

Example:

Given a list of [1, 4, 7, 5, 9, 9, 2, 10].
 
Step 1) Sum: 1 + 4 + 7 + 5 + 9 + 9 + 2 + 10 = 47
Step 2) Divide sum by count:  = 5.875

Weighted Mean

Weighted Mean is similar to above, except that each value has a "weight" associated with it.

Scientific Notation:

Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_{n}], with associated weights [w_0, w_1, ..., w_{n-1}, w_{n}]:
 

Direct Notation:

Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_n], with associated weights [w_0, w_1, ..., w_{n-1}, w_{n}]:
 

Example:

Given a list of [1, 4, 7, 5, 9, 9, 2, 10], the first 4 values are twice as important as the last 4.
 
Step 1) Sum: 2*1 + 2*4 + 2*7 + 2*5 + 1*9 + 1*9 + 1*2 + 1*10 = 64
Step 2) Divide sum by weights:  =  = 5.333


Median

Similarly to mean, the median attempts to get the most "middle" item given a set of items.
However, instead of doing so by literal value, it does this by count of items.

For odd numbered sets, the median is the exact middle number.

Given a list of [1, 2, 3, 5, 7], the median is 3.

For even numbered sets, the median is the middle two numbers.

Given a list of [1, 2, 3, 4, 5, 7], the medians are 3 and 4.


Mode

The mode is the value that occurs most frequently in a set of items.

Given a list of [1, 2, 2, 3, 3, 4, 4, 4], the mode is 4.


Range

Template:ToDo
Range is the difference between the lowest and highest values. Theoretically, it is yet another attempt to get the most "middle" value out of a set of items.

In other words, this attempts to measure how much values tend to spread apart in a given set.

Given a list of [2, 4, 5, 7, 8], the lowest and highest values are 2 and 8.
Thus, the range is 8 - 2 = 6

Note that this can be less than useful when the data set has outliers. This is because it only uses extreme endpoints.
Template:ToDo

If we introduce a new value of 100 to our above list, we get [2, 4, 5, 7, 8, 100].
The lowest and highest values are now 2 and 100.
Thus, the range is now 100 - 2 = 98.
This isn't very descriptive of our data anymore.


Variance

This is an alternative to the Range, which also attempts to measure how much values tend to spread apart in a given set.
Unlike Range, this approach handles outliers much better, so the result is generally more representative of your data.

This is one of the more regularly used values in statistics, and fairly important to understand.
For a full, detailed explanation, see [this youtube video].

Tip: Often, this is represented as , which is the lowercase character for "sigma".


Scientific Notation:


Direct Notation:

Given a list of n terms, [x_0, x_1, ..., x_{n-1}, x_n] with a mean of :
 

Example:

Using our above #Mean/Average example, we have a list of [1, 4, 7, 5, 9, 9, 2, 10] with a mean of 5.875.
 
Step 1) Sum with mean: 
Step 2) Sum result: 80.875
Step 3) Divide sum by count:  = 10.109375