Data Analytics & R Siddharth
Data Analytics & R Siddharth
Data Analytics & R Siddharth
SIDDHARTH KUMAR
BFT SEM 6
EXPONENTIAL SMOOTHING & TIME
SERIES
• Exponential smoothing is a time series forecasting method for univariate data that
can be extended to support data with a systematic trend or seasonal component.
• Exponential smoothing forecasting methods are similar in that a prediction is a
weighted sum of past observations, but the model explicitly uses an exponentially
decreasing weight for past observations.
• Collectively, the methods are sometimes referred to as ETS models, referring to
the explicit modeling of Error, Trend and Seasonality.
• There are three main types of exponential smoothing time series forecasting
methods.
• A simple method that assumes no systematic structure, an extension that explicitly
handles trends, and the most advanced approach that add support for seasonality.
Obejctive:
• To learn about machine learning algorithms and to understand the
use of various functions of R studio ( plotting, exponential
smoothning, etc.) and perform time- series analysis on a real time
data.
PROBLEM FOR FORECAST
• The objective here is to forecast the trend forecast of streetwear
fashion trend.
• From January 2015 I have took google trend web search data of
streetwear topic in India.
• I am trying analyze the trend forecast of streetwear fashion trend in
India that will happen in 2021 based on the last 5 years of google
trend data and hence predict the trend forecast of streetwear fashion
trend in India.
• If the popularity of streetwear trend is growing manufacturers and
brand in India should ramp up the production and vice versa.
Streetwear is a style of casual
clothing which became global in the
1990s.It grew from New York hip
hop fashion and eventually California
surfskate culture, to encompass
elements of sportswear, punk and
Streetwear Japanese street fashion. Eventually
haute couture became an influence. It
commonly centers on "casual,
comfortable pieces such as jeans, T-
shirts, baseball caps, and sneakers",
and exclusivity through intentional
product scarcity. Enthusiasts follow
particular brands and try to obtain
limited edition releases.
Data: Google
trend
x <-
ggseasonplot(x,polar = TRUE)+
ts(data,start=2015,frequency =
ylab(“streetwear trend")+
4)
ggtitle(" streetwear trend ")
x
Rscript
ggsubseriesplot(x)+
#simple exponential smoothing
ylab("streetwear trend")+
fc <- ses(x, h=5)
ggtitle("streetwear trend") # Accuracy of one-step-ahead
training errors
#decompose round(accuracy(fc),2)
x %>%
decompose(type="multiplica autoplot(fc) +
tive") %>% autolayer(fitted(fc),
series="Fitted") +
autoplot() + xlab("Year") +
ylab("streetwear trend forecast
ggtitle("Classical from SEC") + xlab("Year")
multiplicative decomposition
of streetwear trend summary(fc)
index")
Rscript
#holt exponential smotthing #holt winters exponential smoothing
fc <- holt(x, h=15)
fc <- holt(x, h=15)
fc2 <- holt(x, damped=TRUE, phi = 0.9, h=15)
fc2 <- holt(x, damped=TRUE, phi = 0.9, h=15)
autoplot(x) +
autoplot(x) +
autolayer(fc, series="Holt's method", PI=FALSE) autolayer(fc, series="Holt's method",
+ PI=FALSE) +
autolayer(fc2, series="Damped Holt's method", autolayer(fc2, series="Damped Holt's
PI=FALSE) + method", PI=FALSE) +
ggtitle("Streetwear trendForecasts from Holt's ggtitle("Streetwear trend Forecasts from
method") + xlab("Year") + Holt's method") + xlab("Year") +
ylab("streetwear trend forecast") + ylab("streetwear trend forecat") +
guides(colour=guide_legend(title="Forecast"))
guides(colour=guide_legend(title="Forecast
summary(fc2) "))
summary(fc2) summary(fc2)
DECOMPOSITI
ON
•Model Information:
•Simple exponential smoothing
•Call:
• ses(y = x, h = 5)
Forecasts:
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
• Smoothing parameters:
2021 Q1 564.6001 475.5544 653.6459 428.4164 700.7839
• alpha = 0.9115
2021 Q2 564.6001 444.1110 685.0892 380.3280 748.8723
2021 Q3 564.6001 419.3207 709.8795 342.4145 786.7858
• Initial states: 2021 Q4 564.6001 398.1832 731.0170 310.0875 819.1128
• l = 256.2075 2022 Q1 564.6001 379.4433 749.7570 281.4272 847.7731
• sigma: 69.4828
•Error measures:
• ME RMSE MAE MPE MAPE MASE ACF1
•Training set 14.09657 66.52469 49.67723 0.5124441 17.38104 0.4702057
-0.04066899
HOLT
EXPONENTIAL
SMOOTHENIN
G
• Holt (1957) extended
simple exponential
smoothing to allow the
forecasting of data with a
trend. This method
involves a forecast
equation and two
smoothing equations (one
for the level and one for
the trend)
• Forecast method: Damped Holt's method
Forecasts:
• Model Information: Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
• Damped Holt's method
2021 Q1 664.0542 571.1580 756.9505 521.9816 806.1268
• Call: 2021 Q2 683.4771 583.8611 783.0932 531.1276 835.8267
• holt(y = x, h = 15, damped = TRUE, phi = 0.9) 2021 Q3 700.9578 588.9082 813.0073 529.5928 872.3227
• Smoothing parameters: 2021 Q4 716.6903 587.1018 846.2788 518.5018 914.8788
• alpha = 0.2038 2022 Q1 730.8496 579.8443 881.8550 499.9069 961.7924
• beta = 0.2038
• phi = 0.9
2022 Q2 743.5930 568.4643 918.7217 475.7568 1011.4292
2022 Q3 755.0621 554.0064 956.1177 447.5740 1062.5501
• Initial states:
2022 Q4 765.3842 537.2461 993.5223 416.4770 1114.2914
• l = 282.5693
• b = -17.3599 2023 Q1 774.6741 518.7559 1030.5924 383.2810 1166.0673
2023 Q2 783.0350 498.9647 1067.1054 348.5869 1217.4832
• sigma: 72.4873
2023 Q3 790.5599 478.1995 1102.9202 312.8459 1268.2738
• AIC AICc BIC 2023 Q4 797.3322 456.7143 1137.9502 276.4020 1318.2625
• 286.2703 289.6036 292.1606
2024 Q1 803.4274 434.7090 1172.1458 239.5212 1367.3335
• Error measures: 2024 Q2 808.9130 412.3430 1205.4829 202.4115 1415.4144
• ME RMSE MAE MPE MAPE MASE ACF1 2024 Q3 813.8500 389.7445 1237.9555 165.2366 1462.4634
• Training set 14.96643 64.49608 48.58953 2.035668 16.14248 0.4599104 0.1667779
HOLT-
WINTER
SEASONAL
• Holt (1957) and Winters (1960)
extended Holt’s method to
capture seasonality. The Holt-
Winters seasonal method
comprises the forecast
equation and three smoothing
equations — one for the level ,
one for the trend , and one for
the seasonal component, with
corresponding smoothing
parameters α, β and γ.
• Forecast method: Holt-Winters' multiplicative method
• Model Information:
• Holt-Winters' multiplicative method
• Call:
• hw(y = x, seasonal = "multiplicative")
Forecasts:
• Smoothing parameters:
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
• alpha = 0.8631
• beta = 0.045
2021 Q1 580.7968 312.55059 849.0430 170.54964 991.0439
• gamma = 2e-04 2021 Q2 602.9631 220.40656 985.5197 17.89334 1188.0330
2021 Q3 653.5037 138.62115 1168.3863 -133.94122 1440.9486
• Initial states:
2021 Q4 620.7926 41.10678 1200.4784 -265.76036 1507.3456
• l = 287.9973
• b = 5.9486 2022 Q1 638.6446 -49.43471 1326.7239 -413.68190 1690.9711
• s = 0.9752 1.0508 0.9933 0.9807 2022 Q2 661.5603 -146.63532 1469.7559 -574.46824 1897.5889
2022 Q3 715.5068 -263.71260 1694.7261 -782.08001 2213.0935
• sigma: 0.3604
2022 Q4 678.3280 -352.51243 1709.1684 -898.20638 2254.8624
• AIC AICc BIC
• 305.9045 318.7617 316.5070
• Error measures:
• ME RMSE MAE MPE MAPE MASE ACF1
• Training set 8.450453 65.58936 49.70851 -1.057906 17.52936
0.4705017 0.002171913
Conclusion:
Since moving average method is not sufficient to forecast the data to predict trend forecast for streetwear fashion in 2021 in inida I
have used to exponential smoothing methodologies for univariate time series.
SIMPLE EXPONENTIAL SMOOTHING
MAE : 49.67723
HOLT EXPONENTIAL SMOOTHING
MAE : 48.58953
HOLT - WINTER EXPONENTIAL SMOOTHING
MAE : 49.70851
As the moving average error was least in Holt’s exponential smoothing method we will be considering the forecast data predicted by
this method. That is in the first quarter of 2021 the Web searches will be 664.0542 searches , in the second quarter 683.4771
Searches , in the third quarter 700.9578 searches and in the last quarter 716.6903 searches. The total search for streetwear fashion
for this year will be 2765.1794 searches . Hence, the Streetwear fashion will increase the year 2021 as compared to the previous
year production of 2347 searches.
The change in the web search for year 2021 is +17.81% hence the popularity of streetwear is increasing in India The manufactures
and the brands in India should ramp up the production of streetwear products.
-Thanks-