Skip to main content
27 events
when toggle format what by license comment
Jul 23, 2012 at 23:48 comment added user603 No: but i think you are confused about basic time series stuff. Try to look for "moving window estimation". Otherwise ask a separate questions.
Jul 23, 2012 at 23:46 comment added Damien @user602: So we are using 36 windows of size 12 to get the forecasts. To get the projected values for the next 10 time periods, we would need to use 46 windows?
Jul 23, 2012 at 23:22 comment added user603 @Damien: i'm not even sure what the question means. The important property of the recursive median in this context is that it bulges very little --minimally among all estimator of central tendency, in fact--, when up to width/2-1 of the last width observations have been replaced by arbitrarily data.
Jul 23, 2012 at 23:14 comment added Damien @user603: Would you say median filters are good to detect any violations of apparent trends in a dataset?
Jul 23, 2012 at 22:32 comment added user603 yes. But again, you are encouraged to go read the references quoted in the manual
Jul 23, 2012 at 22:22 comment added Damien @user603: The model uses 1-12 to get 13, 2-13 to get 14, etc...?
Jul 23, 2012 at 22:05 comment added user603 @Damien: as with all models that allow level shifts, there is no simple linear expression for $y_{t+k}|y_t$: you have to recursively fit the forecast in the model to get a new forecast. After 12 periods the forecast will be a constant.because the model only uses the last 12 observations to build a forecast. This is the "width" parameter. But again, this is pretty simple to do in R from the code i posted (it's just a loop).
Jul 23, 2012 at 22:01 comment added Damien @user603: How would we get the next predicted observation after the last observed one? What about the next one after that....etc...? 14.5 is just the predicted value at t=48. But we already have observed this value. What about the predicted value at t=49?
Jul 23, 2012 at 21:59 comment added user603 @Damien: no: extrapolate=TRUE only concerns the data for which we don't have a model. Since online is TRUE, the extrapolation only affects the first 11 observations for which we don't have a model --and which would otherwise be coded as NA--.
Jul 23, 2012 at 21:57 vote accept Damien
Jul 23, 2012 at 21:55 comment added Damien @user602: It seems that all the value in mod4a$level[,1] are the square root of the forecasted values up to the last data point we have. But if we wanted to extrapolate, we could just change extrapolate = TRUE to get the next prediction?
Jul 23, 2012 at 21:51 comment added user603 it had 48, and the next period forecast would be 14.5 :). But you can do the whole analysis for yourself: R is open source, free and so is the robfilter library and furthermore the methodology is fully explained in the peer reviewed papers referenced in the package's documentations. In a word, it's not a black box and your are encouraged to play with it.
Jul 23, 2012 at 21:49 history edited user603 CC BY-SA 3.0
added 125 characters in body; added 42 characters in body
Jul 23, 2012 at 21:47 comment added Damien @user603: This has 47 and I just used your example for it. Thanks: 2 1 4 5 4 8 7 11 4 4 11 7 10 7 0 19 13 13 11 9 8 16 10 12 9 7 21 9 10 6 7 19 18 9 19 15 14 17 9 10 10 13 15 20 15 12 15 16
Jul 23, 2012 at 21:47 comment added Damien @user603: Sorry I realized that you were working off of the old data which had more data.
Jul 23, 2012 at 21:44 comment added Damien @user603: Also I don't see how i have >100 data points. I only had 37 data points
Jul 23, 2012 at 21:43 history edited user603 CC BY-SA 3.0
added 113 characters in body; deleted 1 characters in body
Jul 23, 2012 at 21:37 comment added user603 @Damien: it's the last entry of mod4a$level[,1] raised to the power 2 -- since this is based on a model for the square root of your data--.
Jul 23, 2012 at 21:34 comment added Damien @user603: Where is the final forecast for the next period?
Jul 23, 2012 at 21:16 comment added IrishStat @Damien The AUTOBOX forecast is 10.8572 ( the robust/outlier adjusted mean of the last 44 values )
Jul 23, 2012 at 21:00 comment added user603 @Damien: yes, as long as you use "online=TRUE" this approach can be used for forecasting (we only use the past). The final forcast for the next period is 11...not very different from IrishStats's forcast.
Jul 23, 2012 at 20:55 history edited user603 CC BY-SA 3.0
added 707 characters in body; deleted 551 characters in body
Jul 23, 2012 at 20:41 comment added whuber Good point about the potential online nature (+1). Another mild improvement can be achieved by analyzing the square roots of the data (because these evidently are counts). Alternatively--for sophisticated analysts--a Poisson GLM with splines or changepoints would do a fine job.
Jul 23, 2012 at 20:41 comment added Damien @user602: I want to predict data
Jul 23, 2012 at 20:38 comment added user603 @whuber: --this is a one sided filter: as far as i understood the option "online" makes sure it doesn't use data from $t+i$, $i>0$ at time $t$. More generally, I agree with you: I also tough of asking the OP what was the end purpose (is he, for example, interested in the value of an ar coefficient for a given lag)?
Jul 23, 2012 at 20:33 comment added whuber This is the right idea, because (a) there is a trend but it's not easily characterized and (b) there are no significant serial correlations at any lag. However, loess will do a much better job than a median filter at characterizing these data. All this begs the question of why the OP is fitting the data: median filters or loess will do little for predicting future values, for instance.
Jul 23, 2012 at 19:11 history answered user603 CC BY-SA 3.0