Professional Documents
Culture Documents
r * c
- r = upp ner
- c = →
1. MMULT- multiplication
Requires nr of columns for the first matrix to be the same as the nr of rows of the second
matrix.
𝑟𝑎 · 𝑐𝑎 * 𝑟𝑏 · 𝑐𝑏
- c a = rb
- ra * cb
OLS method
rdinary least squares estimator:The estimator generatingthe set of values of the
O
parameters that minimizes the sum of squared residuals.
−1
OLS estimator =(𝑋'𝑋
) * 𝑋'𝑦
= 100*2
X
X’ = 1* 100
X’X = 2*2
𝑀𝑀𝑈𝐿𝑇(𝑇𝑅𝐴𝑁𝑆𝑃𝑂𝑆𝐸(𝑋) ; 𝑋)
3. C
alculateInversefor the new matrix
(X’X)-1
’ = 2*100
X
𝑀𝐼𝑁𝑉𝐸𝑅𝑆𝐸(𝑠𝑒𝑙𝑒𝑐𝑡𝑎𝑏𝑜𝑣𝑒)
4. C
alculatetranspose
X’y
’ = 2*100
X
y = 100*1
X’y = 2*1
𝑀𝑀𝑈𝐿𝑇(𝑇𝑅𝐴𝑁𝑆𝑃𝑂𝑆𝐸(𝑋) ; 𝑦)
−1
𝑀𝑀𝑈𝐿𝑇((𝑋'𝑋
) ; 𝑋'𝑦)
- both above
6. C
alculate and name e (in table)
Glöm ej control shift enter i hela tabellen e
𝑌 = 𝑋 β + 𝐸
- E = error term
𝐸 = 𝑌 − 𝑋β
3 methods:
1. Test statistics/Significance method
Reject H0 if thetest statistics > critical value.
I f H0:β1 = 0
If H0:β results to have test statistic 5,1 we’ll reject
- Reject H0:β = 0 since 5,1 > 1,96
2. C
onficende interval
→ reject H0 if itsnot includedin the interval.
3. P
-value approach
Reject H0 ifP-value is < significance level
- I f its very small it means that the null hyponthesis in not applicable
which means that we reject it.
- If its very large then we'll fail to reject.
MLE method
- M aximum Likelihood Estimation
- The idea is to find the probability to describe different observations.
powerful and flexible method to estimate both linear and non-linear regression
A
models.
irst we calculate the information matrix (there are 2 options) and then calculate the
F
variance covariance matrix by
Information matrix:
-
Variance covariance matrix
N = nr of observations = T = 100
I nformation matrix: (2 ways to calculate)
Way 1:
𝐴𝑣𝑒𝑟𝑎𝑔𝑒(𝑑𝑖𝑓ö
𝑟 ℎå𝑙 𝑙𝑎𝑛𝑑𝑒𝑡𝑖𝑙𝑙𝑁 = 100)
Way 2:
N-1 = 1/100
We reject if t(β) > critical value (ex. 5 sign. levelcritical value = +-1,96)
●
P
● - value =2 * (1 − 𝑁𝑂𝑅𝑀𝑆𝐷𝐼𝑆𝑇(𝐴𝐵𝑆(𝑇(β)))
○ We reject If it’s smaller than the significance level we reject.
Computer exercise 3: The AR and unit root test
The ACF
. Calculate continuous daily returns → rt
1
Add next to Time and Index
𝑃
𝑟𝑡 = 𝑙𝑛(𝑃𝑡 −1)
= 𝑙 𝑛 𝑃 𝑡
𝑡−1
otera:
N
Vi kommer inte ha något värde på första eftersom att vi inte har något att jämföra med
sedan tidigare.
2. Estimate the 3 first values of the sample ACF → r1, r2 & r3
Tau: Calculate lag return (what we get back duringdifferent time periods):
𝑇1 = 𝐶𝑜𝑟𝑟(𝑟𝑡 , 𝑟𝑡 −1)
𝑇2 = 𝐶𝑜𝑟𝑟(𝑟𝑡 , 𝑟𝑡 −2)
𝑇3 = 𝐶𝑜𝑟𝑟(𝑟𝑡 , 𝑟𝑡 −3)
3. P
erform a significance test for each of them.
→Reject if Zk > Tc
- T = observations
I detta fall har vi i grunden 500 observationer, i och med att period 1 inte ger något
värde börjar vi senare vilket resulterar i att r1, T = 499, r2, T = 498 och r3, T = 497.
- Däremot, i och med att vi har ett sån hög observationsgrad kommer vi inte att
behöva ta hänsyn till detta vid uträkning av P-value och rejection regien.
4. P
- Value
→ Reject if P - value < Sign.level
2 * (1-NORMSDIST(ABS(TestStat))
5. N
on rejection regien 95%
→ Reject if the value (Tau) is’nt in the interval.
.
6 lot the sample ACF on a Correlogram
P
a) Insert
b) Charts
c) All charts
d) Combo
e) Lower b and upper b = simple line
f) Tau = column bar
. L
1 ägg in värden
2. Välj form av dickey fuller test (Model A,B eller C)
3. Ta fram regression (Data analysis, regression → y = Delta Yt, X = Yt-1 --> klicka ej
i "constant is zero", gör vi det får vi fram modell A.)
4. Critical value
5. Räkna Dickey-fuller test statistics och se om vi ska reject H0 eller ej.
Model B
odel C
M
- we add not only the constant term (μ) but also a time trend (⋋) to the regression
model.
ψ = 𝑝 𝑠𝑖
λ = 𝑡𝑖𝑚𝑒𝑡 𝑟𝑒𝑛𝑑
µ = 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡𝑡𝑒𝑟𝑚
∆𝑦 = 𝑓𝑖𝑟𝑠𝑡𝑑 𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑐𝑒𝑖 𝑛𝑡ℎ𝑒𝑖𝑛𝑑𝑒𝑥𝑣𝑎𝑙𝑢𝑒
∆𝑦𝑡−1 = 𝑙𝑎𝑔𝑔𝑒𝑑𝑖 𝑛𝑑𝑒𝑥
Critical value
- N = nr of observations
- Top row = significance level
enna funkar att använda om error termen (u) i modellen är white noise.
D
Om det är en autocorrelation i ΔYt så kommer dettasåklart att påverka errortermen och
därav kommer den ej att vara en error term längre.
I we assume that ΔYt only depends on Yt-1 then wehave to augment the model by one lag
is:
odel B (+µ)
M
∆𝑦𝑡 = ψ∆𝑦𝑡−1 + µ + α1∆
𝑦 1 + 𝑢𝑡
𝑡−
ψ = 𝑝
𝑠𝑖
λ = 𝑡𝑖𝑚𝑒𝑡 𝑟𝑒𝑛𝑑
µ = 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡𝑡𝑒𝑟𝑚
∆𝑦 = 𝑓𝑖𝑟𝑠𝑡𝑑
𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑐𝑒𝑖 𝑛𝑡ℎ𝑒𝑖𝑛𝑑𝑒𝑥𝑣𝑎𝑙𝑢𝑒
∆𝑦𝑡−1 = 𝑙𝑎𝑔𝑔𝑒𝑑𝑖 𝑛𝑑𝑒𝑥
DF Model B
A
SUMMARY OUTPUT regression:
- y = Delta Yt, X = Yt-1 och delta Yt-1--> klicka ej i "constant is zero", gör vi det får
vi fram modell A.
- Lägg först in ΔYt-1
Critical value
- N = nr of observations
- Top row = significance level
Critical value
- N = nr of observations
- Top row = significance level
We test if alpha (the intercepts) i is jointly zero for all the assets.
0 : a = 0 → Nx1
H
H1 : a ≠ 0
In order to test if alpha (the intercept) is zero we estmate the models:
1. Initial values
Lägg in valbara a och β
nder lab
U
a = 1
b = 1
ideo
V
a = 0
b = 1
2. Calculate errors for the regression (in this case 5)
a) M
atrix →Sigma (∑)
Since we have 5 portfolios this will be 5x5
1
=
𝑇
* ε𝑡 ' * ε𝑡
−1
= ε𝑡' * ε * ε𝑡
−1
= ε𝑡 * ε * ε𝑡'
MMULT(MMULT(Error matrix first row;Minverse of
=
matrix);TRANSPOSE(Error matrix first row)
𝑁
1
1
=− 2
𝑙𝑛(2π
) − 2
𝑙𝑛(𝑀𝐷𝐸𝑇𝐸𝑅𝑀(𝑚𝑎𝑡𝑟𝑖𝑥)) − 2
*et’ ∑-1et
Vi tar MDETERM istället för ABS då detta är determent och ej absolute.
f) S olver
Tot.likelihood
Change = a → B
Wald test
g) Wald test statistics
~ N(0,1)
X
= X2 +...+X21 00 then this will follow “Chisquare distribution”X2 ~ N(0,100)
Matrix:
●
●
MMULT(MMULT(TRANSPOSE(alphas);MINVERSE(Variance covariance
=
matrix));alphas)
est hypothesis
T
Critical value (Tc) = CHIINV(probability,deg_freedom)= CHIINV(0,05;5)
●
○ probability = sign.level = 5% in this case
○ deg_freedom = N = 5 in this case
● P-value = CHINDIST(J0)
The LR test is used to test wheter the restriction (a) is necessary or not.
. A
1 dd the restriction to a = 0
2. Solver
Only allow β to be changed
3. A
dd
lnL* = max log likelihood for the restricted model
InL = max log likelihood for the non-restricted model
est hypothesis
T
Critical value (Tc) = CHIINV(probability,deg_freedom)= CHIINV(0,05;5)
●
○ probability = sign.level = 5% in this case
○ deg_freedom = N = 5 in this case
● P-value = CHINDIST(LR)
e need to add the restriction that a = 0, meaning we have the restricted model.
W
In other words, we claim that the Sharp Lintner CAPM model holds empirically
given the sample data:𝐸[ 𝑅𝑖] = β𝑖𝑚(𝐸[ 𝑅𝑚
]) .
- I f we reject:
= unrestricted model
𝑟𝑡 = 𝑎 + β𝑅𝑚𝑡 + ε𝑡
e don’t need to add the restriction that a = 0, meaning we have the unrestricted
W
model.
In other words, we claim that the Sharp Lintner CAPM model does’nt hold
empirically given the sample data:𝐸[ 𝑅𝑖] = β𝑖𝑚(𝐸[ 𝑅𝑚
])
S ummary: both tests in this case give us the same conclusion that we cannot reject
the null hypothesis.
. Calculate returns
1
Log return on all prices
2. Within estimation window, run the OLS on the market model
- a lpha = intercept → y = firm return, x = price on market
- beta = slope → y = firm return, x = price on market
5. W
ithin the event window, find the abnormal return (AR), which is
observed/actual return minus
a. Observed return, Rit*
Ta från tidigare värden - returns (step 1)
b. Expected normal return E(Rit*|Ωit)
Observed value + alphat + betat
c. Abnormal return (AR)
Expected return - Observed return
7. T
est for specific event window
We get anevent windowandL
a. Mean(CAR)
SUM(Mean AR)
b. S.E.(Mean(CAR))
S.E.(Mean(AR))*SQRT(L)
c. t ratio
Mean(AR)/S.E.(Mean(CAR))
Reject if:
● T-ratio > Tc