[R] R-help: gls with correlation=corARMA

gaffigan@sfos.uaf.edu gaffigan at sfos.uaf.edu
Fri Dec 9 03:52:05 CET 2005


Dear Madams/Sirs,

Hello.  I am using the gls function to specify an arma correlation during 
estimation in my model.  The parameter values which I am sending the 
corARMA function are from a previous fit using arima.  I have had some 
success with the method, however in other cases I get the following error 
from gls:  "All parameters must be less than 1 in absolute value".  None 
of the parameters (individually) are greater than or equal to 1.  
Please copy the code below into R to reproduce the error.  Thanks.

Is my logic incorrect?  In the corARMA function, there's a call to 
pre-compiled C code with the name "ARMA_unconstCoef".  Is the source 
code for such compiled code freely available for download?

Thanks for your suggestions.

Sincerely

Steve Gaffigan

data=read.table("http://ak.aoos.org/data/sample_070989.dat",header=T)
attach(data)
mod.ols=lm(obs~model)
mod.sma=arima(residuals(mod.ols),order=c(0,0,1),seasonal=list(order=c(0,0,2),period=12))
theta.1=mod.sma$coef[1]
THETA.1=mod.sma$coef[2]
THETA.2=mod.sma$coef[3]
ma.coefs=c(-theta.1,double(10),-THETA.1,theta.1*THETA.1,double(10),-THETA.2,theta.1*THETA.2)
library(nlme)
mod.gls=gls(obs~model,correlation=corARMA(q=25,value=ma.coefs,fixed=T),method="ML")
detach(data)

-- 
Alaska Ocean Observing System
School of Fisheries and Ocean Sciences : University of Alaska Fairbanks




More information about the R-help mailing list