Module #12 Assignment
Module #12 Assignment
The table below represents charges for a student credit card.
Month | 2012 | 2013 |
Jan | 31.9 | 39.4 |
Feb | 27 | 36.2 |
March | 31.3 | 40.5 |
Apr | 31 | 44.6 |
May | 39.4 | 46.8 |
Jun | 40.7 | 44.7 |
Jul | 42.3 | 52.2 |
Aug | 49.5 | 54 |
Sep | 45 | 48.8 |
Oct | 50 | 55.8 |
Nov | 50.9 | 58.7 |
Dec | 58.5 | 63.4 |
a. Construct a time series plot using R.
b. Employ Exponential Smoothing Model as outlined in Avril Voghlan's notes and report the statistical outcome
c. Provide a discussion on time series and Exponential Smoothing Model results that you obtained.Post the result on your blog posting and provide details explanation to your findings.
Disclaimer: I made two sets of plots with the same purpose. I wanted to create a plot that shows change from 2012 all the way to 2013 as one graph. The next graph shows a comparison between the 2012 and 2013 graph. These plots shows the same thing but I believe having both plots allow for better comprehension.
Code for first plot:
First Plot:
Code for table for student credit card (2nd Plot):
Code for time series plot (2nd Plot):
Time Series 2nd Plot:
After observing the two plots, I wanted to highlight the change of the student's spending habits. The first plot shows a continuous trend from 2012 to 2013. The second plot shows the comparison and contrast of the student's spending habits from 2012 to 2013. To clarify, the code of the first plot will be examined throughout this assignment.
The plot shows a similar pattern to the student's spending habits. If it is the beginning of the year, the student spends less. During February there is a drop off in spending and then a continuous increase in charges. By September, another decrease occurs followed by upward trajectory until the end of the year for both years.
After observing and creating the plot, I utilized the exponential smoothing model.
Code for exponential smoothing model:
Breakdown:
Holt-Winters Exponential Smoothing is a forecasting method used for time series data that accounts for three key components which are level, trend, and seasonality.
Level: This is the baseline value of the series at a given time
Trend: This is the direction in which the series is moving over time. It can either be an upward or downward trajectory.
Seasonality: This is the repeating patterns or cycles over fixed periods of times.
The output of the HoltWinters() tells us that the estimated value of the alpha parameter is about 0.8232442. This tell us the weight of the most recent observed value which is 62.44453. Since the alpha parameter is larger, this indicated the student spending patterns are more volatile and frequently changing. The recent charges have a greater impact on the data. The value of 62.44453 provides an estimate of the typical or average student credit card charge at the most recent point in the data. This acts as the baseline prediction for future charges, assuming no significant trends or seasonal patterns are present.
Projected Values:
This screenshot shows the Holt Winters plot providing values up to January 2015. Below is a plot of the holts-winters function highlighting the trend of the student's purchasing behavior. As stated earlier, at the beginning of the year, there is less spending but towards the end, there is an all time high of spending.
The sum of squares was also calculated.
With the sum of squares value being 2428.927, this is the difference between the observed values and the predicted values. If the SEE is lower, the forecast is likely to be more accurate. The reason as to why the SEE is so high is because the model only counts for level and not trend or seasonality due to beta = FALSE and gamma = FALSE. If all there of these were accounted for, the SEE would be lower.
Using the Holts-Wintering function to plot, we are able to plot the observed data alongside the fitted values. The red line shows how well the model has smoothed the observed data. For this plot, the red line is not smooth so this reinforces the idea that without sufficient trend or seasonality, the model does not capture the patterns effectively. If this assignment was reattempted, incorporating trend, level, and seasonality would lead to a smoother red line.
Summary of what I learned:
This week's assignment allowed me to work with Holt-Winters exponential smoothing method, which is widely used for time series forecasting. This method is useful when the data contains a level, trend, and seasonality. I hope to use this function to better understand other areas that require forecasting by also integrating the proper capture of level, trend, and seasonality. Using functions like SSE, we can see how the model works and if areas of improvement are necessary.
Comments
Post a Comment