jumpDiffODEs: ODE solver for jump diffusion models.

jumpDiffusionODEsR Documentation

ODE solver for jump diffusion models.

Description

Return the solution of the ODE describing the conditional Laplace transform of the affine states (log stock + volatility factors). Calculations performed under the pricing measure Q, i.e. with value of Laplace transform constrained to 1 for u = c(1,rep(0,N.factors)), where N.factors is the number of stochastic volatility factors, or under the statistical measure P, with Q parameters required to set risk premia and dynamics.

Usage

jumpDiffusionODEs(
  u,
  params,
  mkt,
  jumpTransform = getPointerToJumpTransform("expNormJumpTransform")$TF,
  rtol = 1e-12,
  atol = 1e-30,
  mf = 22,
  N.factors = 3,
  mod.type = "standard"
)

jumpDiffusionODEsP(
  u,
  params.P,
  params.Q,
  mkt,
  jumpTransform = getPointerToJumpTransform("expNormJumpTransform")$TF,
  rtol = 1e-13,
  atol = 1e-30,
  mf = 22,
  N.factors = 3,
  mod.type = "standard"
)

odeExtSolveWrap(
  u,
  params.Q,
  params.P = NULL,
  mkt,
  rtol = 1e-12,
  atol = 1e-30,
  mf = 12,
  N.factors = 3,
  jumpTransform = getPointerToJumpTransform("expNormJumpTransform"),
  mod.type = "standard",
  ...
)

Arguments

u

Ux(N.factors+1) matrix of complex numbers.

params

A list, containing the structures defining the stochastic volatitilites and jumps. See Details.

mkt

data.frame describing the market structure (times to maturity, interest rate, dividend yield, current stock price). See Details.

jumpTransform

string indicating which jump transform to contain in the specification. Available values: 'expNormJumpTransform' for the co-jump specification from DPS (2000) “concrete examples” section, 'kouExpJumpTransform' for a similar co-jump specification with double exponential jumps in the log-asset price.

rtol

relative tolerance for the ODE solver functions, vode and zvode.

atol

absolute tolerance for the ODE solver functions, vode and zvode.

mf

Integration method to use in the ODE solver functions, vode and zvode.

N.factors

The number of volatility factors, of which the first one can co-jump with the stock.

mod.type

string indicating whether the 'standard' DPS (2000) specification should be used, or a variation as seen in Duffie, Pedersen and Singleton (2003), where the volatility of volatility of the first factor can be driven by other factors.

params.P

P (statistical measure) parameters, see Details.

params.Q

Q (pricing measure) parameters, see Details.

Details

jumpDiffusionODEs solves the Riccati equations associated with a jump-diffusion model under the restrictions of the pricing measure: the stock price process is a martingale.
jumpDiffusionODEsP uses params.Q and params.P to construct a model with well-defined risk premia and solves the Riccati equation under the statistical measure; this construction is required because the parameters of the stock equation under the statistical measure depend, in some specifications, on the parameters of the stock and volatility equations under the pricing measure.

params, params.P and params.Q are lists with N.factors+1 fields.

The fields must be named '1' through 'N.factors' and 'jmp'. The numbered fields correspond to volatility factor specifications with parameters: kpp (mean reversion speed), lmb (volatility-of-volatility), rho (correlation with log-asset price, leverage effect), eta (long-run mean), and phi: volatility scaling in the log-asset price equation. kpp, lmb greater than 0, phi greater than or equal to 0. If phi = 0, the volatility factor does not drive the log-asset price, but can potentially drive the jump intensity; either eta or phi should be normalised to 1. The parameter params.P$[["1"]]$erp sets how the risk premium is driven by the total level of volatility.

The list $jmp has fields: lvec (double): jump intensity, constant part, lprop jump intensity loadings on volatility factors, length(lprop) = N.factors, muSc (positive, mean vol jump for 'expNormJumpTransform' or one over mean vol jump for 'kouExpJumpTransform'), rhoc (jump leverage), muYc (jump distribution location parameter), sigmaYc (jump distribution scale parameter).

mkt data.frame describing maturities and corresponding interest rates, dividend yields. Fields: p: initial stock price, normalized to 1 without loss of generality, q dividend yield per annum, r interest rate, per annum, t maturity for which the ODE solutions are to be calculated.

Value

From jumpDiffusionODEs and jumpDiffusionODEsP: An array of size UxTx(N.factors + 1) where U = nrow(u), T = length(mkt$t) (number of maturities), codeN.factors+1 is the number of coefficients in the exponentially affine characteristic function.
From odeEstSolveWrap: an array of UxTx(4x(N.factors+1)): affine coefficients and their derivatives with respect to u[,1]. This allows to for highly accurate evaluation of the derivatives of the characteristic function of the log-asset price.


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