Economic indicators, especially in the labor market, are often looked to to make more informed decisions under periods of uncertainty. The unemployment rate is often the first metric individuals, businesses, and government agencies look towards to understand the health of the economy. However, the enemployment rate is just a macro-level indicator; there is a lot more behind the scenes. In particular, job seperations and the job seperations rate are indicative of the unemployment rate as “if the job finding rate remains constant, an increase in the job separation rate will increase the unemployment rate” (Wiczer, 2014). The job seperations rate also illuminates the current “sentiment” of the economy as the metric encompasses two components: voluntary (quits) and involuntary seperations (layoffs and fires).
The following report looks at the labor market seperations rate and builds upon the last report in that we now build eight models for forecasting. The data comes from the Job Openings and Labor Turnover Survey (JOLTS) taken by the Bureau of Labor Statistics.
In the following analysis we will first import the data and then split the data into training and testing in which the last ten observations are held out for testing. Finally, eight models will be built and the accurracy will be tested using various measures. The eight models are as follows:
jolts <- read.csv("C:/Users/Angelo/OneDrive/Desktop/College Babyyyyyyy/Fourth Year/STA321/data/JTSOSL.csv")
jolts <- jolts[118:267,]
sep=jolts$JTSOSL
fit1 = ses(sep, alpha=0.65, initial="optimal", h=3)
fit2 = ses(sep, alpha=0.95, initial="simple", h=3)
fit3 = ses(sep, h=3) ## alpha is unspecified, it will be estimated
plot(fit1, ylab="Seperation Rate",
xlab="Time", main="", fcol="white", type="o", lwd=2, cex=0.5)
title("Comparing SES Models: Different Smoothing Coefficients")
lines(fitted(fit3), col="blue", type="o", cex=0.5)
lines(fitted(fit2), col="red", type="o", cex=0.65)
lines(fitted(fit1), col="darkgreen", type="o", cex=0.5)
points(fit3$mean, col="blue", pch=16) ## plot forecast values
points(fit2$mean, col="red", pch=18)
points(fit1$mean, col="darkgreen", pch=21)
legend("bottomleft",lty=1, col=c(1,"blue","darkgreen","red"),
c("data", expression(alpha == 0.3), expression(alpha == 0.65),
expression(alpha == 0.95)),pch=1)
In the above graph, we used the simple exponential smoothing methods using three different values for the parameter \(\alpha\): an estimated \(\alpha\) approx. equal to 0.3, \(\alpha\) equal to 0.65, and \(\alpha\) equal to 0.95. Based upon visual analysis alone, it seems the estimated value of \(\alpha\) and \(\alpha\)=.95 are the closest estimates on the actual data.
In the following section, we will first split the data into training and testing data in which the last ten observations (months) will be held out for testing. We will then fit the training data to eight different models and then assess their accurracy using seven different accurracy measures.
test.jolts = jolts[139:150,2]
train.jolts = jolts[1:138,2]
jolts.ts = ts(jolts[1:138,2], start=c(2010,9), frequency = 12)
fit1 = ses(jolts.ts, h=12)
fit2 = holt(jolts.ts, initial="optimal", h=12) ## optimal alpha and beta
fit3 = holt(jolts.ts,damped=TRUE, h=12 ) ## additive damping
fit4 = holt(jolts.ts,exponential=TRUE, damped=TRUE, h =12) ## multiplicative damp
fit5 = hw(jolts.ts,h=12, seasonal="additive")
fit6 = hw(jolts.ts,h=12, seasonal="multiplicative")
fit7 = hw(jolts.ts,h=12, seasonal="additive",damped=TRUE)
fit8 = hw(jolts.ts,h=12, seasonal="multiplicative",damped=TRUE)
accuracy.table = round(rbind(accuracy(fit1), accuracy(fit2), accuracy(fit3), accuracy(fit4),
accuracy(fit5), accuracy(fit6), accuracy(fit7), accuracy(fit8)),4)
row.names(accuracy.table)=c("SES","Holt Linear","Holt Add. Damped", "Holt Exp. Damped",
"HW Add.","HW Exp.","HW Add. Damp", "HW Exp. Damp")
pander(accuracy.table, caption = "The accuracy measures of various exponential smoothing models
based on the training data")
| ME | RMSE | MAE | MPE | MAPE | MASE | ACF1 | |
|---|---|---|---|---|---|---|---|
| SES | 1.532 | 23.11 | 18.07 | 0.0659 | 5.184 | 0.6415 | -0.0398 |
| Holt Linear | -0.0457 | 23.06 | 18.13 | -0.3925 | 5.225 | 0.644 | -0.0313 |
| Holt Add. Damped | 0.5969 | 23.05 | 18.1 | -0.2118 | 5.208 | 0.643 | -0.0274 |
| Holt Exp. Damped | 0.2228 | 23.04 | 18.15 | -0.324 | 5.227 | 0.6447 | -0.0266 |
| HW Add. | -0.1685 | 22.76 | 17.94 | -0.4199 | 5.172 | 0.637 | -0.0343 |
| HW Exp. | 0.3289 | 23.65 | 18.97 | -0.2645 | 5.458 | 0.6735 | 0.1222 |
| HW Add. Damp | 0.0717 | 22.65 | 17.87 | -0.356 | 5.149 | 0.6347 | -0.0265 |
| HW Exp. Damp | -0.4355 | 22.65 | 17.86 | -0.5013 | 5.154 | 0.6342 | -0.0182 |
After splitting the data, in which the last ten observations were held out for testing, eight models were built and their accurracy tested. Based on the various accurracy measures, the Holt-Winters exponential damped model is concluded to be the best for forecasting as it has the lowest ME, RMSE, MAE, MPE, and MASE.
We will now develop a graphical representation of the eight models above. They will be split into two graphs according to their smoothing methods: non-seasonal and Holt-Winters trend.
par(mfrow=c(2,1), mar=c(3,4,3,1))
###### plot the original data
pred.id = 139:150
plot(1:138, train.jolts, lwd=2,type="o", ylab="Seperations", xlab="", cex=0.3,
main="Non-seasonal Smoothing Models", ylim = c(300,600))
lines(pred.id, fit1$mean, col="red")
lines(pred.id, fit2$mean, col="blue")
lines(pred.id, fit3$mean, col="purple")
lines(pred.id, fit4$mean, col="navy")
##
points(pred.id, fit1$mean, pch=16, col="red", cex = 0.5)
points(pred.id, fit2$mean, pch=17, col="blue", cex = 0.5)
points(pred.id, fit3$mean, pch=19, col="purple", cex = 0.5)
points(pred.id, fit4$mean, pch=21, col="navy", cex = 0.5)
#points(fit0, col="black", pch=1)
legend("topleft", lty=1, col=c("red","blue","purple", "navy"),pch=c(16,17,19,21),
c("SES","Holt Linear","Holt Linear Damped", "Holt Multiplicative Damped"),
cex = .7, bty="n")
###########
plot(1:138, train.jolts, lwd=2,type="o", ylab="Seperations", xlab="", cex=0.3,
main="Holt-Winters Trend and Seasonal Smoothing Models", ylim=c(300,600))
lines(pred.id, fit5$mean, col="red")
lines(pred.id, fit6$mean, col="blue")
lines(pred.id, fit7$mean, col="purple")
lines(pred.id, fit8$mean, col="navy")
##
points(pred.id, fit5$mean, pch=16, col="red", cex = 0.5)
points(pred.id, fit6$mean, pch=17, col="blue", cex = 0.5)
points(pred.id, fit7$mean, pch=19, col="purple", cex = 0.5)
points(pred.id, fit8$mean, pch=21, col="navy", cex = 0.5)
###
legend("topleft", lty=1, col=c("red","blue","purple", "navy"),pch=c(16,17,19,21),
c("HW Additive","HW Multiplicative","HW Additive Damped", "HW Multiplicative Damped"),
cex = 0.7, bty="n")
As seen above, the non-seasonal models have very little variation between their forecasts. However, the Holt-Winters trend and seasonal models have slightly more differentiation between their forecasts. The Holt-Winters models also have better accurracy rates.
The following table compares the accuracy measures of various exponential smoothing models based on the testing data. As we will see, the conclusion drawn above is not validated by the table below.
acc.fun = function(test.data, mod.obj){
PE=100*(test.data-mod.obj$mean)/mod.obj$mean
MAPE = mean(abs(PE))
###
E=test.data-mod.obj$mean
MSE=mean(E^2)
###
accuracy.metric=c(MSE=MSE, MAPE=MAPE)
accuracy.metric
}
pred.accuracy = rbind(SES =acc.fun(test.data=test.jolts, mod.obj=fit1),
Holt.Add =acc.fun(test.data=test.jolts, mod.obj=fit2),
Holt.Add.Damp =acc.fun(test.data=test.jolts, mod.obj=fit3),
Holt.Exp =acc.fun(test.data=test.jolts, mod.obj=fit4),
HW.Add =acc.fun(test.data=test.jolts, mod.obj=fit5),
HW.Exp =acc.fun(test.data=test.jolts, mod.obj=fit6),
HW.Add.Damp =acc.fun(test.data=test.jolts, mod.obj=fit7),
HW.Exp.Damp =acc.fun(test.data=test.jolts, mod.obj=fit8))
pander(pred.accuracy, caption="The accuracy measures of various exponential smoothing models
based on the testing data")
| MSE | MAPE | |
|---|---|---|
| SES | 2761 | 12.08 |
| Holt.Add | 3149 | 12.77 |
| Holt.Add.Damp | 2784 | 12.12 |
| Holt.Exp | 2769 | 12.09 |
| HW.Add | 3242 | 12.92 |
| HW.Exp | 4659 | 14.96 |
| HW.Add.Damp | 2887 | 12.26 |
| HW.Exp.Damp | 2923 | 12.28 |
Based on the above table, the best model for forecasting is the simple exponential smoothing model. This conclusion contradicts the previous finding in which the Holt-Winters exponential damped model was concluded to be the best fit for the data. Thus, we will examine the parameters of the simple exponential smoothing model.
final.model = ses(jolts.ts, h=12)
smoothing.parameter = final.model$model$par
kable(smoothing.parameter, caption="Estimated values of the smoothing parameters in
Holt-Winters linear trend with additive seasonality")
| x | |
|---|---|
| alpha | 0.2583216 |
| l | 316.3620546 |
Above is a table with the parameters of the simple exponential smoothing model. The alpha (\(\alpha\)) value is the percentage of how much importance the model will allocate to the most recent observation compared to the importance of demand history (Vandeput, 2019). In this case, the model allocates approximately 30 percent of the importance to the most recent observation (say \(n-1\)) to forecast the next observation (say \(n\)).
In the above report we developed a preliminary understanding of the
job seperation rate using SES with three different parameter values in a
visual representation. Next, we split the data into training and testing
data, holding out the last ten observations for testing. We then fit the
data to eight different models: a simple exponential smoothing model, a
Holt linear model, a Holt addidative damped model, a Holt exponential
damped, a Holt-Winters additive model, a Holt-Winters exponential model,
a Holt-Winters damped additive model, and a Holt-Winters damped
exponential model. After fitting the data, we assessed the accurracy of
the models using seven different accurracy measures. From these
measures, we concluded that the Holt-Winters damped exponential model
was the most accurrate. We then graphed the forecasts of these models in
two visuals in which we segmented the graphs into non-seasonal and
seasonal models. After this, we moved to the test data in which we
assessed the accurracy of each model according to how well it fit the
actual held out observations. Using two accurracy measures, we concluded
that the simple exponential smoothing model was the most accurrate,
contradicting our original conclusion. From this, we assessed the
parameters of the SES model and discussed what the parameter value meant
in context.