search for: hastsp

Displaying 3 results from an estimated 3 matches for "hastsp".

Did you mean: hasdsp
2002 Apr 03
1
predict.Arima fails when x is not a time-series
...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 m...
2014 Apr 19
1
lag() not returning a time series object
...ger" > class(as.ts(lag(avec))) [1] "ts" Am I missing something, or would the lag() function benefit from a small adjustment : function (x, k = 1, ...) { if (k != round(k)) { k <- round(k) warning("'k' is not an integer") } x <- hasTsp(x) p <- tsp(x) tsp(x) <- p - (k/p[3L]) * c(1, 1, 0) as.ts(x) # adjusted, was simply x before } Cheers Joris -- Joris Meys Statistical consultant Ghent University Faculty of Bioscience Engineering Department of Mathematical Modelling, Statistics and Bio-Informatics tel : +32...
2009 Jun 14
1
time function behavior for ts class objects
...1975 1975 1975 1975 I would have expected the 1973 row to contain 1973 for all months and not to have a jump after Jun 1973 to Jul 1974. That is I would expect something like: R> ## const my own time specific to this xts R> y <- c(rep(1973,12),rep(1974,12)) R> (tsp(y) <- attr(hasTsp(xts),"tsp")) [1] 1973 1975 12 R> (my.time.ts <- as.ts(y)) Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 1973 1973 1973 1973 1973 1973 1973 1973 1973 1973 1973 1973 1973 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 I certainly don't think...