[Numpy-discussion] simulate AR
Fri Oct 14 13:29:46 CDT 2011
On Fri, Oct 14, 2011 at 2:18 PM, Alan G Isaac <firstname.lastname@example.org> wrote:
> On 10/14/2011 1:42 PM, email@example.com wrote:
>> If I remember correctly, signal.lfilter doesn't require stationarity,
>> but handling of the starting values is a bit difficult.
> Hmm. Yes.
> AR(1) is trivial, but how do you handle higher orders?
I would have to look for it.
You can invert the stationary part of the AR polynomial with the numpy
polynomial classes using division. The main thing is to pad with
enough zeros corresponding to the truncation that you want. And in the
old classes to watch out because the order is reversed high to low
instead of low to high or the other way around.
I switched to using mostly lfilter, but I guess the statsmodels
sandbox (and the mailing list) still has my "playing with ARMA
(I think it might be pretty useful for teaching. I wished I had the
functions to calculate some examples when I learned this.)
> NumPy-Discussion mailing list
More information about the NumPy-Discussion