Autoregressive AR(2) Model Constraints/Parameters

조회 수: 7 (최근 30일)
Sam
Sam 2013년 12월 4일
편집: Sam 2013년 12월 4일
I need to plot a sample (of length 500) of an AR(2) process, with the following constraints.
Model: X_t=c+phi_1*X_t-1+...
Where X_0=X_1=0 and c=0, phi_1=3/2, phi_2=-3/4 and sigma^2=1/4
Do I use the arima function? How do I specify the constraints?

채택된 답변

Sam
Sam 2013년 12월 4일
편집: Sam 2013년 12월 4일
Not to worry, the below works.
%%AR(2)
c = 0;
phi = [3/2, -3/4];
x(1)=0;
x(2)=0;
for t=3:n
x(t) = c + phi(1)*x(t-1) + phi(2)*x(t-2) + y(t);
end
plot(x, '-');
xlabel('t','fontsize',15);
ylabel('X(t)', 'fontsize', 15);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conditional Mean Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by