So in this video, I'd like to show you an example of the Holt-Winters forecasting method in the R Environment. So I have my RStudio environment opened up and here's the program that we're going to use. There are four libraries that we need to run this code: the forecast library, the FMA, which has the data sets, and ggplot2, and the data set libraries. So just run this code, these libraries to load them into your environment. Did I load that last one? There it is. Now, let's take a look at simple exponential smoothing. We're going to use this air passenger data, the same data that I used in the slides, and we can take a look at it, it goes from 1949 to December of 1960, and these numbers are in thousands. It's always good to plot the data, and here I'm using the command autoplot, and here we can see it over here on the right-hand side of the screen. We saw this in the slides, and you can see that there does seem to be some upward trend, and we can also see some sort of seasonal cycle. Note here also that the seasonal cycles also seem to be growing over time. Let's do a simple exponential smoothing. So the command is SCS here. The data is air pass, the data that we used before, and h is the number of lags. I'm going to store it in this variable ses5 that I've named. We can look at that data. There it is. Here's the forecast, it's 43198, and here are the confidence intervals. One command that's useful is accuracy, and here are some various measures of error, and the one I think we should focus on at least for this class and in general, is this RMSE, which has a value of 33.59. Let's plot our simple exponential smoothing values. You can see the curve there, the fitted values are in red, and then you can also see the dark blue is the 80 percent confidence interval, and the light adds to the light blue is the 95 percent confidence interval. There's our predicted value, that little line there. You can see it there, the 431.99 right there. So that's what it's predicting based on the value, and that's just a simple exponential smoothing. You could try different values. Instead of five lags, we could, try let's say, 25 lags, so ses25. I'm typing in the bottom here. S-E-S-A-I-R-P-A-S-S-H equals 25, and then we can auto plot that A-U-T-O-P, autoplot ses25, and you will see a much smoother curve and there you see the 80 percent confidence interval, the 95 percent confidence interval. I encourage you to play with different lags to see the different shapes of the data because it does, this is as much an art as it is a science, and just by playing with the data, you'll get a feel for the number of appropriate lags. So here's the Holt's linear trend model. This just adds the linear trend, and the command is quite simple, Holt, same thing, airpass, h equals five, and I put it in this variable, holt5. We can run that, and here you go. Here you can see the predicted values, that little blue line there along with the 80 percent confidence interval, and the 95 percent confidence interval, and the red line here, the fitted values. That looks pretty okay, I think. One thing to note, there is some evidence to suggest that the Holt's linear trend forecasting estimate is overvalued for predicted values. So some people, Gardner-McKenzie have found that dampening that trend helps increase accuracy. So I've added a parameter here, damped equals true, with this 0.9 value, and if I run that, let's run that. I'm going to plot them all on one graph. That's what this does, and you can see here in the predicted values, the Holt method, there's that light blue line, and it's increasing, whereas the damp value is in red and it's just going horizontally across. So that's something you can try at home. I'd like to now add in the seasonality to the model. So I have Holt-Winters 1 and Holt-Winters 2, and it uses this function HW. Again, the data is air passengers or airpass, and then seasonal, there are two options here, one is additive, and one is multiplicative. I'm going to use them both, and then here's the autoplot of the air passenger data, and then I'm going to add these two layers. One is the additive forecast and one is the multiplicative forecast. If I run this code, you should see here, out here in the blue, the red line is the additive model, whereas the blue line is the multiplicative model, and just by eyeballing it seems like the multiplicative forecast is a much better fit to the previous historical data than the red line, which is the additive model. The seasonality cycle seem to be increasing at a nice rate so that these lines look pretty consistent, and that's how you run the Holt-Winters model in R.