LoslegenKostenlos loslegen

Visualizing Forecast

Your forecast seemed to be off by over 18% on average. Let's visually compare your forecast with the validation data set to see if we can see why. Your workspace has your forecast object forecast_MET_t and validation data set MET_t_valid loaded for you. Don't forget your validation is 22 weeks long!

Diese Übung ist Teil des Kurses

Forecasting Product Demand in R

Kurs anzeigen

Anleitung zur Übung

  • Convert the mean of your forecast (forecast$mean) into an xts object using the for_dates object for the time index remembering that your validation data set is 22 weeks long.
  • Plot your validation data set.
  • Overlay your forecast (for_MET_t_xts) on top of the validation.
  • Don't change the plotting options in either to make it easier to see.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Convert your forecast to an xts object
for_dates <- seq(as.Date("2017-01-01"), length = ___, by = "weeks")
for_MET_t_xts <- xts(forecast_MET_t$___, order.by = ___)

# Plot the validation data set
plot(MET_t_valid, main = 'Forecast Comparison', ylim = c(4000, 8500))

# Overlay the forecast of 2017
lines(___, col = "blue")
Code bearbeiten und ausführen