3
$\begingroup$

I am presently trying to learn R. I would like to be able to apply it more in my work environment as I am an analyst in the Health Care industry. I am presently trying to use R to forecast. What is the best forecasting package in R?

I am presently using the forecast package. I have tried to fit the ets models to my data but I feel that it is giving me some fairly unreasonable solutions. The data is flat, meaning that it does not linearly increase and there are some fluctuations, but I have not been able to assess whether or not those fluctuations are seasonal. I am assuming they are not.

How can I calculate the out of sample error when I am comparing forecasting models? Also, is there a way to plot my forecasted data against the actual values? Lastly, how can I determine the model that is generated from the forecast?

Thanks for all of your help in advance.

$\endgroup$
  • $\begingroup$ Post your data and any causal variables that drive your business and specify the frequency of the data. Provide any causal variables that explain any outliers, trends or level shifts. $\endgroup$ – Tom Reilly Mar 28 '12 at 16:21
  • $\begingroup$ I believe Tom Reilly is suggesting to provide a more precise description of your data, or a snapshot thereof, in order to get more insights of its peculiarities. $\endgroup$ – chl Mar 28 '12 at 21:03
4
$\begingroup$

I believe 'forecast' is a very good choice, but it surely depends on the tasks you want to complete with the package. The main author Rob Hyndman is co-authoring an open book on forecasting you might have a look at in order to find out more about applying forecast: http://otexts.com/fpp/ There's a link to some talk on forecasting with R on his blog as well: http://robjhyndman.com/talks/melbournerug/ And although you might have stumbled upon it, the Hyndman/Khandakar paper provides quite some insight on the forecast package along with example code: http://robjhyndman.com/papers/automatic-forecasting/ Else, you might want to check the documentation, it has short examples for most commands in addition to explanations.

@"The data is flat meaning, it does not linearly increase and there are some fluctuations, but I have not been able to assess whether or not those fluctuations are seasonal.": Maybe try some seasonal decomposition tool like "stl" and see http://otexts.com/fpp/6/

$\endgroup$
1
$\begingroup$

There is no best forecasting package in R. For one thing, R is open source so there are often multiple packages that do similar things and you can choose which one seems to be the most up-to-date and works to your taste.

More importantly, though, is: how you forecast depends on how you model. Do you have a univariate time series and nothing but that data? Or do you have a univariate time series with several predictor variables? Do you have a multivariate time series? Are you even using a time series at all? ("Forecasting" implies time series, but that's not necessarily the case.)

So the first question would probably be: what data do you have, and what kind of model are you trying to make? Modeling options and forecasting options will then be easier.

$\endgroup$
  • $\begingroup$ 1 point for pointing out that what kind of model you try to make is important in doing your aim. $\endgroup$ – hbaghishani Mar 25 '12 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.