如何在AR(2)过程中扩展到特定方差

时间:2014-10-22 01:34:58

标签: matlab variance

我有一个AR(2)过程输出Z(t) = a*Z(t-1) + b*Z(t-2) + u(t),其中u(t)是加性高斯白噪声。如何将输出观测Z的方差变为1?

1 个答案:

答案 0 :(得分:2)

假设过程Z(t)= a Z(t-1)+ b Z(t-2)+ c * u(t)是静止的(请在此处查看http://faculty.chicagobooth.edu/ruey.tsay/teaching/uts/lec2-08.pdf ),

c = sqrt(1-b^2-a^2*(1+b)/(1-b))

Matlab代码:

Nt = 1000; Nseries = 10000; 
Zt = zeros(Nt,1); varZ = zeros(Nt,1);
a = 0.95; b = -0.195; c = sqrt(1 - b^2 - a^2*(1+b)/(1-b) );

for i = 1 : Nseries
z = zeros(Nt,1);
z(1) = randn(1);  z(2) = randn(1);
for t = 3 : Nt
    z(t) = a * z(t-1) + b * z(t-2) + c * randn(1); 
end
Zt(i) = z(Nt);
varZ(i) = var(z);
end

% variance at time point Nt
var(Zt) 

%distr of variance estimator
[y,x] = hist(varZ,20);
bar(x,y)