Learn R Programming

stochvol (version 1.3.3)

svsim: Simulating a Stochastic Volatility Process

Description

svsim is used to produce realizations of a stochastic volatility (SV) process.

Usage

svsim(len, mu = -10, phi = 0.98, sigma = 0.2, nu = Inf)

Arguments

len

length of the simulated time series.

mu

level of the latent log-volatility AR(1) process. The defaults value is -10.

phi

persistence of the latent log-volatility AR(1) process. The default value is 0.98.

sigma

volatility of the latent log-volatility AR(1) process. The default value is 0.2.

nu

degrees-of-freedom for the conditional innovations distribution. The default value is Inf, corresponding to standard normal conditional innovations.

Value

The output is a list object of class svsim containing

y

a vector of length len containing the simulated data, usually interpreted as ``log-returns''.

vol

a vector of length len containing the simulated instantaneous volatilities exp(h_t/2).

vol0

the initial volatility exp(h_0/2), drawn from the stationary distribution of the latent AR(1) process.

para

a named list with three elements mu, phi, sigma (and potentially nu), containing the corresponding arguments.

To display the output use print, summary and plot. The print method simply prints the content of the object in a moderately formatted manner. The summary method provides some summary statistics (in %), and the plot method plots the the simulated 'log-returns' y along with the corresponding volatilities vol.

Details

This function draws an initial log-volatility h_0 from the stationary distribution of the AR(1) process and iteratively generates h_1,...,h_n. Finally, the ``log-returns'' are simulated from a normal distribution with mean 0 and standard deviation exp(h/2).

See Also

svsample

Examples

Run this code
# NOT RUN {
## Simulate a highly persistent SV process of length 500
sim <- svsim(500, phi = 0.99, sigma = 0.1)

print(sim)
summary(sim)
plot(sim)
# }

Run the code above in your browser using DataLab