Simulation and Modeling1
Simulation and Modeling1
Simulation and Modeling1
X X X
(x
Variance:
• Gives information on variability of a
single variable. i x) 2
S x2 i 1
Covariance: n 1
• Gives information on the degree to
which two variables vary together. n
• Note how similar the covariance is to
variance: the equation simply (x i x)( yi y )
multiplies x’s error scores by y’s error
scores as opposed to squaring x’s error cov(x, y ) i 1
scores. n 1
COVARIANCE
n
(x i x)( yi y )
cov(x, y ) i 1
n 1
When X and Y : cov (x,y) = pos.
When X and Y : cov (x,y) = neg.
When no constant relationship: cov (x,y) = 0
EXAMPLE COVARIANCE
7
6 x y xi x yi y ( xi x )( yi y )
5
0 3 -3 0 0
4
3
2 2 -1 -1 1
2
3 4 0 1 0
1
4 0 1 -3 -3
0 6 6 3 3 9
0 1 2 3 4 5 6 7
x3 y3 7
( x x)( y
i i y ))
7 What does this
cov(x, y ) i 1
1.75 number tell us?
n 1 4
PROBLEM WITH COVARIANCE
= ŷ, predicted value
= y i , true value
ε = residual error
LEAST SQUARES REGRESSION
Residual (ε) = y - ŷ
Sum of squares of residuals = Σ (y – ŷ)2
b
ε b ε
b
b b b