Help with the estimation issue

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 日

1 投票

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 日

1 投票

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 日
編集済み: dav 2013 年 10 月 9 日
I appreciate your help.
However, I have to use this in a simulation and thus I cannot do it your way. I just gave you the code for one simulation. and depending on the coefficients i get from this SINGLE run I have to do a lot more calculations.
So I have to find a way to get better estimates from a single run.
Thanks
P.S the results from your code are better but the estimate for the first coefficient is still off and it gives me lot of issues in my simulation results!
Youssef  Khmou
Youssef Khmou 2013 年 10 月 9 日
ok thats all available so far, last thing , i do not understand why you choosed only part of y1 while its pure random vector? and why C(...,1) is unity?
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?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

質問済み:

dav
2013 年 8 月 29 日

コメント済み:

dav
2013 年 10 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by