[R] problem with 'gnls'

Bruno Tona tona at stat.math.ethz.ch
Wed Jan 8 15:12:03 CET 2003


I am working with data measured in a tunnel to estimate the
emission factor of heavy & light vehicles.

I tried to use 'gnls' and I get the following Error:
>> Error in "coef<-.corARMA"(*tmp*, value = c(174.267493382104, 173.412740072763
>> Coefficient matrix not invertible


Here is my R-code:  (You can paste it directly into R)

 data <- read.table('http://www.stat.math.ethz.ch/~tona/Data/d.plabutsch.neu')
 
 # calculating the starting coeficients:
 library("MASS")
 library("lqs")
 r.CO2.rlm <- rlm(EF.CO2 ~ pLKW.total + Sat + Sun + Fz.total,
                  data = data, method = "MM", na.action = na.exclude)
 START <- coef(r.CO2.rlm); names(START) <- letters[1:5]; START
 ##           a           b           c           d           e 
 ## 192.6353049 796.3362315 -35.3434214 -58.8489047  -0.1085019 

 # 'gnls':
 library("nlme")
 r.CO2.gnls <- gnls(log(EF.CO2) ~ log(a + b * pLKW.total) + c * Sat +
                    d * Sun + e * Fz.total,start = START, data = data,
                    correlation=corARMA(p=2,q=0), na.action = na.exclude)
 ## Error in "coef<-.corARMA"(*tmp*, value = c(174.267494204742, 173.41274089312
 ##	Coefficient matrix not invertible




I also tried with an AR(3) and an AR(1). The AR(3) gives the same
error like above and the AR(1) gives the error:
>> Error in optim(fn = function(gnlsPars) -logLik(gnlsSt, gnlsPars), par = c(coef(gnlsSt)),  : 
>>      initial value in vmmin is not finite
>> In addition: There were 14 warnings (use warnings() to see them)


Thanks for any help

regards
Bruno Tona




More information about the R-help mailing list