Mod. 12
1 min readNov 8, 2023
After observing the graph generated from RStudio it is clear that the trend is going up. As well as a drop at the beginning of the second year but the trend is still climbing upwards.
Charge<-c(31.9,27,31.3,31,39.4,40.7,42.3,49.5,45,50,50.9,58.5,39.4,36.2,40.5,44.6,46.8,44.7,52.2,54,48.8 ,55.8,58.7,63.4)
Chargetimeseries <-ts(Charge)
Chargetimeseries <-ts(Charge,frequency=12,start=c(2012,1))
Chargetimeseries
Chargeforecast<-HoltWinters(Chargetimeseries, beta=FALSE, gamma=FALSE)
Chargeforecast
Chargeforecast$fitted
plot(Chargeforecast)
Chargeforecast$SSE
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2012 31.9 27.0 31.3 31.0 39.4 40.7 42.3 49.5 45.0 50.0 50.9 58.5
2013 39.4 36.2 40.5 44.6 46.8 44.7 52.2 54.0 48.8 55.8 58.7 63.4
> Chargeforecast$fitted
xhat level
Feb 2012 31.90000 31.90000
Mar 2012 27.86610 27.86610
Apr 2012 30.69304 30.69304
May 2012 30.94574 30.94574
Jun 2012 37.90566 37.90566
Jul 2012 40.20608 40.20608
Aug 2012 41.92989 41.92989
Sep 2012 48.16194 48.16194
Oct 2012 45.55889 45.55889
Nov 2012 49.21501 49.21501
Dec 2012 50.60217 50.60217
Jan 2013 57.10401 57.10401
Feb 2013 42.52929 42.52929
Mar 2013 37.31874 37.31874
Apr 2013 39.93769 39.93769
May 2013 43.77591 43.77591
Jun 2013 46.26547 46.26547
Jul 2013 44.97671 44.97671
Aug 2013 50.92324 50.92324
Sep 2013 53.45616 53.45616
Oct 2013 49.62300 49.62300
Nov 2013 54.70818 54.70818
Dec 2013 57.99442 57.99442