affineCFandDerivs: Characteristic function, moments, cumulant-generating...

affineCFandDerivsR Documentation

Characteristic function, moments, cumulant-generating function.

Description

Functions to evaluate the P- or Q-measure characteristic function, evaluate CF derivatives with respect to the first argument (log-asset price).

Usage

affineCF(
  u,
  params.Q,
  params.P = NULL,
  t.vec,
  v.0,
  jumpTransform = getPointerToJumpTransform(fstr = "expNormJumpTransform")$TF,
  N.factors = 3,
  CGF = FALSE,
  mod.type = "standard",
  mkt = NULL,
  ...
)

affineCFderivs(
  u,
  params.Q,
  params.P = NULL,
  t.vec,
  v.0,
  jumpTransform = getPointerToJumpTransform("expNormJumpTransform"),
  N.factors = 3,
  mod.type = "standard",
  mkt = NULL,
  ...
)

affineCFderivsNumerical(
  u,
  params.Q,
  params.P = NULL,
  t.vec,
  v.0,
  N.factors = 3,
  hh = 1e-04,
  jumpTransform = getPointerToJumpTransform("expNormJumpTransform")$TF,
  mod.type,
  mkt = NULL,
  ...
)

Arguments

u

U x (N.factors+1) matrix of points at which the CF and its derivative should be evaluated.

params.Q

parameter lists, see jumpDiffusionODEs

params.P

parameter lists, see jumpDiffusionODEs

t.vec

numeric vector with maturities, see mkt below

v.0

S x N.factors matrix of volatility factor values

jumpTransform

XPtr to jump transform (in affineCF, affineCFderivsNumerical) or list of Xptrs (in affineCFderivs). Pointers are recovered with getPointerToJumpTransform or can be provided by the user if they're willing to sweat.

N.factors

integer, number of SV factors

CGF

return Cumulant-Generating Function or Characteristic/Moment Generating Function? CGF if TRUE. Log of CF if u is complex.

mkt

data.frame with fields p=1 (deprecated), r (interest rate), q (dividend yield) and t maturity, same as t.vec, uf NULL, replaced with r=0 and q=0

...

Further arguments passed to solveODE

Value

affineCF evaluates the CF/CGF of an affine model under P or Q measures, at matrix u of size U x (N.factors+1), maturity vector t.vec of length T, and variance factor matrix of size S x N.factors. The result is a U x T x S matrix.
affineCFderivs evaluates derivatives of the characteristic function with respect to its first argument via ODE solutions of an extended system. A list of length 4 is returned, each holding an U x T x S matrix. This is useful for calculating moments of log-returns.


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