Reputation: 145
is it possible to estimate a GARCH with volatility in the mean using R?
I read that it may be possible with rgarch package but I have some trouble installing it. Is there any other way?
The model is:
r[t] = mu + c*s[t]^2 + a[t],
a[t] = s[t]*e[t],
s[t]^2 = alpha0 + alpha1 * a[t-1]^2 + beta1 * s[t-1]^2,
Regards,
Juan.
Upvotes: 1
Views: 4986
Reputation: 5152
In 2024, you can estimate this models with rugarch
package:
returns <- data$rtn * 100
spec = ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1), submodel = "GARCH"),
mean.model = list(armaOrder = c(0, 0),
include.mean = TRUE, archm = TRUE, archpow = 2))
#print(spec)
garchm <- ugarchfit(spec = spec, data = returns , solver = 'hybrid')
print(garchm)
coef(garchm)
See the help for more information.
Upvotes: 0
Reputation: 86
Ruey Tsay has published a garchM function. Save the code and load it into R using the source function:
source('/path/to/garchM.R')
The garchM function can be used as follows:
data <- read.table('/path/to/data.txt')
returns <- data$rtn * 100
garchM(returns)
Upvotes: 1