Skip to content
Prev 12408 / 63461 Next

arima

On Sun, 18 Apr 2004 kjetil@entelnet.bo wrote:

            
We had a debate about that a while back. Seems the majority opinion is
that a ts can have any atomic mode (numeric, integer, complex, logical,
character), but that most of the analysis code assumes a ts object is
numeric.  So arima() contains

    x <- as.ts(x)
    if(!is.numeric(x))
        stop("`x' must be numeric")
    storage.mode(x) <- "double"  # a precaution
!
Yes, sort of (xreg=NULL cannot have storage mode "double"), and those
coercions _are_ already inside arima.


I think the issue is that you need to be more careful using KalmanSmooth:  
my.ts would not have been returned by arima(). The Kalman* functions are
internal workhorses and there is a `Warning' about precisely this on their
help page.  I suggest you write a tsSmooth method and use that rather than
calling KalmanSmooth directly.