Autoregressive AR(2) Model Constraints/Parameters

1 view (last 30 days)
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?

Accepted Answer

Sam
Sam on 4 Dec 2013
Edited: Sam on 4 Dec 2013
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);

More Answers (0)

Categories

Find more on Conditional Mean Models in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!