Docsity

data science, maths , dispersion, Slides of Advanced Data Analysis

Partial preview of the text

Download data science, maths , dispersion and more Slides Advanced Data Analysis in PDF only on Docsity!

Dispersion

Measures of Spread

Data Science-I (CS3081)

0. The central question: Why is the

centre not enough?

In the previous lecture, we learned how to describe the centre of a dataset.

We used measures such as:

  • Mean
  • Median
  • Mode

But the centre alone does not tell us everything.

The same centre, different data

If we report only the mean, the two datasets appear identical. But they clearly are not. Dataset A is tightly concentrated around 50. Dataset B is spread widely across the number line. This introduces the second major question in descriptive statistics: How far are the observations spread around the centre? This is what measures of dispersion or spread tell us.

The two things we need to describe a

distribution

A useful summary of numerical data usually requires both:

1. Centre Where is the data located? Examples: - Mean - Median 2. Spread How far apart are the observations? Examples: - Range - Variance (^) 5 / 94

1. The range: the simplest measure of

spread

The simplest measure of spread is the range.

Range = Maximum − Minimum

or Range = x(n) − x(1)

where:

  • x(1) is the smallest observation
  • x(n) is the largest observation

Example: computing the range

Consider: x = { 3 , 5 , 7 , 8 , 10 , 12 , 15 } The smallest value is: 3 The largest value is: 15 Therefore: Range = 15 − 3 = 12

The range is fragile

One observation has increased the range from 4 to 90. This shows an important idea: The range is extremely sensitive to extreme values. Therefore, the range is useful as a quick description of the total span of the data, but it is usually not sufficient as the primary measure of variability.

2. Variance: measuring spread around

the mean

The range looks only at the two extreme observations. A more complete approach is to ask: How far is every observation from the centre? Suppose we use the mean as our centre. For every observation xi, its deviation from the mean is:

xi − x¯

Deviations from the mean always sum to

zero

In fact, the deviations from the mean always satisfy: ∑︂^ n

i=

(xi − x¯) = 0

Therefore, we cannot simply average the raw deviations. The positive and negative values cancel each other. We need a way to make all deviations positive. One approach is to take absolute values. Another is to square them. Variance uses squared deviations.

3. Where variance comes from

In the previous lecture, we established an important property of the mean. The mean is the value that minimises the sum of squared deviations:

x ¯ = arg min c

∑︂ n

i=

(xi − c)^2

In simple terms: Among all possible choices of centre, the mean produces the smallest possible total squared distance from the observations.

4. A complete numerical example of

variance

Consider: x = { 3 , 5 , 7 , 8 , 10 , 12 , 15 } Step 1: Calculate the mean The sum is: 3 + 5 + 7 + 8 + 10 + 12 + 15 = 60 There are 7 observations. Therefore:

¯x =

7 = 8.^57

approximately.

Step 2: Calculate deviations from the

mean

xi xi − x¯ 3 − 5. 57 5 − 3. 57 7 − 1. 57 8 − 0. 57 10 1. 43 12 3. 43 15 6. 43

Notice something important. The deviations add to approximately zero. That is why we cannot simply average them.

Step 4: Divide by the number of

observations

For population variance: σ^2 =^101.^71 7 Therefore: σ^2 ≈ 14. 53 This is the variance of the dataset.

5. Why does squaring make variance

sensitive to outliers?

Squaring does more than simply remove negative signs. It gives greater weight to large deviations. For example: 22 = 4 but 102 = 100 The deviation of 10 is only five times larger than the deviation of 2. But its squared contribution is: 100 4

times larger.