Lecture 2 Slides With Q&A 20242025
Lecture 2 Slides With Q&A 20242025
Lecture 2
Joris Marée
Contents Lecture 2:
n
• It can be thought of the value a such that min ( xi − a)2
a i =1
5
1 n
Variance: s =
2
n − 1 i =1
( x i − x )2
"mean quadratic deviation"
1 n 2 2
Alternative formula: s =
2
i
n − 1 i =1
x − nx
Standard deviation: s = s 2
s
Coefficient of variation (unit-less): cv =
x
6
x − 3s x − 2s x −s x x +s x + 2s x + 3s
| 68% |
| 95% |
| 99.7% |
7
Weight example
Class limits fi
50 - 60 10
60 - 70 38
70 - 80 72
80 - 90 48
90 - 100 26
100 - 110 6
1 k 1 k
Grouped data: x fi mi =… and s
2
fi (mi − x )2 =…
n i =1 n − 1 i =1
9
1 k
x mi fi
n i =1
1
= (0.5 8 + 1.5 9 + 2.5 3) = 1.25 ( €1000)
20
1 k
s
2
n − 1 i =1
(mi − x )2 fi
1
= [(0.5 − 1.25)2 8 + (1.5 − 1.25)2 9 + (2.5 − 1.25)2 3] =
19
= 0.513 ( €1000)2
10
p
Location: L p = (n + 1)
100
0 100 200
12
0 20 40 60 80 100 120
13
Sales
3 22 31
20
4 32 20
15
5 40 36
10
0
0 10 20 30 40 50
Advertising expenditure
1 n
Covariance (sample): s XY = cov( X ,Y ) =
n − 1 i =1
( xi − x )( y i − y )
i xi yi xi − x yi − y ( xi − x )( y i − y )
1 13 10 -12 -13 +156
2 18 18 -7 -5 +35
3 22 31 -3 8 -24
4 32 20 7 -3 -21
5 40 36 15 13 +195
Tot. 125 115 0 0 +341
125
x= = 25 y = 23
5
1
Ex: s XY = cov( X ,Y ) = 341 = 85.25
4
The covariance only tells us about the linear relation: pos/neg
But size tells nothing about the strength of the relation!
15
Advertisement example:
s X2 = 119 sY2 = 109 (use one of the formulas on slide 4)
s XY = 85.25
cov( X ,Y )
Then: r XY = =
s X sY
6 10
4 5
2
0
0 -3 -2 -1 0 1 2 3
-3 -2 -1 0 1 2 3 -5
-2
-4 -10
-6 -15
6 8
4 6
2 4
2
0
-3 -2 -1 0
-2 0 1 2 3
-3 -2 -1 -2 0 1 2 3
-4 -4
-6 -6
-8 -8
35
15
30
10 25
5 20
15
0
10
-3 -2 -1 0 1 2 3
-5 5
-10 0
-3 -2 -1 -5 0 1 2 3
-15
Covariance (pop):
1 N
XY = COV( X ,Y ) = ( xi − X )( y i − Y )
N i =1
COV( X ,Y )
XY = = XY − 1 XY 1
X Y X Y
18
0.16 0.16
0.1
0.14 0.14
Rel. frequency
Rel. frequency
Rel. frequency
0.1 0.1
0.06
0.08 0.08
0.04 0.06 0.06
0.04 0.04
0.02
0.02 0.02
0 0 0
x =M x M x M
19
20
21
PROBABILITY THEORY
→ prob. theory →
Population Sample
inferential statistics
Basic concepts:
- Random experiment
- experiment with an uncertain outcome
- Sample space S
- set of all possible, mutually disjoint, outcomes
- either finite (notation S = {e1, … , ek} with k possible outcomes) or infinite
- Event
- subset of sample space (notation A,B, etc.)
Basic concepts :
1. Probability experiment
2. Sample space S
3. Elementary event
4. Event
Examples
i. 1. Toss a coin ii. 1. Toss 2 coins
2. S= 2. S=
3. E1= , E2= 3.
4. A = “Tails” 4. A=“at least 1x Heads”
=
22
23
PROBABILITY DEFINITIONS
Event A occurs if outcome belongs to set A
P(A) = probability of A occurring
# elements in A
1. Classical definition (Laplace): P ( A) =
# elements in S
1
Ex. Fair die: P("2 dots") =
6
- Only if all outcomes are equally likely!
S
A
B
A B
4
P (CC ) = (See previous slide)
13
4 9
P (C ) = 1 − P (C C ) = 1 − =
13 13
Extra: Morgan-laws:
S S
A B A B
Next lecture