Autoregressive AR(2) Model Constraints/Parameters

2 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Sam
Sam il 4 Dic 2013
Modificato: Sam il 4 Dic 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);

Più risposte (0)

Categorie

Scopri di più su Conditional Mean Models in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by