How can I generate an AR(1) process with function filter.m?

4 vues (au cours des 30 derniers jours)
Sergio
Sergio le 23 Sep 2014
I tried with this code, but I'm not sure about the result...
e=randn(500,1) b=[1 phi]; y=filter(b,1,e);
Note: phi is the coefficient of the lagged variable.

Réponses (1)

Roger Wohlwend
Roger Wohlwend le 24 Sep 2014
You did not implement an AR(1) but an MA(1) process. It is not possible to generate an AR(1) process with the function filter. You have to do it with a for-loop - or use certain functions of the Econometrics toolbox.

Catégories

En savoir plus sur PHY Components dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by