[R] Fitting AR(p) models

Jason Turner jasont at indigoindustrial.co.nz
Thu Oct 9 23:04:50 CEST 2003


Laura Quinn wrote:
> I am wanting to fit AR(p) models to column data for a series of matrices
> I have. Rather than trying to compute the AR models "per column" I was
> hoping to be able to do this per matrix (i.e. one AR model for each column
> in said matrix). However, when i attempt this, if there is just one "NA"
> value in any of the columns, the program refuses to compute AR models for
> any of the columns.(I am using na.action=na.omit)
> 
> Is there a way I can force the calculation to provide AR models for
> complete columns, or alternatively, a better way to deal with NA's to
> provide an AR model, (eg via interpolation?) despite some missing values?

Interpolation might not make sense for your data.  Can't tell from here. 
  Certainly it's quick, but it can also be pretty dirty - it 
over-weights those data regions.  You can get around this by 
interpolating, then selecting a lower resolution (window with a larger 
deltat), and build your model from that.

If the NAs are few and far between, some additional code to pick where 
the NAs are in each column, and build AR models from the longest 
continuous segment might be preferable.

Apart from that, there's not much else I can add.  Other takers?

Jason
-- 
Indigo Industrial Controls Ltd.
http://www.indigoindustrial.co.nz
64-21-343-545
jasont at indigoindustrial.co.nz




More information about the R-help mailing list