Help with the estimation issue
조회 수: 2 (최근 30일)
이전 댓글 표시
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]
댓글 수: 0
답변 (2개)
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?
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?
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!