Skip to main content
edited tags
Link
Richard Hardy
  • 69.5k
  • 13
  • 126
  • 278
added 1 character in body
Source Link
user553480
  • 509
  • 4
  • 10

I have the following GARCH(1,1) model

ymod1 = lm(Jobs ~ Month, df)
yres1=ymod1$residualsresid =ymod1$residuals

library(fGarch)
fit = garchFit(~garch(1,1), cond.dist="sged",  data= resid ,trace=F)

I plotted the expected values with a confidence interval based on the variance predicted by my GARCH model using the predict function:

predict(fit, n.ahead = 12, plot=TRUE,conf=.9,nx=100) 

https://i.sstatic.net/At3C8.png

But it has plotted it on the residuals of a linear trend that I removed, instead of the actual data. How do I obtain a confidence interval for the actual data and plot it on that instead?

I have the following GARCH(1,1) model

ymod1 = lm(Jobs ~ Month, df)
yres1=ymod1$residuals

library(fGarch)
fit = garchFit(~garch(1,1), cond.dist="sged",  data= resid ,trace=F)

I plotted the expected values with a confidence interval based on the variance predicted by my GARCH model using the predict function:

predict(fit, n.ahead = 12, plot=TRUE,conf=.9,nx=100) 

https://i.sstatic.net/At3C8.png

But it has plotted it on the residuals of a linear trend that I removed, instead of the actual data. How do I obtain a confidence interval for the actual data and plot it on that instead?

I have the following GARCH(1,1) model

ymod1 = lm(Jobs ~ Month, df)
resid =ymod1$residuals

library(fGarch)
fit = garchFit(~garch(1,1), cond.dist="sged",  data= resid ,trace=F)

I plotted the expected values with a confidence interval based on the variance predicted by my GARCH model using the predict function:

predict(fit, n.ahead = 12, plot=TRUE,conf=.9,nx=100) 

https://i.sstatic.net/At3C8.png

But it has plotted it on the residuals of a linear trend that I removed, instead of the actual data. How do I obtain a confidence interval for the actual data and plot it on that instead?

Source Link
user553480
  • 509
  • 4
  • 10

add linear trend back into time series prediction (in R)

I have the following GARCH(1,1) model

ymod1 = lm(Jobs ~ Month, df)
yres1=ymod1$residuals

library(fGarch)
fit = garchFit(~garch(1,1), cond.dist="sged",  data= resid ,trace=F)

I plotted the expected values with a confidence interval based on the variance predicted by my GARCH model using the predict function:

predict(fit, n.ahead = 12, plot=TRUE,conf=.9,nx=100) 

https://i.sstatic.net/At3C8.png

But it has plotted it on the residuals of a linear trend that I removed, instead of the actual data. How do I obtain a confidence interval for the actual data and plot it on that instead?