The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
The standard market model assumes a constant beta over the estimation window. In practice, betas can vary over time due to changing firm risk, leverage, or market conditions. The EventStudy package provides two time-varying beta models:
rmgarch)The RollingWindowModel estimates alpha and beta using a
rolling OLS window over the estimation period. The parameters from the
last window are used for event-window prediction.
The window_size parameter controls the width of each
rolling window. A smaller window captures faster parameter changes but
is noisier:
After fitting, you can inspect the time series of rolling parameters:
ps <- ParameterSet$new(
return_model = RollingWindowModel$new(window_size = 60)
)
task <- run_event_study(task, ps)
# Access rolling parameters from the fitted model
model_data <- task$data_tbl$data[[1]]
model_obj <- task$data_tbl$model[[1]]
stats <- model_obj$statistics
# Rolling betas over the estimation window
plot(stats$rolling_betas, type = "l",
main = "Rolling Beta over Estimation Window",
xlab = "Window Index", ylab = "Beta")
abline(h = stats$beta, lty = 2, col = "red") # final betaFor each position in the estimation window, a rolling OLS
regression is fit: \[R_{firm,t} = \alpha_w +
\beta_w R_{market,t} + \varepsilon_t\] where \(w\) indexes windows of size
window_size.
This produces time series of \(\alpha_t\), \(\beta_t\), and \(\sigma_t\).
The parameters from the last rolling window are used to predict expected returns in the event window.
Abnormal returns are computed as: \[AR_t = R_{firm,t} - (\hat{\alpha}_{last} + \hat{\beta}_{last} R_{market,t})\]
The DCCGARCHModel uses bivariate DCC-GARCH to estimate
time-varying conditional correlations and covariances, yielding
time-varying betas.
The DCC-GARCH model requires the rmgarch and
rugarch packages:
A bivariate DCC-GARCH model is fitted to the estimation-window returns:
The time-varying beta is computed from the conditional covariance matrix \(H_t\): \[\beta_t = \frac{H_{12,t}}{H_{22,t}} = \frac{Cov(R_{firm}, R_{market})_t}{Var(R_{market})_t}\]
The last \(\beta_t\) is used for event-window prediction.
DCC-GARCH models can be sensitive to: - Very short estimation windows
(use at least 200 observations) - Extreme returns or near-constant
series - The package uses purrr::safely() internally so
convergence failures produce a warning rather than an error
| Feature | RollingWindowModel | DCCGARCHModel |
|---|---|---|
| Dependencies | None (base R OLS) | rmgarch, rugarch |
| Speed | Fast | Slower |
| Volatility Clustering | No | Yes |
| Estimation Window | 60+ obs | 200+ obs recommended |
| Robustness | Very robust | May fail to converge |
For most applications, the RollingWindowModel provides a
good balance of flexibility and robustness. The
DCCGARCHModel is preferred when time-varying volatility
clustering is important.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.