Help with the estimation issue

조회 수: 2 (최근 30일)
dav
dav 2013년 8월 29일
댓글: dav 2013년 10월 11일
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]

답변 (2개)

Youssef  Khmou
Youssef Khmou 2013년 10월 9일
편집: Youssef Khmou 2013년 10월 9일
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
dav
dav 2013년 10월 9일
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.

댓글을 달려면 로그인하십시오.


Youssef  Khmou
Youssef Khmou 2013년 10월 9일
편집: Youssef Khmou 2013년 10월 9일
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
dav
dav 2013년 10월 9일
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 2013년 10월 11일
do you know the code to estimate these parameters using maximum likelihood in matlab please?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by