affineSimulate: This function simulates paths from a stochastic volatility...

View source: R/affineSimulate.R

affineSimulateR Documentation

This function simulates paths from a stochastic volatility model with three volatility factors. One of the factors and the underlying asset prices can co-jump. The jump specification follows Duffie, Pan and Singleton (2000), p. 1361.

Description

This function simulates paths from a stochastic volatility model with three volatility factors. One of the factors and the underlying asset prices can co-jump. The jump specification follows Duffie, Pan and Singleton (2000), p. 1361.

Usage

affineSimulate(
  paramsList,
  N.factors = 3,
  t.days = 1,
  t.freq = 1/78,
  freq.subdiv = 24,
  rng.seed = 42,
  init.vals = NULL,
  rf.rate = 0,
  jumpGeneratorPtr = getPointerToGenerator(fstr = "expNormJumpTransform"),
  jumpTransformPtr = getPointerToJumpTransform(fstr = "expNormJumpTransform")$TF,
  mod.type = "standard",
  specMaker = ODEstructsForSim,
  nrepl = 1,
  ...
)

Arguments

paramsList

A list containing fields P and Q, containing, respectively, the P and Q parameters.

N.factors

number of stochastic volatility factors (stock is not a factor)

t.days

Number of days to simulate

t.freq

Number of intraday prices to simulate

freq.subdiv

Number of periods each segment should be broken into when simulating

rng.seed

The random seed used for generations

init.vals

Initial values for the of the stock/volatility to start from (in case we want to continue a given path, if NULL stock will be started from 1 and the volatilities from stationary distribution.)

rf.rate

Assumed constant risk-free rate (annualized, continuously compounded)

specMaker

function that takes arguments params.P, params.Q, jumpTransform, N.factors, rf.rate, mod.type and potentially more via the ellipsis operator (...) and returns the DPS matrices. See documentation of ODEstructs.

jumpTransform

The function that calculates the jump Laplace transform

Value

A list containing the simulated stock & volatility paths + stock price jump times + a time index


piotrek-orlowski/affineModelR documentation built on July 11, 2022, 3:25 p.m.