Sei sulla pagina 1di 5

1a)

sales<-c(19,15,39,102,90,29,90,46,30,66,80,89,82,17,26,29)

y<-ts(sales)

b)

#For alpha = 0.1

m1<-HotWinters(y, alpha=0.1, beta=FALSE, gamma=FALSE)

m1

m1$"coefficients"

m1$"SSE"

m3<-HoltWinters(y, alpha=0.3, beta=FALSE, gamma=FALSE)

m3$"coefficients"

m3$"SSE"

# alpha = 0.5

m5<-HoltWinters(y,alpha=0.5, beta=FALSE, gamma=FALSE)

m5$"coefficients"

m5$"SSE"
# alpha = 0.7

m7<-HoltWinters(y,alpha=0.7, beta=FALSE, gamma=FALSE)

m7$"coefficients"

m7$"SSE"

# alpha = 0.9

m9<-HoltWinters(y,alpha=0.9, beta=FALSE, gamma=FALSE)

m9$"coefficients"

m9$"SSE"

alpha May 1992


0.1 45.53
0.3 41.93414
0.5 33.1438
0.7 29.06341
0.9 28.67559

c)
2a)

2b)

2c)

predict(m,n.ahead=5,prediction.interval=TRUE, level=0.95)
Forecast week 56 = 357.442

Week 56, 95% = (224.2574,490.4309)

Forecast week 57 =

Week 57, 95% =

3a)

export<-
c(362,385,432,341,382,409,498,387,473,513,582,474,544,582,681,557,628,707,773,592,627,725,854,66
1)

y<-ts(export,frequency=4)

plot.ts(y,ylab="Sales")
#3b)

m<-HoltWinters(y)

#3c)

predict(m,n.ahead=2,prediction.interval=TRUE,level=0.95)

#Q4

Fitted values (in red) are larger than the actual values (in black) which should be the case.

Potrebbero piacerti anche