Fin.Assign I - Final

9
Financial Econometrics A: Assignment 1 Authors: Name: Ali Nabbi; Student ID: jhf187 Name: Diprete Iyabi; Student ID: xvg778 Name: Svenja Friess; Student ID: flv115 Name: Marius Zechner; Student ID: wfr551 Class: Class 3 October 24 th , 2014 THE FACULTY OF SOCIAL SCIENCES Department of Economics UNIVERSITY OF COPENHAGEN

Transcript of Fin.Assign I - Final

Page 1: Fin.Assign I - Final

Financial Econometrics A: Assignment 1

Authors: Name: Ali Nabbi; Student ID: jhf187

Name: Diprete Iyabi; Student ID: xvg778 Name: Svenja Friess; Student ID: flv115

Name: Marius Zechner; Student ID: wfr551 Class: Class 3

October 24th, 2014

T H E F A C U L T Y O F S O C I A L S C I E N C E S D e p a r t m e n t o f E c o n o m i c s U N I V E R S I T Y O F C O P E N H A G E N

Page 2: Fin.Assign I - Final

Exercise 1 - Model properties

Consider β-ARCH(1) model:

xt = σtzt where zt ∼ i.i.d N(0, 1)σ2t = ω + 1{xt−1<0}α |xt−1|β + 1{xt−1≥0}γ |xt−1|

β

where ω > 0, α, γ ≥ 0 and β ∈ [0, 2]

Part 1

Assumption I.1(i) is satisfied by construction of this model. The conditional density of Xt onall the past returns has the same distribution as Xt|Xt−1 because this model does not containother lags. (Markov chain property)

Assumption I.1(ii) note that considering the standard Normal distributed zt we can calcu-late xt|xt−1 ∼ N(0, σ2t ) As a consequence it has positive and continuous conditional density.Satisfying to assumptions above we can conclude that we can apply drift criterion to this model.

Part 2

In this part we are going to apply drift criterion to this model with δ(xt) = 1 + |xt|2 toinvestigate under which condition the second order moment is finite. For simplicity sake, theterm 1{xt−1<0}α+ 1{xt−1≥0}γ is denoted by η. Consider the following condition on indicators.

η =

{α xt → −∞γ xt → +∞

E(δ(xt)|xt−1) = E(1 + x2t |xt−1) = 1 + E(σ2t |xt−1).E(z2t ) = 1 + E(σ2t |xt−1)= 1 + ω + ηE(|xt−1|β |Xt−1) = 1 + ω + η |xt−1|β

= [1 + ω

1 + |xt−1|2+

η |xt−1|β

1 + |xt−1|2]δ(xt−1)

Note that the first term converges to zero as xt−1 goes to +∞ or −∞. The second term hasto be divided in two cases below.

• if β = 2 then the second term converges to η. Using AI2(i):

E(δ(xt)|xt−1) = ηδ(xt−1) ≤ φδ(xt−1), φ < 1

As a result, drift criterion is satisfied if η < 1 which can be written as

1{xt−1<0}α+ 1{xt−1≥0}γ < 1⇒ max(α, γ) < 1

• if β ∈ [0, 2) then the second term converges to zero. Using AI2(ii):

E(δ(xt)|xt−1) = 0 ≤ C

as a conclusion, if β = 2 and max(α, γ) < 1 then Xt is stationary, weakly mixing andE |xt|2 <∞ and if β ∈ [0, 2) drift criterion is always satisfied.

1

Page 3: Fin.Assign I - Final

Exercise 2 - Asymptotic analysis

Part 1

The conditional density of the β-ARCH(1) model will be:

f(xt|xt−1) =1√

2πσ2texp

(− 1

2σ2tx2t

)Then the maximum likelihood function will be:

L(θ) =

T∏t=1

1√2πσ2t

exp

(− 1

2σ2tx2t

)To find out the log-likelihood function, we have to take a logarithm of the likelihood function:

l(θ) = ln

[T∏t=1

1√2πσ2t

exp

(− 1

2σ2tx2t

)]=

T∑t=1

ln

[(2πσ2t )

− 12 exp

(− 1

2σ2tx2t

)]

=T∑t=1

[− 1

2ln(2π)− 1

2ln(σ2t )−

x2t2σ2t

]= −T

2ln(2π)− 1

2

T∑t=1

ln(σ2t )−1

2

T∑t=1

x2tσ2t

The score of the β-ARCH(1) model will be:

s(θ) =∂l(θ)

∂α= −1

2

T∑t=1

1{xt−1<0} |xt−1|β

σ2t+

1

2

T∑t=1

1{xt−1<0} |xt−1|β

(σ2t )2

.x2t

= −1

2

T∑t=1

(1

σ2t− x2t

(σ2t )2).1{xt−1<0} |xt−1|β

= −1

2

T∑t=1

(1− x2tσ2t

).1{xt−1<0} |xt−1|β

σ2t=

T∑t=1

f(xt, xt−1)

We can conclude easily that 1√Ts(θ) = 1√

T

∑Tt=1 f(xt, xt−1)

Part 2

We need to show that the conditional expected value of the f(xt, xt−1) is equal to zero.

E(f(xt, xt−1)|xt−1) = E(−1

2(1− x2t

σ2t)1{xt−1<0} |xt−1|β

σ2t|xt−1)

= −1

2.1{xt−1<0} |xt−1|β E((1− z2t )

1

σ2t|xt−1)

= −1

2.1{xt−1<0} |xt−1|β E((1− z2t )|xt−1).E(

1

σ2t|xt−1)

= −1

2.1{xt−1<0} |xt−1|β (1− E(z2t )).

1

σ2t

Consider the characterization of zt of β-ARCH(1) model: zt ∼ i.i.d N(0, 1) ⇒ Ez2t = 1.As a consequence E(f(xt, xt−1)|xt−1) = 0. Due to the result of exercise 1, the drift criterion issatisfied with drift function δ(xt) = 1 + |xt|2 under certain conditions. Moreover the TheoremI.2 is satisfied and we can apply Theorem II.1:

2

Page 4: Fin.Assign I - Final

1√Ts(θ) =

1√T

T∑t=1

f(xt, xt−1) ∼ N(0, Ef2(xt, xt−1))

To conclude the statement above two more assumptions have to be satisfied:

• E(f(xt, xt−1)|xt−1) = 0 which has been proven earlier.

• E∣∣f2(xt, xt−1)∣∣ <∞ where f(xt, x[t− 1]) = −1

2(1− x2tσ2t).

1{xt−1<0}|xt−1|β

σ2t

E∣∣f2(xt, xt−1)∣∣ =

1

4E[(1− x2t

σ2t)2.(

1{xt−1<0} |xt−1|β

σ2t)2]

=1

4E[E[(1− x2t

σ2t)2.(

1{xt−1<0} |xt−1|β

σ2t)2|xt−1]]

=1

4E[E[(1− z2t )2.(

1{xt−1<0} |xt−1|β

σ2t)2|xt−1]]

=1

4E[(

1{xt−1<0} |xt−1|β

σ2t)2E(1− z2t )2]

=1

4E[(

1{xt−1<0} |xt−1|β

σ2t)2(1− 2Ez2t + Ez4t )]

=1

2E[(

1{xt−1<0} |xt−1|β

σ2t)2] =

1

2E

[( 1{xt−1<0}ω

|xt−1|β+ 1{xt−1<0}α+ 1{xt−1≥0}γ

)]

<1

2E

[( 1{xt−1<0}1{xt−1<0}α+ 1{xt−1≥0}γ

)]<∞

In the calculations above, zt is standard Normally distributed which means Ezt = 0, Ez2t =1, Ez4t = 3 and note that first term in the denominator converges to zero as xt−1 goes to infinity.As a conclusion score is asymptotically Normally distributed according to Theorem II.1.

Part 3

According to the part 2 using Theorem II.1 we can easily conclude that assumption 1 of theTheorem III.2 holds so we will have the following statement:

1√Ts(θ0) =

1√T

∂l(θ)

∂θ

∣∣∣∣∣θ=θ0

D−→ N(0, σ2α)

Note that the value of the σ2α has been calculated in the part 2. Assuming the assumptions 2and 3 are satisfied we can conclude that the estimated parameter is unique (B.1), it converges tothe true value in other words LLN can be applied (B.2) and it is normally distributed in otherwords CLT can be applied (B.3) then the standard errors can be calculated based on them.

Part 4

Consider the drift function as δ(xt) = 1 + |xt|δ and Jensen inequality for concave function

g(x) = xδ2 then to investigate the drift criterion we have:

3

Page 5: Fin.Assign I - Final

E(δ(xt)|xt−1) = 1 + E(|xt|δ |xt−1) = 1 + E(|xt|2δ2 |xt−1) 6 1 +

[E(|xt|2 |xt−1)

] δ2

6 1 +[E(σ2t z

2t |xt−1)

] δ2 = 1 + E |zt|δ

[E(σ2t |xt−1)

] δ2

6 1 + E |zt|δ[E(ω + η |xt−1|β |xt−1)

] δ2 = 1 + E |zt|δ

[ω + η |xt−1|β)

] δ2

6[ 1

1 + |xt−1|δ+ E |zt|δ

(ω + η |xt−1|β

) δ2

1 + |xt−1|δ]δ(xt−1)

By multiply and divide the nominator and denominator of the fraction in the second termwith 1

|xt−1|βδ2

, we will have:

• Nominator:[

ω|xt−1|β

+ η] δ

2which converges to η

δ2 as |xt−1| → ∞

• Denominator: 1

|xt−1|βδ2

+ |xt−1|δ

(|xt−1|δ)β2

which converges to 1 as |xt−1| → ∞

As a conclusion, E(δ(xt)|xt−1) 6 ηδ2E |zt|δ δ(xt−1) so the drift criterion is satisfied if η

δ2E |zt|δ <

1 in other words (1{xt−1<0}α+ 1{xt−1≥0}γ)δ2E |zt|δ < 1 or E |zt|δmax(α

δ2 , γ

δ2 ) < 1.

Exercise 3 - Estimation

Part 1

(a) The empirical variance as the initial value

Using 1T

∑Tt−1 x

2t any initial value does not change our results from the corresponding model.

Based on the Theorem I.2’s final statement, we can apply the law of large numbers which meansthe importance of the initial value vanishes as T converges to infinity.

(b) Initialization of the parameters

The initialized value of the parameters has to satisfied the characterization of the β-ARCH(1)model, namely ω > 0, α, γ ≥ 0, β ∈ [0, 2]. No matter which values are taken in these criteriathe program replaces them with the estimated values for each parameter. As a consequence,changes in the initial value of the parameters never change the calculated estimated values.

(c) Parameters, standard errors and log-likelihood value

The estimated values of parameters and standard errors are summarized below:

Parameters Value Std. Error Robust S.E

ω 0.701695 0.0467191 0.0943559α 1.04207 0.147627 0.376843γ 0.662659 0.0987268 0.172074β 1.67823 0.149002 0.270937

Moreover the value of the log-likelihood function is equal to -2309.36.

Exercise 4 - Residual Analysis

Part 1

Given the estimated parameters we can calculate σ2t easily and respectively find the value ofthe residuals using zt = xt

σt.

4

Page 6: Fin.Assign I - Final

(i) Normality

Consider the comparison between the density of the estimated residuals and the Normal density.In the following figure, we can easily see that the distribution of the residuals is not Gaussian.

Figure 1: The density of zt in comparison with Guassian

To emphasize on the fat tails of the zt distribution, QQ-plot is attached below.

Figure 2: The QQ-Plot of zt against the Normal distribution

(ii) ARCH effects

To consider the ARCH effect in β-ARCH(1) model, we have to consider the autocorrelationfunction of the estimated residuals and the estimated residuals squares which leads us to thenext figure.

Figure 3: The Autocorrelation function of zt and z2t

We can see that zts are independent while z2t s are dependent. As a conclusion the estimatedresiduals have ARCH effects.

Part 2

The model is not fit to the data with existing assumptions. From the results of the previousparts, we have non-Guassian residuals and ARCH effect. To fix these problems we have to

5

Page 7: Fin.Assign I - Final

change the Normality assumption of the residuals or changing the structure of the σ2t which isequivalent to using another model.

Appendix - Ox Code

#include <oxstd.oxh>

#include <oxfloat.h>

#import <maximize>

#include <oxdraw.oxh>

decl data;

logLikCon(logLikValue, parameters)

{

decl N, omega, alpha, gamma, beta, lik, Sigma2;

N = rows(data);

omega = parameters[0];

alpha = parameters[1];

gamma = parameters[2];

beta = parameters[3];

Sigma2 = ones(N,1);

Sigma2[0][] = (1/(N-1))*sumc(data[1:N-1][0].^2);

for(decl i=1; i<N; ++i)

{

if (data[i-1][]<0)

Sigma2[i][]=parameters[0] + parameters[1]*fabs(data[i-1][])^parameters[3];

else

Sigma2[i][]=parameters[0] + parameters[2]*fabs(data[i-1][])^parameters[3];

}

lik = zeros(N,1);

for(decl i=0;i<N;++i)

{

lik[i] = -0.5*log(M_2PI)-0.5*log(Sigma2[i][])-0.5*(data[i][]^2)/Sigma2[i][];

}

logLikValue[0] = lik;

return 1;

}

logLik(parameters, Func, Score, Hessian)

{

decl likValue;

logLikCon(&likValue, parameters);

6

Page 8: Fin.Assign I - Final

Func[0]= double(sumc(likValue));

return 1;

}

main()

{

decl input = loadmat("ftse-100.in7");

data=input[1:sizer(input)-1][5];

decl pars = <1.2;1.5;0.1;0.5>;

decl i, report, logLikValue;

MaxControl(-1, -1);

report = MaxBFGS(logLik, &pars, &logLikValue, 0, TRUE);

print("\n\n", MaxConvergenceMsg(report), " Using numerical derivatives", "\n\n log-likelihood value \t", logLikValue[0], "\n\n Estimated parameters (MLE): \n Omega \t\t\t\t\t", pars[0], "\n Alpha \t\t\t\t\t", pars[1], "\n Gamma \t\t\t\t\t", pars[2], "\n Beta \t\t\t\t\t", pars[3]);

decl GridNr = 1000;

decl counter;

decl omegapar = zeros(GridNr,1);

decl alphapar = zeros(GridNr,1);

decl gammapar = zeros(GridNr,1);

decl betapar = zeros(GridNr,1);

for (counter=0;counter<GridNr;++counter)

{

omegapar[counter][] = 0.0+counter*2/(GridNr-1);

alphapar[counter][] = 0.0+counter*2/(GridNr-1);

gammapar[counter][] = 0.0+counter*2/(GridNr-1);

betapar[counter][] = 0.0+counter*2/(GridNr-1);

}

decl valueOfLikelihood=zeros(GridNr,1);

decl w, a, g, b, vectorpar, temp;

for (counter=0;counter<GridNr;++counter)

{

w = pars[0][0];

a = alphapar[counter][];

g = pars[2][0];

b = pars[3][0];

vectorpar = (w~a~g~b)’;

logLik(vectorpar, &temp, 0, 0);

valueOfLikelihood[counter][] = temp;

}

decl Hessian, Score;

NumJacobian(logLikCon, pars, &Score);

Num2Derivative(logLik, pars, &Hessian);

7

Page 9: Fin.Assign I - Final

decl Information = -invert(Hessian);

print("\n\n");

print(" Std. error of Omega \t", sqrt(Information[0][0]), "\n");

print(" Std. error of Alpha \t", sqrt(Information[1][1]), "\n");

print(" Std. error of Gamma \t", sqrt(Information[2][2]), "\n");

print(" Std. error of Beta \t", sqrt(Information[3][3]), "\n");

decl Sandwich;

Sandwich = Information*(Score’Score)*Information;

print("\n\n");

print(" Robust SE of Omega \t", sqrt(Sandwich[0][0]), "\n");

print(" Robust SE of Alpha \t", sqrt(Sandwich[1][1]), "\n");

print(" Robust SE of Gamma \t", sqrt(Sandwich[2][2]), "\n");

print(" Robust SE of Beta\t\t", sqrt(Sandwich[3][3]), "\n");

/////////////////////////////////////////////////////////////

decl Sigma2Hat, resid, resid_sq;

Sigma2Hat = ones(sizer(data),1);

for(i=1; i<sizer(data)-1; ++i)

{

if (data[i-1][]<0)

Sigma2Hat[i][]=pars[0] + pars[1]*fabs(data[i-1][])^pars[3];

else

Sigma2Hat[i][]=pars[0] + pars[2]*fabs(data[i-1][])^pars[3];

}

resid = zeros(sizer(data), 1);

resid_sq = zeros(sizer(data), 1);

resid = data./sqrt(Sigma2Hat);

resid_sq = resid.^2;

savemat("residuals_combined.in7", resid~resid_sq, {"Residuals","Residuals_squared"});

SetDrawWindow("Residuals z");

DrawTMatrix(0,resid’, "Residuals");

ShowDrawWindow();

}

8