View source: R/ospPiecewiseBW.R
osp.probDesign.piecewisebw | R 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.
osp.probDesign.piecewisebw(N, model, tst.paths = NULL, verb = 0)
N |
the number of forward training paths |
model |
a list defining all model parameters. Must contain the following fields:
|
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 |
Calls treeDivide.BW to create the equi-probable partitions. Must have N/model$nBins^model$dim as an integer.
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
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.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.