[R] ArimaLike NaN return

Matwey V. Kornilov matwey.kornilov at gmail.com
Sun May 5 14:19:44 CEST 2013


Hi,

 > sessionInfo()
R version 3.0.0 (2013-04-03)
Platform: x86_64-unknown-linux-gnu (64-bit)

I am experiencing following problem. I am trying to fit arima(2,0,4) 
model, and optim complaint that armafn provides it with infinite value. 
I found that it is because sumlog (res[2L]) (see stats/R/arima.R line 
64) is NaN, because of gain in function ARIMA_Like (see 
stats/src/arima.c line 674) becomes negative and log() of this is 
calculated.

However, writing down expression for log-likelihood for ARIMA I don't 
see any poles in this expression, so I would rather consider that 
something wrong with evaluation here.

How to find, what is wrong here?


p.s. Does anybody know what the following code is intended to do? 
(ARIMA_Like stats/src/arima.c)

             if(gain < 1e4) {
                 nu++;
                 ssq += resid * resid / gain;
                 sumlog += log(gain);
             }

I mean there is some hard coded magic value 1e4...



More information about the R-help mailing list