View source: R/ospProbDesign.R
| swing.fixed.design | R Documentation |
Swing option solver based on a batched non-adaptive design with a variety of regression methods
swing.fixed.design(
model,
input.domain = NULL,
method = "km",
inTheMoney.thresh = 0
)
model |
a list defining all the model parameters |
input.domain |
the domain of the emulator. Several options are available. Default in
|
method |
regression method to use (defaults to
|
inTheMoney.thresh |
which paths are kept, out-of-the-money is dropped.
Defines threshold in terms of |
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.
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)
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.