神刀安全网

Updates to the 'forecast' package for R

The forecast package for R, created and maintained by Professor Rob Hyndman of Monash University, is one of the more useful R packages available available on CRAN . Statistical forecasting — the process of predicting the future value of a time series — is used in just about every realm of data analysis, whether it’s trying to predict a future stock price or trying to anticipate changes in the weather. If you’re looking to learn about forecasting, a great place to start is the online book Forecasting: Principles and Practice (by Hyndman and George Athana­sopou­los) which walks you through the theory and practice, with many examples in R based on the forecast package. Topics covered include  multiple regression , Time series decomposition , exponential smoothing , and  ARIMA models .

The forecast package itself recently received a major update, to version 7. One major new capability is the ability to easily chart forecasts using the ggplot2 package with the new autoplot function. For example:

fc <- forecast(fdeaths) autoplot(fc)
Updates to the &#x27;forecast&#x27; package for R

You can also add forecasts to any ggplot using the new geom_forecasts geom provided by the forecast package:

autoplot(mdeaths) + geom_forecast(h=36, level=c(50,80,95))

Updates to the &#x27;forecast&#x27; package for R

There have been several updates to the forecasting functions as well. The function for fitting linear models to time series data, tslm , has been rewritten to be more compatible with the standard lm function. It’s now possible to forecast means (as well as medians) when using Box-Cox transformations. And you can now apply neural networks to time series data by building a nonlinear autoregressive model with the new nnetar function.

Those are just some of the highlights of the updates to the forecast package in version 7. For complete details, follow the links to Rob Hyndman’s blog, below.

Hyndsight: forecast v7 and ggplot2 graphics ; Forecast v7 (part 2) ( via traims)

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Updates to the 'forecast' package for R

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址