tvGarch_Sim {tvGarchKF}R Documentation

Generating Simulations using a tv-Garch Model

Description

Simulate from a tv-Garch(1,1) model.

Usage

tvGarch_Sim(
  n,
  gamma,
  alpha,
  beta,
  type = c("polynomial", "NoLineal", "trigonometric"),
  exponentes = NULL,
  trig = NULL,
  arg = NULL
)

Arguments

n

integer

gamma

Vector containing coefficents of c.

alpha

Vector containing coefficents of alpha.

beta

Vector containing coefficents of beta.

type

Vector of function type for c, alpha and beta.

exponentes

Vector for exponenets in NoLineal.

trig

Type of trigonometric function.

arg

Value of argument for the trigonometric function.

Value

An object of class 'zoo' with two components: the first component represents returns, while the second component denotes conditional variance.

Examples

## Simulate from a tv-GARCH(1,1) model lineal:
alpha_sim <- c(0.2, 0.2)
beta_sim <- c(0.45, 0.5, -0.85)
type_sim <- c("polynomial","polynomial","polynomial")
Sim1 <- tvGarch_Sim(n = 6000, gamma = 0.1, alpha = alpha_sim, beta = beta_sim, type = type_sim)
plot(Sim1[,1], type="l", main="Simulated tvGARCH(1, 1) process",
    ylim=c(-max(Sim1[,2]), max(Sim1[,2])))
lines(Sim1[,2], type="l", col="red")
legend("topright",legend=c("tvGARCH(1,1)",expression(sigma(u))),
      col=c("black","red"),lty=1,bty="n",lwd=1)
## Simulate from a tv-GARCH(1,1) model non linear:
alpha_sim2 <- c(0.75, 0.08)
beta_sim2 <- c(0.05, 0.03, 0.06)
type_sim2 <- c("polynomial","polynomial","NoLineal")
expo <- c(0, 1, 1/2)
Sim2<-tvGarch_Sim(n=6000,gamma=0.05,alpha=alpha_sim2,beta=beta_sim2,type=type_sim2,exponentes=expo)
plot(Sim2[,1], type="l", main="Simulated tvGARCH(1, 1) process",
     ylim=c(-max(Sim2[,2]),max(Sim2[,2])))
lines(Sim2[,2], type="l", col="red")
legend("topright",legend=c("tvGARCH(1,1)",expression(sigma(u))),
       col=c("black","red"),lty=1,bty="n",lwd=1)

[Package tvGarchKF version 0.0.1 Index]