On Sun, 18 Apr 2004 [EMAIL PROTECTED] wrote: > I got problems using an objects returned from arima > (in KalmanSmooth(my.ts, ModArima$model), because > my.ts showed up to have storage mode "integer" (is.integer(my.ts was > TRUE). > > Should storage.mode() of a ts be allowed to be integer,
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 ! > should ts() someplace say storage.mode(ts.out) <- "double", or > maybe inside arima() > storage.mode(x) <- "double" > storage.mode(xreg) <- "double" > ? 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. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-devel