Download daily SPY data (trading symbol ‘SPY’) from January 1, 2010 to March 31,2024 in R. Compute the daily log return. Please answer the following questions:(a). Fit the return data with the following GARCH(1,1) model:yt = µ + utut = vtσtσ2t = α0 + α1u2t−1 + β1σ2t−1Write down the estimated model
Question
Download daily SPY data (trading symbol ‘SPY’) from January 1, 2010 to March 31,2024 in R. Compute the daily log return. Please answer the following questions:(a). Fit the return data with the following GARCH(1,1) model:yt = µ + utut = vtσtσ2t = α0 + α1u2t−1 + β1σ2t−1Write down the estimated model
Solution
To answer your question, we will first need to download the SPY data, compute the daily log return, and then fit the return data with the GARCH(1,1) model. Here's how you can do it in R:
- Download SPY data:
install.packages("quantmod")
library(quantmod)
start_date <- as.Date("2010-01-01")
end_date <- as.Date("2024-03-31")
getSymbols("SPY", src = "yahoo", from = start_date, to = end_date)
- Compute the daily log return:
SPY_returns <- dailyReturn(SPY, type = "log")
- Fit the return data with the GARCH(1,1) model:
install.packages("rugarch")
library(rugarch)
spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
mean.model = list(armaOrder = c(0, 0), include.mean = TRUE),
distribution.model = "norm")
fit <- ugarchfit(spec, SPY_returns)
- Write down the estimated model:
coef(fit)
This will give you the estimated parameters for the GARCH(1,1) model. The output will include estimates for the mean (µ), the constant term in the variance equation (α0), the coefficient for the lagged squared residual (α1), and the coefficient for the lagged conditional variance (β1).
Please note that the actual data for SPY after today's date is not available, so you can only download the data up to today.
Similar Questions
(d). Fit the return data with the following GJR model:yt = µ + utut = vtσtσ2t = α0 + α1u2t−1 + β1σ2t−1 + γu2t−1It−1Write down the estimated model. Hint: Search the function ‘ugarchfit’ in the package‘rugarch’. You can first specify the GJR model as:ugarchspec(variance.model=list(model=’gjrGARCH’), mean.model=list(armaOrder=c(0,0)))Then use ugarchfit to estimate the specified model.(e). Is there leverage effect according to the evidence suggested by the GJR model? Specifyyour reason.
Suppose that the monthly log return of a security 𝑟" follows the MA(1) model𝑟" = 𝑎" + 0.4𝑎"'& ,where {𝑎" } is a Gaussian white noise series with mean zero and variance 0.03.(a) Compute the mean and variance of the return series. (6 points)(b) Compute the lag-1 and lag-2 autocorrelations of the return series. (10 points)(c) Assume that 𝑎&$$ = 0.5. Compute the 1-step- and 2-step-ahead forecasts of the return at theforecast origin 𝑡 = 100. (8 points)(d) What are the standard deviations of the associated forecast errors? (6 points)
1. Suppose that the simple return of a stock follows the model rt = 0.1 + at − 0.5at−2, where {at}T t=1 follows a white noise process with mean zero and variance σ2 a = 0.04. Please compute the following: (a). What is the mean of rt? (b). What is the variance of rt? (c). Compute the first order autocorrelation of rt. (d). Compute the second order autocorrelation of rt. (e). Assume that you are standing at period 100 and a100 = 0.01. Compute the 2-step-ahead forecast of the return.
EF4822 Financial Econometrics Problem Set 2 Due: Right before the class next week. Please submit hard copies in groups and write down the names and EID of all group members. If R programming is used, please show the R commands. 1. Suppose that the simple return of a stock follows the model rt = 0.1 + at − 0.5at−2, where {at}T t=1 follows a white noise process with mean zero and variance σ2 a = 0.04. Please compute the following: (a). What is the mean of rt? (b). What is the variance of rt?
1. Suppose that the simple return of a stock follows the modelrt = 0.1 + at − 0.5at−2,where {at}Tt=1 follows a white noise process with mean zero and variance σ2a = 0.04. Pleasecompute the following:(a). What is the mean of rt?(b). What is the variance of rt?
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.