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