|
|
#4
gready2007-05-20 14:01
ARMA(1,1)的数据生成机制是: %estimating ARMA(1,1) via conditional least squares %phi=0.8, true AR coefficient %theta=0.3, true MA coefficient %n--sample size %generate 200 observations from an ARMA(1,1) model n=150; e=randn(n+100,1); %generate 250 obs, and discard the first 100 x=filter([1 0.3],[1 -0.8],e); %simulated data x=x(101:n+100); %discard the first 100 obs. subplot(2,1,1); plot(x); %initial value for the conditional least squares phi=0.5; theta=0.5; ep=zeros(n,1); %maximum iteration 30 for j=1:30; ep=filter([1 -phi],[1 theta],x);% the residuals z1=filter(1,[1 theta],x); %the derivative wrt phi z2=filter(1,[1 theta],ep); %the derivative wrt theta z=[z1,z2]; z=z(1:n-1,:); ep=ep(2:n); delta=inv(z'*z)* z'*ep %Gauss-Newton adjustment phi=phi+delta(1); theta=theta+delta(2);%updated estimator for theta if norm(delta)<0.001 break; end end 后面红色部分是用来检验数据生成后的数据是否符合ARMA(1,1)的。 另外ARFIMA模型的公式就是在ARMA的基础上进行差分,但是是分数阶差分。谢谢了。
|