Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
- fix to bootstrap (badly name boostrap in some cases)
- fix to vignette latex symbols for external regressors
  • Loading branch information
alexiosg committed Apr 23, 2024
1 parent 172a763 commit 376ae71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions R/predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ simulated_distribution <- function(object, sigma, h = 1, nsim = 1, sim_method =
}
series_sim <- sigma_sim <- NULL
if (nsim > 0 & h > 1) {
if (sim_method == "boostrap") {
out <- garch_boostrap(object, h = h, nsim = nsim, block = block, vreg = tail(vreg, h), seed = seed)
if (sim_method == "bootstrap") {
out <- garch_bootstrap(object, h = h, nsim = nsim, block = block, vreg = tail(vreg, h), seed = seed)
sigma_sim <- out$sigma
colnames(sigma_sim) <- as.character(forc_dates)
class(sigma_sim) <- "tsmodel.distribution"
Expand Down Expand Up @@ -470,7 +470,7 @@ simulated_distribution <- function(object, sigma, h = 1, nsim = 1, sim_method =
}


garch_boostrap <- function(object, h = 2, nsim = 1, block = 1, vreg = NULL, seed = seed)
garch_bootstrap <- function(object, h = 2, nsim = 1, block = 1, vreg = NULL, seed = seed)
{
z <- as.numeric(residuals(object, standardize = TRUE))
zsim <- sample_block(x = z, h = h, nsim = nsim, block = block)
Expand Down
10 changes: 5 additions & 5 deletions vignettes/garch_models.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ at a later time.

\begin{equation}
\begin{aligned}
\omega_t &= \omega + \sum^{m}_{j=1}\xi_j v_{j,t}\\
\omega_t &= \omega + \sum^{m}_{k=1}\xi_k \chi_{k,t}\\
\sigma^2_t &= \omega_t + \sum^q_{j=1}\alpha_j\varepsilon^2_{t-j} + \sum^p_{j=1}\beta_j\sigma^2_{t-j}
\end{aligned}
\label{eq:igarch_equation}
Expand Down Expand Up @@ -634,7 +634,7 @@ to include regressors).

\begin{equation}
\begin{aligned}
\omega_t &= \sum^{m}_{j=1}\xi_j v_{j,t}\\
\omega_t &= \sum^{m}_{k=1}\xi_k \chi_{k,t}\\
\sigma^2_t &= \omega_t + \sum^q_{j=1}\alpha_j\varepsilon^2_{t-j} + \sum^p_{j=1}\beta_j\sigma^2_{t-j}
\end{aligned}
\label{eq:ewma_equation}
Expand Down Expand Up @@ -773,7 +773,7 @@ for past squared, negative innovations via the indicator function $I$.

\begin{equation}
\begin{aligned}
\omega_t &= \omega + \sum^{m}_{j=1}\xi_j v_{j,t}\\
\omega_t &= \omega + \sum^{m}_{k=1}\xi_k \chi_{k,t}\\
\sigma^2_t & = \omega_t + \sum\limits_{j = 1}^q \left(\alpha_j\varepsilon^2_{t - j} + \gamma_j {I}_{[\varepsilon_{t-j}\le 0]}\varepsilon^2_{t - j}\right) + \sum\limits_{j = 1}^p \beta_j\sigma^2_{t-j}
\end{aligned}
\label{eq:gjr_equation}
Expand Down Expand Up @@ -976,7 +976,7 @@ models:

\begin{equation}
\begin{aligned}
\omega_t &= \omega + \sum^{m}_{j=1}\xi_j v_{j,t}\\
\omega_t &= \omega + \sum^{m}_{k=1}\xi_k \chi_{k,t}\\
\sigma^{\delta}_t & = \omega_t + \sum\limits_{j = 1}^q \alpha_j\sigma^{\delta}_{t - j}\left(\left|z_{t - j} - \eta_j\right| -
\gamma_j\left(z_{t - j} - \eta_j\right)\right)^{\delta} + \sum\limits_{j = 1}^p \beta_j\sigma^{\delta}_{t - j}
\end{aligned}
Expand All @@ -987,7 +987,7 @@ The original formulation, takes a slightly different form:

\begin{equation}
\begin{aligned}
\omega_t &= \omega + \sum^{m}_{j=1}\xi_j v_{j,t}\\
\omega_t &= \omega + \sum^{m}_{k=1}\xi_j \chi_{k,t}\\
\sigma^{\delta}_t & = \omega_t + \sum\limits_{j = 1}^q \alpha_j\sigma^{\delta}_{t - j}\left(\left|z_{t - j} - \eta_j\right| -
\gamma_j\left(z_{t - j} - \eta_j\right)\right)^{\lambda} + \sum\limits_{j = 1}^p \beta_j\sigma^{\delta}_{t - j}
\end{aligned}
Expand Down

0 comments on commit 376ae71

Please sign in to comment.