modLik: Affine model likelihood based on divergence prices

Description Usage Arguments Details Value

Description

Functions for preparing model specification, evaluating the likelihood for the DSQ filtering.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
model_translateParameters(par.vec, par.names = names(par.vec), par.restr,
  N.factors)

model_makeDefaultParameterStructures(N.factors,
  pq.equality = c("Q$jmp$lvec", paste0("Q$jmp$lprop.", 1:N.factors),
  paste0("Q$", 1:N.factors, "$eta")))

model_fellerConditionCheck(params.P, params.Q, N.factors)

model_Likelihood_extraNoise(data.structure, model.spec,
  for.estimation = FALSE, filterFoo = DSQ_sqrtFilter, N.points = 5,
  penalized = FALSE, penalty = 1e+12)

model_wrapLikelihood_extraNoise(data.structure, model.spec,
  for.estimation = FALSE, filterFoo = DSQ_sqrtFilter, N.points = 5,
  penalized = FALSE, penalty)

model_Likelihood_portfolio_extraNoise(data.structure, model.spec,
  for.estimation = FALSE,
  filterFoo = divergenceModelR:::portfolio_sqrtFilter, N.points = 5,
  penalized = FALSE, penalty = 1e+12, N.GL.points = 96)

model_wrapLikelihood_portfolio(data.structure, model.spec,
  for.estimation = FALSE,
  filterFoo = divergenceModelR:::portfolio_sqrtFilter, N.points = 5,
  penalized = FALSE, penalty, N.GL.points = 96)

model_Likelihood_affineContract(data.structure, model.spec,
  for.estimation = FALSE, filterFoo = DSQ_sqrtFilter, N.points = 5,
  penalized = FALSE, penalty = 1e+12)

model_wrapLikelihood_affineContract(data.structure, model.spec,
  for.estimation = FALSE,
  filterFoo = divergenceModelR:::portfolio_sqrtFilter, N.points = 5,
  penalized = FALSE, penalty)

Arguments

par.vec

vector with model parameter values

par.names

parameter names, character vector equal in length to par

par.restr

parameter equality restrictions, data.frame; par.vec and par.restr have to exhaust the model parameter set together.

N.factors

integer, number of SV factors

data.structure

list with fields spec.mat, obs.data, noise.cov.cube

model.spec

list with fields params.P, params.Q, jump.type, dt, N.factors, error, mkt

for.estimation

logical; determines return type (log-lik) or filtering result

filterFoo

function that handles the filtering, must correspond to model specification and to provided observables.

N.points

integer, number of integration points for double quadrature in moments of the state and stock price.

penalized

FALSE by default, if TRUE, the Feller constraint is imposed as a penalty on the likelihood. Otherwise, infinity is returned (discontinuous at boundary).

noisePar

vector of noise variance magnitudes, equal to number of observed pfolios

noisePar

vector of noise variance magnitudes, equal to number of observed pfolios

noisePar

vector of noise variance magnitudes, equal to number of observed pfolios

Details

Not much for now

Value

model_Likelihood if for.estimation==TRUE: log-likelihood value (NOT negative of...), else: list with filtering results

model_translateParameters list with fields P and Q, input for all ODE calling functions.

model_makeDefaultParameterStructures returns data.frame par.restr and character vector par.names

model_fellerConditionCheck list with two logical vectors reporting whether the Feller conditions are satisfied

model_Likelihood_extraNoise list with fields P and Q, input for all ODE calling functions.

model_wrapLikelihood_extraNoise wraps the likelihood function with extra noise so that it only accepts a parameter vector argument – use this for optimizers that do not allow passing extra arguments to the optimised function.

model_Likelihood_portfolio_extraNoise list with fields P and Q, input for all ODE calling functions.

model_wrapLikelihood_portfolio wraps the likelihood function so that it only accepts a parameter vector argument – use this for optimizers that do not allow passing extra arguments to the optimised function.

model_Likelihood_affineContracts list with fields P and Q, input for all ODE calling functions.

model_wrapLikelihood_affineContract wraps the likelihood function so that it only accepts a parameter vector argument – use this for optimizers that do not allow passing extra arguments to the optimised function.


piotrek-orlowski/divergenceModelR documentation built on July 21, 2020, 11:51 a.m.