[Rd] predict.Arima fails when x is not a time-series

David Brahm brahm@alum.mit.edu
Wed, 3 Apr 2002 18:02:21 -0500


I'm playing with predict.Arima in the 3/19/02 development snapshot of R-devel.
The following produces an error message because x is not of class "ts":
  R> x <- rnorm(20)
  R> obj <- arima(x, c(2,0,0))
  R> predict(obj)
     Error in round(x, digits) : Non-numeric argument to mathematical function

Granted the documentation for arima says x should be a time-series, but why not
accommodate simple vectors?  I think it would suffice to change this line:
  xtsp <- tsp(data)
in predict.Arima to this:
  xtsp <- tsp(hasTsp(data))

Also, a minor documentation typo: the help file for predict.Arima refers to the
function as "predict.arima" at one point.
-- 
                              -- David Brahm (brahm@alum.mit.edu)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._