0

I have a model that gives me a prediction together with the error estimate.

So we have X for the time, Y for the prediction and E for the error.

I would like to plot the prediction and the confidence interval.

The image below shows the type of result I would like to achieve:

Graph with surface area

Don't bother about the vertical stripes and the dashed line.

The graph has a plot that can be made as following:

plot( X, Y, type = 'l', col='red')

Then there is a 50% confidence interval that is as follow [Y+E, Y-E]

So I could add two lines using:

lines(X, Y+E)
lines(X, Y-E)

But instead I would like to color the area between those lines (and preferably using basic R).

Is this possible? Any suggestions?

Zheyuan Li
  • 71,365
  • 17
  • 180
  • 248
benoitespinola
  • 206
  • 2
  • 10

0 Answers0