Help with the estimation issue

2 views (last 30 days)
dav
dav on 29 Aug 2013
Commented: dav on 11 Oct 2013
hello,
The following code should give estimates alpha0 = 0.1 and ar1 = 0.4.
When I use normal random errors (randn(1,1)) in the data generation i get very good estimates.
However, when I changed it to t distributed random errors with 5 degrees of freedom (trnd(5,1)), the estimates are very off.
Is there a way to fix this please?
Code:
clc;
clear;
lb = [0 0]';
a0 = 0.1; a1 = 0.4;
sigma=zeros(3000,1);
y1=zeros(3000,1);
sigma(1) = a0/(1-a1);
for i = 1:3000
y1(i) = sigma(i)*trnd(5,1);
sigma(i+1) = sqrt(a0 + a1*(y1(i)^2));
end
y1 = y1(2001:3000);
y2 = y1.^2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ESTIMATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
y = y2;
len = length(y);
C = zeros(len,2);
C(1:len,1) = 1;
C(2:len,2) = y(1:len-1,1);
options = optimset('Display','off','LargeScale','off');
coef = lsqlin(C,y,[0 1],1,[],[],lb,[],[],options);
alpha0 = coef(1);
ar1 = coef(2);
[alpha0 ar1]

Answers (2)

Youssef  Khmou
Youssef Khmou on 9 Oct 2013
Edited: Youssef Khmou on 9 Oct 2013
As preliminary answer, the Student's t distribution converges to Normal distribution when the degree of freedom tends to Infinity, can't you try with higher number instead of 5?
  1 Comment
dav
dav on 9 Oct 2013
Actually, I need to do it with 5 degrees of freedom. This is a part of my research and I am literally stuck with it just because of this issue.
Is there anyway you can help me?
thanks.

Sign in to comment.


Youssef  Khmou
Youssef Khmou on 9 Oct 2013
Edited: Youssef Khmou on 9 Oct 2013
there are no details for this implementation, however two successive runs return different results , you can estimate your result over a number of runs :
clc;clear;
K=100; % Number of runs
lb = [0 0]';a0 = 0.1; a1 = 0.4; N=3000;
sigma=zeros(N,1);y1=zeros(N,1);
sigma(1) = a0/(1-a1);P=1001;
options = optimset('Display','off','LargeScale','off');
for k=1:K
for i = 1:N
y1(i) = sigma(i)*trnd(5,1);
sigma(i+1) = sqrt(a0 + a1*(y1(i)^2));
end
y1 = y1(P:N);
y2 = y1.^2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ESTIMATION %%
y = y2;
len = length(y);
C = zeros(len,2);
C(1:len,1) = 1;
C(2:len,2) = y(1:len-1,1);
coef = lsqlin(C,y,[0 1],1,[],[],lb,[],[],options);
CC(:,k)=coef;
end
alpha0=mean(CC(1,:))
ar1=mean(CC(2,:))
change the variable K and conclude, does it converge to the solution?
  4 Comments
dav
dav on 9 Oct 2013
It just to minimize the effect of initial conditions (sigma(1) = a0/(1-a1))
And i want to estimate the coefficient and thats whay i used C(...,1) = 1 in lsqlin.
Thanks a lot for your help. I will be very grateful to you if you could help me fix this issue.
dav
dav
dav on 11 Oct 2013
do you know the code to estimate these parameters using maximum likelihood in matlab please?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!