Question: How can I draw a plot in R, showing the Holt Winters predict interval combine with observed/fitted data? I need to produce a figure looks

How can I draw a plot in R, showing the Holt Winters predict interval combine with observed/fitted data? I need to produce a figure looks like the one I uploaded. Flu data is a .csv file so I can't upload it

Figure comes from applying the simple exponential smoothing

algorithm to the flu data and using the predict.HoltWinters

function to construct a 95%-prediction interval for one year ahead.

Reproduce Fig. 1

data import code:

ILI.file <- read.csv(file= "Assignment1DataFlu.csv", header=TRUE)

ILI <- ILI.file[, 2]

ILI <- ts(ILI, start=2008+39/52, frequency = 52)

I used following code, but it doesn't work to produce the right figure:

ILI.hw <- HoltWinters(ILI)

ILI.hw.predict <- predict(ILI.hw,n.ahead=52*1,level=0.95)

plot(ILI.hw,ILI.hw.predict)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!