View source: R/forecast_tools.R
res_hist | R Documentation |
Histogram plot of the residuals values
res_hist(forecast.obj)
forecast.obj |
A fitted or forecasted object (of the forecast package) with residuals output |
## Not run:
library(forecast)
data(USgas)
# Set the horizon of the forecast
h <- 12
# split to training/testing partition
split_ts <- ts_split(USgas, sample.out = h)
train <- split_ts$train
test <- split_ts$test
# Create forecast object
fc <- forecast(auto.arima(train, lambda = BoxCox.lambda(train)), h = h)
# Plot the fitted and forecasted vs the actual values
res_hist(forecast.obj = fc)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.