osp.probDesign.piecewisebw: Longstaff Schwartz Algorithm using the Bouchard-Warin method...

View source: R/ospPiecewiseBW.R

osp.probDesign.piecewisebwR Documentation

Longstaff Schwartz Algorithm using the Bouchard-Warin method Uses the Bouchard-Warin recursive partitioning to create N-d trees for local linear regression fits. Each tree node contains N/model$nBins^model$dim inputs.

Description

Longstaff Schwartz Algorithm using the Bouchard-Warin method

Uses the Bouchard-Warin recursive partitioning to create N-d trees for local linear regression fits. Each tree node contains N/model$nBins^model$dim inputs.

Usage

osp.probDesign.piecewisebw(N, model, tst.paths = NULL, verb = 0)

Arguments

N

the number of forward training paths

model

a list defining all model parameters. Must contain the following fields:
T, dt, dim, nBins, sim.func, x0, r, payoff.func

tst.paths

(optional) a list containing out-of-sample paths to obtain a price estimate

verb

if specified, produces plots of the 1-dim fit every verb time-steps [default is zero, no plotting]

Details

Calls treeDivide.BW to create the equi-probable partitions. Must have N/model$nBins^model$dim as an integer.

Value

a list with the following fields:

  • price is the scalar optimal reward;

  • tau is a vector of stopping times over in-sample paths;

  • test is a vector of out-of-sample pathwise rewards;

  • val is a vector of in-sample pathwise rewards

  • timeElapsed total running time based on Sys.time

References

Bruno Bouchard and Xavier Warin. Monte-Carlo valorisation of American options: facts and new algorithms to improve existing methods. In R. Carmona, P. Del Moral, P. Hu, and N. Oudjane, editors, Numerical Methods in Finance, volume 12 of Springer Proceedings in Mathematics. Springer, 2011.

Examples

set.seed(1)
modelSV5 <- list(K=100,x0=c(90, log(0.35)),r=0.0225,div=0,sigma=1,
   T=50/252,dt=1/252,svAlpha=0.015,svEpsY=1,svVol=3,svRho=-0.03,svMean=2.95,
   eulerDt=1/2520, dim=2,sim.func=sim.expOU.sv,nBins=10,payoff.func=sv.put.payoff)
putPr <- osp.probDesign.piecewisebw(20000,modelSV5)
putPr$price
  # get [1] 17.30111

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