The number of fishing rods selling each day are given below. Perform analyses of the time series to determine which model should be used for forecasting. (5 marks each model) (a) 3 day moving average analysis (b) 4 day moving average analysis (c) 3 day weighted moving average analysis with weights w1=0.2, w2=0.3 and w3=0.5 with w1 on the oldest data (d) exponential smoothing analysis with a = 0.3. (e) Which model provides a better fit of the data? (f) Forecast day 13 sales of fishing rods using the model chosen in part (e). Day Rods sold 1 60 2 70 3 110 4 80 5 70 6 85 7 115 8 105 9 65 10 75 11 95 12 85
We will use R. I will define a function to measure and we will test for the efficiency
Library: TTR, forecast
error<-function(vect1, vect2){
a<-na.omit(vect1-vect2)
return(sum(a^2)/length(a))
}
d<-data
D<-ts(data)
error(d, SMA(D,4))
[1] 238.5417
> error(d, SMA(D,3))
[1] 312.5
> error(d,WMA(D,3, c(.2,.3,.5)))
[1] 164.725
ses(tds, alpha = .3)
ob=ses(tds, alpha = .3)
ob$residuals
error(d, ob$fitted)
[1] 380.0335
We see that lowest error is in the case of weighted moving average, we ought to use that.
By that method, the forcast is: .2*75+.3*95+.5*85= 86
Get Answers For Free
Most questions answered within 1 hours.