Skip to content
Prev 62749 / 63424 Next

Possible issue in stats/arima.R package

On 2025-01-02 9:04 a.m., Norbert Kuder wrote:
I think you're right about this one.
In the R-devel source I see mod being used in the next statement:

         mod <- makeARIMA(trarma[[1L]], trarma[[2L]], Delta, kappa, SSinit)
         val <- if(ncxreg > 0L)
             arimaSS(x - xreg %*% coef[narma + (1L:ncxreg)], mod)
         else arimaSS(x, mod)

It appears in both alternatives of the if statement.

This one is strange though:  the code in the github mirror 
(https://github.com/wch/r-source/blob/4a1ed749271c52e60a85e794e6f34b0831efb1ae/src/library/stats/R/arima.R#L256-L258) 
is different:

         mod <- makeARIMA(trarma[[1L]], trarma[[2L]], Delta, kappa, SSinit)
         if(ncxreg > 0) x <- x - xreg %*% coef[narma + (1L:ncxreg)]
         arimaSS(x, mod)

yet the log shows no recent changes.  I'm not sure what's going on.

Duncan Murdoch