swing.fixed.design: Generic dynamic emulation of a multiple-stopping problem with...

View source: R/ospProbDesign.R

swing.fixed.designR Documentation

Generic dynamic emulation of a multiple-stopping problem with a non-sequential design

Description

Swing option solver based on a batched non-adaptive design with a variety of regression methods

Usage

swing.fixed.design(
  model,
  input.domain = NULL,
  method = "km",
  inTheMoney.thresh = 0
)

Arguments

model

a list defining all the model parameters

input.domain

the domain of the emulator. Several options are available. Default in NULL All the empirical domains rely on pilot paths generated using pilot.nsims>0 model parameter.

  • NULL will use an empirical probabilistic design based on the pilot paths (default);

  • if a vector of length 2*model$dim then specifies the bounding rectangle

  • a single positive number, then build a bounding rectangle based on the \alpha-quantile of the pilot paths

  • a single negative number, then build a bounding rectangle based on the full range of the pilot paths

  • a vector specifies the precise design, used as-is (overrides design size)

method

regression method to use (defaults to km)

  • km: [(default] Gaussian process with fixed hyperparams uses DiceKriging via km. Requires km.cov (vector of lengthscales) and km.var (scalar process variance)

  • trainkm: GP w/trained hyperparams: use DiceKriging via km. Requires to specify kernel family via kernel.family

  • mlegp Local GP from laGP (uses Gaussian squared exponential kernel)

  • homgp Homoskedastic GP: use hetGP with mleHomGP. Requires to specify kernel family via kernel.family

  • hetgp Heteroskedastic GP: use hetGP with mleHetGP Requires to specify kernel family via kernel.family

  • spline: Smoothing Splines, use smooth.spline from base with the user-specified nk number of knots (1D only)

  • cvspline: smooth.spline from base with automatically chosen (via cross-validation) degrees of freedom/number of knots. Only works in 1D

  • loess: Local polynomial regression: use loess with lo.span parameter

  • rvm: Relevance Vector Machine: use kernlab with rvm

  • lm: linear model from stats using model$bases

inTheMoney.thresh

which paths are kept, out-of-the-money is dropped. Defines threshold in terms of model$payoff.func

Details

Solves for a swing with n.swing exercise rights. The payoff function is saved in swing.payoff. Also assumes a refraction period of refract between consecutive exercises. The experimental design is based on osp.fixed.design. By default, no forward evaluation is provided, ie the method only builds the emulators. Thus, to obtain an actual estimate of the value combine with swing.policy.

Value

a list containing:

  • fit a list containing all the models generated at each time-step. fit[[1]] is the emulator at t=\Delta t, the last one is fit[[M-1]] which is emulator for T-\Delta t.

  • val: the in-sample pathwise rewards

  • test: the out-of-sample pathwise rewards

  • p: the final price (2-vector for in/out-of-sample)

  • timeElapsed (based on Sys.time)

Examples

set.seed(1)
swingModel <- list(dim=1, sim.func=sim.gbm, x0=100,
swing.payoff=put.payoff, n.swing=3,K=100, 
sigma=0.3, r=0.05, div=0,
T=1,dt=0.02,refract=0.1,
N=800,pilot.nsims=1000,batch.nrep=25)
swingModel$nk=16  # number of knots for the smoothing spline
spl.swing <- swing.fixed.design(swingModel,input.domain=0.03, method ="spline")

mludkov/mlOSP documentation built on April 29, 2023, 7:56 p.m.