Author
diff --git a/search.json b/search.json
index 9fb6bc5..b52e0bc 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://mlmc.louisaslett.com/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Louis Aslett. Maintainer, author, translator. Mike Giles. Contributor. Tigran Nagapetyan. Contributor. Sebastian Vollmer. Contributor.","code":""},{"path":"https://mlmc.louisaslett.com/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Aslett L (2024). mlmc: Multi-Level Monte Carlo. R package version 2.0.0, https://github.com/louisaslett/mlmc, https://mlmc.louisaslett.com/.","code":"@Manual{, title = {mlmc: Multi-Level Monte Carlo}, author = {Louis Aslett}, year = {2024}, note = {R package version 2.0.0, https://github.com/louisaslett/mlmc}, url = {https://mlmc.louisaslett.com/}, }"},{"path":"https://mlmc.louisaslett.com/index.html","id":"mlmc-r-package-","dir":"","previous_headings":"","what":"Multi-Level Monte Carlo","title":"Multi-Level Monte Carlo","text":"implementation Multi-level Monte Carlo R. package builds original GPL-2 Matlab C++ implementations Mike Giles (see https://people.maths.ox.ac.uk/~gilesm/mlmc/) provide full MLMC driver example level samplers. Multi-core parallel sampling levels provided built-.","code":""},{"path":"https://mlmc.louisaslett.com/index.html","id":"contact","dir":"","previous_headings":"","what":"Contact","title":"Multi-Level Monte Carlo","text":"Please feel free : submit suggestions bug-reports : https://github.com/louisaslett/mlmc/issues compose e-mail : louis.aslett@durham.ac.uk, nagapetyan@stats.ox.ac.uk vollmer@stats.ox.ac.uk","code":""},{"path":"https://mlmc.louisaslett.com/index.html","id":"install","dir":"","previous_headings":"","what":"Install","title":"Multi-Level Monte Carlo","text":"can install latest release directly CRAN. can install latest binary r-universe:","code":"install.packages(\"mlmc\") install.packages(\"mlmc\", repos = c(\"https://louisaslett.r-universe.dev\", \"https://cloud.r-project.org\"))"},{"path":"https://mlmc.louisaslett.com/index.html","id":"install-development-version-not-recommended","dir":"","previous_headings":"","what":"Install development version (not recommended)","title":"Multi-Level Monte Carlo","text":"Installing directly GitHub supported install.packages command. use devtools package install development version desired. releases, tree/commit CRAN releases made recorded, historic source can downloaded .","code":"install.packages(\"devtools\") devtools::install_github(\"louisaslett/mlmc\")"},{"path":"https://mlmc.louisaslett.com/index.html","id":"acknowledgements","dir":"","previous_headings":"","what":"Acknowledgements","title":"Multi-Level Monte Carlo","text":"Louis Aslett supported -like programme grant (EPSRC grant reference number EP/K014463/1 http://www.-like.org.uk) package first conceived. Tigran Nagapetyan Sebastian Vollmer supported EPSRC Grant EP/N000188/1.","code":""},{"path":"https://mlmc.louisaslett.com/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Multi-Level Monte Carlo","text":"use software, please cite: Aslett, L. J. M., Giles, M. B., Nagapetyan, T. Vollmer, S. J. (2016), mlmc: Multi-Level Monte Carlo. R package. https://CRAN.R-project.org/package=mlmc Thank-.","code":"@Manual{mlmcpkg, title = {mlmc: Multi-Level Monte Carlo}, author = {Aslett, L. J. M. and Giles, M. B. and Nagapetyan, T. and Vollmer, S. J.}, year = {2016}, note = {R package}, url = {https://CRAN.R-project.org/package=mlmc}, }"},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":null,"dir":"Reference","previous_headings":"","what":"Financial options using a Milstein discretisation — mcqmc06_l","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"Financial options based scalar geometric Brownian motion, similar Mike Giles' MCQMC06 paper, Giles (2008), using Milstein discretisation.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"","code":"mcqmc06_l(l, N, option)"},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"l level simulated. N number samples computed. option option type, 1 5. options : 1 = European call; 2 = Asian call; 3 = lookback call; 4 = digital call; 5 = barrier call.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"function based GPL-2 C++ code Mike Giles.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"Giles, M. (2008) 'Improved Multilevel Monte Carlo Convergence using Milstein Scheme', . Keller, S. Heinrich, H. Niederreiter (eds) Monte Carlo Quasi-Monte Carlo Methods 2006. Berlin, Heidelberg: Springer, pp. 343–358. Available : https://doi.org/10.1007/978-3-540-74496-2_20.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"Louis Aslett
Mike Giles ","code":""},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"","code":"if (FALSE) { # \\dontrun{ # These are similar to the MLMC tests for the MCQMC06 paper # using a Milstein discretisation with 2^l timesteps on level l # # The figures are slightly different due to: # -- change in MSE split # -- change in cost calculation # -- different random number generation # -- switch to S_0=100 N0 <- 200 # initial samples on coarse levels Lmin <- 2 # minimum refinement level Lmax <- 10 # maximum refinement level test.res <- list() for(option in 1:5) { if(option == 1) { cat(\"\\n ---- Computing European call ---- \\n\") N <- 20000 # samples for convergence tests L <- 8 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } else if(option == 2) { cat(\"\\n ---- Computing Asian call ---- \\n\") N <- 20000 # samples for convergence tests L <- 8 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } else if(option == 3) { cat(\"\\n ---- Computing lookback call ---- \\n\") N <- 20000 # samples for convergence tests L <- 10 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } else if(option == 4) { cat(\"\\n ---- Computing digital call ---- \\n\") N <- 200000 # samples for convergence tests L <- 8 # levels for convergence tests Eps <- c(0.01, 0.02, 0.05, 0.1, 0.2) } else if(option == 5) { cat(\"\\n ---- Computing barrier call ---- \\n\") N <- 200000 # samples for convergence tests L <- 8 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } test.res[[option]] <- mlmc.test(mcqmc06_l, N, L, N0, Eps, Lmin, Lmax, option = option) # plot results plot(test.res[[option]]) } } # } # The level sampler can be called directly to retrieve the relevant level sums: mcqmc06_l(l = 7, N = 10, option = 1) #> $sums #> [1] 4.065939e-02 4.561184e-04 5.165569e-06 6.039214e-08 9.787067e+01 #> [6] 2.147454e+03 #> #> $cost #> [1] 1280 #>"},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":null,"dir":"Reference","previous_headings":"","what":"Multi-level Monte Carlo estimation — mlmc","title":"Multi-level Monte Carlo estimation — mlmc","text":"function Multi-level Monte Carlo driver sample levels user specified function.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multi-level Monte Carlo estimation — mlmc","text":"","code":"mlmc( Lmin, Lmax, N0, eps, mlmc_l, alpha = NA, beta = NA, gamma = NA, parallel = NA, ... )"},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multi-level Monte Carlo estimation — mlmc","text":"Lmin minimum level refinement. Must \\(\\ge 2\\). Lmax maximum level refinement. Must \\(\\ge\\) Lmin. N0 initial number samples used first 3 levels subsequent levels automatically added. Must \\(> 0\\). eps target accuracy estimate (root mean square error). Must \\(> 0\\). mlmc_l user supplied function provides estimate level \\(l\\). must take least two arguments, first level number simulated second number paths. Additional arguments can taken desired: additional ... arguments function forwarded user defined mlmc_l function. user supplied function return named list containing one element named sums second named cost, : sums vector length two \\(\\left(\\sum Y_i, \\sum Y_i^2\\right)\\) \\(Y_i\\) iid simulations expectation \\(E[P_0]\\) \\(l=0\\) expectation \\(E[P_l-P_{l-1}]\\) \\(l>0\\). cost scalar total cost paths simulated. example, financial options samplers included package, calculated \\(NM^l\\), \\(N\\) number paths requested call user function mlmc_l, \\(M\\) refinement cost factor (\\(M=2\\) mcqmc06_l() \\(M=4\\) opre_l()), \\(l\\) level sampled. See function (source code ) opre_l() mcqmc06_l() package example user supplied level samplers. alpha weak error, \\(O(2^{-\\alpha l})\\). Must \\(> 0\\) specified. NA alpha estimated. beta variance, \\(O(2^{-\\beta l})\\). Must \\(> 0\\) specified. NA beta estimated. gamma sample cost, \\(O(2^{\\gamma l})\\). Must \\(> 0\\) specified. NA gamma estimated. parallel integer supplied, R fork parallel parallel processes compute level estimate parallel. ... additional arguments passed user supplied mlmc_l function called.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Multi-level Monte Carlo estimation — mlmc","text":"list containing: P MLMC estimate; Nl vector number samples performed level; Cl Per sample cost level.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Multi-level Monte Carlo estimation — mlmc","text":"Multilevel Monte Carlo Method method originated works Giles (2008) Heinrich (1998). Consider sequence \\(P_0, P_1, \\ldots\\), approximates \\(P_L\\) increasing accuracy, also increasing cost, simple identity $$E[P_L] = E[P_0] + \\sum_{l=1}^L E[P_l-P_{l-1}],$$ therefore can use following unbiased estimator \\(E[P_L]\\), $$N_0^{-1} \\sum_{n=1}^{N_0} P_0^{(0,n)} + \\sum_{l=1}^L \\left\\{ N_l^{-1} \\sum_{n=1}^{N_l} \\left(P_l^{(l,n)} - P_{l-1}^{(l,n)}\\right) \\right\\}$$ \\(N_l\\) samples produced level \\(l\\). inclusion level \\(l\\) superscript \\((l,n)\\) indicates samples used level correction independent. Set \\(C_0\\), \\(V_0\\) cost variance one sample \\(P_0\\), \\(C_l, V_l\\) cost variance one sample \\(P_l - P_{l-1}\\), overall cost variance multilevel estimator \\(\\sum_{l=0}^L N_l C_l\\) \\(\\sum_{l=0}^L N_l^{-1} V_l\\), respectively. idea behind method, provided product \\(V_l C_l\\) decreases \\(l\\), .e. cost increases level slower variance decreases, one can achieve significant computational savings, can formalised Theorem 1 Giles (2015). information multilevel Monte Carlo methods, see webpage https://people.maths.ox.ac.uk/gilesm/mlmc_community.html lists research groups working area, main publications. function based GPL-2 'Matlab' code Mike Giles.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Multi-level Monte Carlo estimation — mlmc","text":"Giles, M.B. (2008) 'Multilevel Monte Carlo Path Simulation', Operations Research, 56(3), pp. 607–617. Available : https://doi.org/10.1287/opre.1070.0496. Giles, M.B. (2015) 'Multilevel Monte Carlo methods', Acta Numerica, 24, pp. 259–328. Available : https://doi.org/10.1017/S096249291500001X. Heinrich, S. (1998) 'Monte Carlo Complexity Global Solution Integral Equations', Journal Complexity, 14(2), pp. 151–175. Available : https://doi.org/10.1006/jcom.1998.0471.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Multi-level Monte Carlo estimation — mlmc","text":"Louis Aslett Mike Giles Tigran Nagapetyan ","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multi-level Monte Carlo estimation — mlmc","text":"","code":"mlmc(2, 6, 1000, 0.01, opre_l, option = 1) #> $P #> [1] 10.44813 #> #> $Nl #> [1] 4294178 357038 106626 22315 #> #> $Cl #> [1] 1 4 16 64 #> mlmc(2, 10, 1000, 0.01, mcqmc06_l, option = 1) #> $P #> [1] 10.43656 #> #> $Nl #> [1] 3018378 56809 28405 8180 3002 1100 378 146 #> #> $Cl #> [1] 1 2 4 8 16 32 64 128 #>"},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":null,"dir":"Reference","previous_headings":"","what":"Multi-level Monte Carlo estimation test suite — mlmc.test","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"Computes suite diagnostic values MLMC estimation problem.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"","code":"mlmc.test( mlmc_l, N, L, N0, eps.v, Lmin, Lmax, parallel = NA, silent = FALSE, ... )"},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"mlmc_l user supplied function provides estimate level \\(l\\). must take least two arguments, first level number simulated second number paths. Additional arguments can taken desired: additional ... arguments function forwarded user defined mlmc_l function. user supplied function return named list containing one element named sums second named cost, : sums vector length two \\(\\left(\\sum Y_i, \\sum Y_i^2\\right)\\) \\(Y_i\\) iid simulations expectation \\(E[P_0]\\) \\(l=0\\) expectation \\(E[P_l-P_{l-1}]\\) \\(l>0\\). cost scalar total cost paths simulated. example, financial options samplers included package, calculated \\(NM^l\\), \\(N\\) number paths requested call user function mlmc_l, \\(M\\) refinement cost factor (\\(M=2\\) mcqmc06_l() \\(M=4\\) opre_l()), \\(l\\) level sampled. See function (source code ) opre_l() mcqmc06_l() package example user supplied level samplers. N number samples use tests L number levels use tests N0 initial number samples used first 3 levels subsequent levels automatically added. Must \\(> 0\\). eps.v vector one target accuracies tests. Must \\(> 0\\). Lmin minimum level refinement. Must \\(\\ge 2\\). Lmax maximum level refinement. Must \\(\\ge\\) Lmin. parallel integer supplied, R fork parallel parallel processes. done convergence tests section splitting N samples evenly possible across cores sampling level. also done MLMC complexity tests passing parallel argument mlmc() driver targeting accuracy level eps. silent set TRUE supress running output (identical output can still printed printing return result) ... additional arguments passed user supplied mlmc_l function called","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"mlmc.test object contains computed diagnostic values. object can printed plotted (see plot.mlmc.test).","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"See one example level sampler functions (e.g. opre_l) example usage. function based GPL-2 'Matlab' code Mike Giles.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"Louis Aslett Mike Giles Tigran Nagapetyan ","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"","code":"if (FALSE) { # \\dontrun{ # Example calls with realistic arguments # Financial options using an Euler-Maruyama discretisation tst <- mlmc.test(opre_l, N = 2000000, L = 5, N0 = 1000, eps.v = c(0.005, 0.01, 0.02, 0.05, 0.1), Lmin = 2, Lmax = 6, option = 1) tst plot(tst) # Financial options using a Milstein discretisation tst <- mlmc.test(mcqmc06_l, N = 20000, L = 8, N0 = 200, eps.v = c(0.005, 0.01, 0.02, 0.05, 0.1), Lmin = 2, Lmax = 10, option = 1) tst plot(tst) } # } # Toy versions for CRAN tests tst <- mlmc.test(opre_l, N = 10000, L = 5, N0 = 1000, eps.v = c(0.025, 0.1), Lmin = 2, Lmax = 6, option = 1) #> #> ********************************************************** #> *** Convergence tests, kurtosis, telescoping sum check *** #> *** using N = 10000 samples *** #> ********************************************************** #> #> l ave(Pf-Pc) ave(Pf) var(Pf-Pc) var(Pf) kurtosis check cost #> --------------------------------------------------------------------------------------- #> 0 9.9864e+00 9.9864e+00 1.5806e+02 1.5806e+02 0.0000e+00 0.0000e+00 1.0000e+00 #> 1 2.3616e-01 1.0528e+01 4.6195e+00 2.0513e+02 2.0180e+01 3.5003e-01 4.0000e+00 #> 2 3.6916e-02 1.0709e+01 1.1293e+00 2.2145e+02 1.3114e+01 1.5936e-01 1.6000e+01 #> 3 3.7534e-03 1.0384e+01 2.6563e-01 2.1298e+02 6.6822e+00 3.6542e-01 6.4000e+01 #> 4 2.3320e-03 1.0483e+01 6.7543e-02 2.1957e+02 6.4185e+00 1.0816e-01 2.5600e+02 #> 5 1.5741e-03 1.0830e+01 1.8175e-02 2.2166e+02 5.8218e+00 3.8607e-01 1.0240e+03 #> #> ****************************************************** #> *** Linear regression estimates of MLMC parameters *** #> ****************************************************** #> #> alpha = 1.844283 (exponent for MLMC weak convergence) #> beta = 2.004277 (exponent for MLMC variance) #> gamma = 2.000000 (exponent for MLMC cost) #> #> ***************************** #> *** MLMC complexity tests *** #> ***************************** #> #> eps value mlmc_cost std_cost savings N_l #> ----------------------------------------------------------- #> 0.0250 1.0470e+01 1.370e+06 2.908e+07 21.22 685621 57426 13880 3639 #> 0.1000 1.0323e+01 6.383e+04 4.724e+05 7.40 35781 3013 1000 #> tst <- mlmc.test(mcqmc06_l, N = 10000, L = 8, N0 = 1000, eps.v = c(0.025, 0.1), Lmin = 2, Lmax = 10, option = 1) #> #> ********************************************************** #> *** Convergence tests, kurtosis, telescoping sum check *** #> *** using N = 10000 samples *** #> ********************************************************** #> #> l ave(Pf-Pc) ave(Pf) var(Pf-Pc) var(Pf) kurtosis check cost #> --------------------------------------------------------------------------------------- #> 0 9.9254e+00 9.9254e+00 1.9093e+02 1.9093e+02 0.0000e+00 0.0000e+00 1.0000e+00 #> 1 1.8237e-01 1.0161e+01 1.6474e-01 2.0577e+02 1.5619e+02 6.1665e-02 2.0000e+00 #> 2 1.0610e-01 1.0567e+01 4.3677e-02 2.1657e+02 2.4251e+01 3.4217e-01 4.0000e+00 #> 3 5.3915e-02 1.0397e+01 1.1391e-02 2.1350e+02 1.6232e+01 2.5413e-01 8.0000e+00 #> 4 2.8379e-02 1.0610e+01 3.1579e-03 2.2062e+02 1.6977e+01 2.0880e-01 1.6000e+01 #> 5 1.4092e-02 1.0527e+01 8.3114e-04 2.1503e+02 1.3656e+01 1.0984e-01 3.2000e+01 #> 6 6.9390e-03 1.0364e+01 2.0637e-04 2.1144e+02 1.0092e+01 1.9322e-01 6.4000e+01 #> 7 3.5004e-03 1.0411e+01 5.1394e-05 2.1552e+02 1.0496e+01 4.9106e-02 1.2800e+02 #> 8 1.7754e-03 1.0504e+01 1.3201e-05 2.1573e+02 8.9490e+00 1.0384e-01 2.5600e+02 #> #> ****************************************************** #> *** Linear regression estimates of MLMC parameters *** #> ****************************************************** #> #> alpha = 0.967513 (exponent for MLMC weak convergence) #> beta = 1.942754 (exponent for MLMC variance) #> gamma = 1.000000 (exponent for MLMC cost) #> #> ***************************** #> *** MLMC complexity tests *** #> ***************************** #> #> eps value mlmc_cost std_cost savings N_l #> ----------------------------------------------------------- #> 0.0250 1.0462e+01 5.305e+05 2.887e+07 54.42 471243 9357 3473 1309 468 158 57 #> 0.1000 1.0562e+01 3.641e+04 4.707e+05 12.93 29249 1000 1000 81 32 #>"},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":null,"dir":"Reference","previous_headings":"","what":"Financial options using an Euler-Maruyama discretisation — opre_l","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"Financial options based scalar geometric Brownian motion Heston models, similar Mike Giles' original 2008 Operations Research paper, Giles (2008), using Euler-Maruyama discretisation","code":""},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"","code":"opre_l(l, N, option)"},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"l level simulated. N number samples computed. option option type, 1 5. options : 1 = European call; 2 = Asian call; 3 = lookback call; 4 = digital call; 5 = Heston model.","code":""},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"function based GPL-2 'Matlab' code Mike Giles.","code":""},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"Giles, M.B. (2008) 'Multilevel Monte Carlo Path Simulation', Operations Research, 56(3), pp. 607–617. Available : https://doi.org/10.1287/opre.1070.0496.","code":""},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"Louis Aslett Mike Giles Tigran Nagapetyan ","code":""},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"","code":"if (FALSE) { # \\dontrun{ # These are similar to the MLMC tests for the original # 2008 Operations Research paper, using an Euler-Maruyama # discretisation with 4^l timesteps on level l. # # The differences are: # -- the plots do not have the extrapolation results # -- two plots are log_2 rather than log_4 # -- the new MLMC driver is a little different # -- switch to X_0=100 instead of X_0=1 N0 <- 1000 # initial samples on coarse levels Lmin <- 2 # minimum refinement level Lmax <- 6 # maximum refinement level test.res <- list() for(option in 1:5) { if(option == 1) { cat(\"\\n ---- Computing European call ---- \\n\") N <- 1000000 # samples for convergence tests L <- 5 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } else if(option == 2) { cat(\"\\n ---- Computing Asian call ---- \\n\") N <- 1000000 # samples for convergence tests L <- 5 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } else if(option == 3) { cat(\"\\n ---- Computing lookback call ---- \\n\") N <- 1000000 # samples for convergence tests L <- 5 # levels for convergence tests Eps <- c(0.01, 0.02, 0.05, 0.1, 0.2) } else if(option == 4) { cat(\"\\n ---- Computing digital call ---- \\n\") N <- 4000000 # samples for convergence tests L <- 5 # levels for convergence tests Eps <- c(0.02, 0.05, 0.1, 0.2, 0.5) } else if(option == 5) { cat(\"\\n ---- Computing Heston model ---- \\n\") N <- 2000000 # samples for convergence tests L <- 5 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } test.res[[option]] <- mlmc.test(opre_l, N, L, N0, Eps, Lmin, Lmax, option = option) # print exact analytic value, based on S0=K T <- 1 r <- 0.05 sig <- 0.2 K <- 100 k <- 0.5*sig^2/r; d1 <- (r+0.5*sig^2)*T / (sig*sqrt(T)) d2 <- (r-0.5*sig^2)*T / (sig*sqrt(T)) if(option == 1) { val <- K*( pnorm(d1) - exp(-r*T)*pnorm(d2) ) } else if(option == 2) { val <- NA } else if(option == 3) { val <- K*( pnorm(d1) - pnorm(-d1)*k - exp(-r*T)*(pnorm(d2) - pnorm(d2)*k) ) } else if(option == 4) { val <- K*exp(-r*T)*pnorm(d2) } else if(option == 5) { val <- NA } if(is.na(val)) { cat(sprintf(\"\\n Exact value unknown, MLMC value: %f \\n\", test.res[[option]]$P[1])) } else { cat(sprintf(\"\\n Exact value: %f, MLMC value: %f \\n\", val, test.res[[option]]$P[1])) } # plot results plot(test.res[[option]]) } } # } # The level sampler can be called directly to retrieve the relevant level sums: opre_l(l = 7, N = 10, option = 1) #> $sums #> [1] 1.064477e-02 2.275113e-02 -6.541730e-04 1.403334e-04 1.485436e+02 #> [6] 4.556201e+03 #> #> $cost #> [1] 163840 #>"},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot an mlmc.test object — plot.mlmc.test","title":"Plot an mlmc.test object — plot.mlmc.test","text":"Produces diagnostic plots result mlmc.test function call.","code":""},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot an mlmc.test object — plot.mlmc.test","text":"","code":"# S3 method for class 'mlmc.test' plot(x, which = \"all\", cols = NA, ...)"},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot an mlmc.test object — plot.mlmc.test","text":"x mlmc.test object produced call mlmc.test function. vector strings specifying plots produce, \"\" diagnostic plots options : \"var\" = \\(\\log_2\\) variance level; \"mean\" = \\(\\log_2\\) absolute value mean level; \"consis\" = consistency level; \"kurt\" = kurtosis level; \"Nl\" = \\(\\log_2\\) number samples level; \"cost\" = \\(\\log_{10}\\) cost \\(\\log_{10}\\) epsilon (accuracy). cols number columns across plot override default value. ... additional arguments passed plotting functions.","code":""},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot an mlmc.test object — plot.mlmc.test","text":"plots produced relatively self-explanatory. However, consistency kurtosis plots particular may require background. highly recommended refer Section 3.3 Giles (2015), rationale diagnostic plots addressed full detail.","code":""},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Plot an mlmc.test object — plot.mlmc.test","text":"Giles, M.B. (2015) 'Multilevel Monte Carlo methods', Acta Numerica, 24, pp. 259–328. Available : https://doi.org/10.1017/S096249291500001X.","code":""},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot an mlmc.test object — plot.mlmc.test","text":"Louis Aslett ","code":""},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot an mlmc.test object — plot.mlmc.test","text":"","code":"if (FALSE) { # \\dontrun{ tst <- mlmc.test(opre_l, N = 2000000, L = 5, N0 = 1000, eps.v = c(0.005, 0.01, 0.02, 0.05, 0.1), Lmin = 2, Lmax = 6, option = 1) tst plot(tst) } # }"}]
+[{"path":"https://mlmc.louisaslett.com/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Louis Aslett. Maintainer, author, translator. Mike Giles. Contributor. Tigran Nagapetyan. Contributor. Sebastian Vollmer. Contributor.","code":""},{"path":"https://mlmc.louisaslett.com/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Aslett L (2024). mlmc: Multi-Level Monte Carlo. R package version 2.0.1, https://github.com/louisaslett/mlmc, https://mlmc.louisaslett.com/.","code":"@Manual{, title = {mlmc: Multi-Level Monte Carlo}, author = {Louis Aslett}, year = {2024}, note = {R package version 2.0.1, https://github.com/louisaslett/mlmc}, url = {https://mlmc.louisaslett.com/}, }"},{"path":"https://mlmc.louisaslett.com/index.html","id":"mlmc-r-package-","dir":"","previous_headings":"","what":"Multi-Level Monte Carlo","title":"Multi-Level Monte Carlo","text":"implementation Multi-level Monte Carlo R. package builds original GPL-2 Matlab C++ implementations Mike Giles (see https://people.maths.ox.ac.uk/~gilesm/mlmc/) provide full MLMC driver example level samplers. Multi-core parallel sampling levels provided built-.","code":""},{"path":"https://mlmc.louisaslett.com/index.html","id":"contact","dir":"","previous_headings":"","what":"Contact","title":"Multi-Level Monte Carlo","text":"Please feel free : submit suggestions bug-reports : https://github.com/louisaslett/mlmc/issues compose e-mail : louis.aslett@durham.ac.uk, nagapetyan@stats.ox.ac.uk vollmer@stats.ox.ac.uk","code":""},{"path":"https://mlmc.louisaslett.com/index.html","id":"install","dir":"","previous_headings":"","what":"Install","title":"Multi-Level Monte Carlo","text":"can install latest release directly CRAN. can install latest binary r-universe:","code":"install.packages(\"mlmc\") install.packages(\"mlmc\", repos = c(\"https://louisaslett.r-universe.dev\", \"https://cloud.r-project.org\"))"},{"path":"https://mlmc.louisaslett.com/index.html","id":"install-development-version-not-recommended","dir":"","previous_headings":"","what":"Install development version (not recommended)","title":"Multi-Level Monte Carlo","text":"Installing directly GitHub supported install.packages command. use devtools package install development version desired. releases, tree/commit CRAN releases made recorded, historic source can downloaded .","code":"install.packages(\"devtools\") devtools::install_github(\"louisaslett/mlmc\")"},{"path":"https://mlmc.louisaslett.com/index.html","id":"acknowledgements","dir":"","previous_headings":"","what":"Acknowledgements","title":"Multi-Level Monte Carlo","text":"Louis Aslett supported -like programme grant (EPSRC grant reference number EP/K014463/1 http://www.-like.org.uk) package first conceived. Tigran Nagapetyan Sebastian Vollmer supported EPSRC Grant EP/N000188/1.","code":""},{"path":"https://mlmc.louisaslett.com/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Multi-Level Monte Carlo","text":"use software, please cite: Aslett, L. J. M., Giles, M. B., Nagapetyan, T. Vollmer, S. J. (2016), mlmc: Multi-Level Monte Carlo. R package. https://CRAN.R-project.org/package=mlmc Thank-.","code":"@Manual{mlmcpkg, title = {mlmc: Multi-Level Monte Carlo}, author = {Aslett, L. J. M. and Giles, M. B. and Nagapetyan, T. and Vollmer, S. J.}, year = {2016}, note = {R package}, url = {https://CRAN.R-project.org/package=mlmc}, }"},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":null,"dir":"Reference","previous_headings":"","what":"Financial options using a Milstein discretisation — mcqmc06_l","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"Financial options based scalar geometric Brownian motion, similar Mike Giles' MCQMC06 paper, Giles (2008), using Milstein discretisation.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"","code":"mcqmc06_l(l, N, option)"},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"l level simulated. N number samples computed. option option type, 1 5. options : 1 = European call; 2 = Asian call; 3 = lookback call; 4 = digital call; 5 = barrier call.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"function based GPL-2 C++ code Mike Giles.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"Giles, M. (2008) 'Improved Multilevel Monte Carlo Convergence using Milstein Scheme', . Keller, S. Heinrich, H. Niederreiter (eds) Monte Carlo Quasi-Monte Carlo Methods 2006. Berlin, Heidelberg: Springer, pp. 343–358. Available : doi:10.1007/978-3-540-74496-2_20 .","code":""},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"Louis Aslett Mike Giles ","code":""},{"path":"https://mlmc.louisaslett.com/reference/mcqmc06_l.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Financial options using a Milstein discretisation — mcqmc06_l","text":"","code":"if (FALSE) { # \\dontrun{ # These are similar to the MLMC tests for the MCQMC06 paper # using a Milstein discretisation with 2^l timesteps on level l # # The figures are slightly different due to: # -- change in MSE split # -- change in cost calculation # -- different random number generation # -- switch to S_0=100 N0 <- 200 # initial samples on coarse levels Lmin <- 2 # minimum refinement level Lmax <- 10 # maximum refinement level test.res <- list() for(option in 1:5) { if(option == 1) { cat(\"\\n ---- Computing European call ---- \\n\") N <- 20000 # samples for convergence tests L <- 8 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } else if(option == 2) { cat(\"\\n ---- Computing Asian call ---- \\n\") N <- 20000 # samples for convergence tests L <- 8 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } else if(option == 3) { cat(\"\\n ---- Computing lookback call ---- \\n\") N <- 20000 # samples for convergence tests L <- 10 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } else if(option == 4) { cat(\"\\n ---- Computing digital call ---- \\n\") N <- 200000 # samples for convergence tests L <- 8 # levels for convergence tests Eps <- c(0.01, 0.02, 0.05, 0.1, 0.2) } else if(option == 5) { cat(\"\\n ---- Computing barrier call ---- \\n\") N <- 200000 # samples for convergence tests L <- 8 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } test.res[[option]] <- mlmc.test(mcqmc06_l, N, L, N0, Eps, Lmin, Lmax, option = option) # print exact analytic value, based on S0=K T <- 1 r <- 0.05 sig <- 0.2 K <- 100 B <- 0.85*K k <- 0.5*sig^2/r; d1 <- (r+0.5*sig^2)*T / (sig*sqrt(T)) d2 <- (r-0.5*sig^2)*T / (sig*sqrt(T)) d3 <- (2*log(B/K) + (r+0.5*sig^2)*T) / (sig*sqrt(T)) d4 <- (2*log(B/K) + (r-0.5*sig^2)*T) / (sig*sqrt(T)) if(option == 1) { val <- K*( pnorm(d1) - exp(-r*T)*pnorm(d2) ) } else if(option == 2) { val <- NA } else if(option == 3) { val <- K*( pnorm(d1) - pnorm(-d1)*k - exp(-r*T)*(pnorm(d2) - pnorm(d2)*k) ) } else if(option == 4) { val <- K*exp(-r*T)*pnorm(d2) } else if(option == 5) { val <- K*( pnorm(d1) - exp(-r*T)*pnorm(d2) - ((K/B)^(1-1/k))*((B^2)/(K^2)*pnorm(d3) - exp(-r*T)*pnorm(d4)) ) } if(is.na(val)) { cat(sprintf(\"\\n Exact value unknown, MLMC value: %f \\n\", test.res[[option]]$P[1])) } else { cat(sprintf(\"\\n Exact value: %f, MLMC value: %f \\n\", val, test.res[[option]]$P[1])) } # plot results plot(test.res[[option]]) } } # } # The level sampler can be called directly to retrieve the relevant level sums: mcqmc06_l(l = 7, N = 10, option = 1) #> $sums #> [1] 4.065939e-02 4.561184e-04 5.165569e-06 6.039214e-08 9.787067e+01 #> [6] 2.147454e+03 #> #> $cost #> [1] 1280 #>"},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":null,"dir":"Reference","previous_headings":"","what":"Multi-level Monte Carlo estimation — mlmc","title":"Multi-level Monte Carlo estimation — mlmc","text":"function Multi-level Monte Carlo driver sample levels user specified function.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multi-level Monte Carlo estimation — mlmc","text":"","code":"mlmc( Lmin, Lmax, N0, eps, mlmc_l, alpha = NA, beta = NA, gamma = NA, parallel = NA, ... )"},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multi-level Monte Carlo estimation — mlmc","text":"Lmin minimum level refinement. Must \\(\\ge 2\\). Lmax maximum level refinement. Must \\(\\ge\\) Lmin. N0 initial number samples used first 3 levels subsequent levels automatically added. Must \\(> 0\\). eps target accuracy estimate (root mean square error). Must \\(> 0\\). mlmc_l user supplied function provides estimate level \\(l\\). must take least two arguments, first level number simulated second number paths. Additional arguments can taken desired: additional ... arguments function forwarded user defined mlmc_l function. user supplied function return named list containing one element named sums second named cost, : sums vector length two \\(\\left(\\sum Y_i, \\sum Y_i^2\\right)\\) \\(Y_i\\) iid simulations expectation \\(E[P_0]\\) \\(l=0\\) expectation \\(E[P_l-P_{l-1}]\\) \\(l>0\\). cost scalar total cost paths simulated. example, financial options samplers included package, calculated \\(NM^l\\), \\(N\\) number paths requested call user function mlmc_l, \\(M\\) refinement cost factor (\\(M=2\\) mcqmc06_l() \\(M=4\\) opre_l()), \\(l\\) level sampled. See function (source code ) opre_l() mcqmc06_l() package example user supplied level samplers. alpha weak error, \\(O(2^{-\\alpha l})\\). Must \\(> 0\\) specified. NA alpha estimated. beta variance, \\(O(2^{-\\beta l})\\). Must \\(> 0\\) specified. NA beta estimated. gamma sample cost, \\(O(2^{\\gamma l})\\). Must \\(> 0\\) specified. NA gamma estimated. parallel integer supplied, R fork parallel parallel processes compute level estimate parallel. ... additional arguments passed user supplied mlmc_l function called.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Multi-level Monte Carlo estimation — mlmc","text":"list containing: P MLMC estimate; Nl vector number samples performed level; Cl Per sample cost level.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Multi-level Monte Carlo estimation — mlmc","text":"Multilevel Monte Carlo Method method originated works Giles (2008) Heinrich (1998). Consider sequence \\(P_0, P_1, \\ldots\\), approximates \\(P_L\\) increasing accuracy, also increasing cost, simple identity $$E[P_L] = E[P_0] + \\sum_{l=1}^L E[P_l-P_{l-1}],$$ therefore can use following unbiased estimator \\(E[P_L]\\), $$N_0^{-1} \\sum_{n=1}^{N_0} P_0^{(0,n)} + \\sum_{l=1}^L \\left\\{ N_l^{-1} \\sum_{n=1}^{N_l} \\left(P_l^{(l,n)} - P_{l-1}^{(l,n)}\\right) \\right\\}$$ \\(N_l\\) samples produced level \\(l\\). inclusion level \\(l\\) superscript \\((l,n)\\) indicates samples used level correction independent. Set \\(C_0\\), \\(V_0\\) cost variance one sample \\(P_0\\), \\(C_l, V_l\\) cost variance one sample \\(P_l - P_{l-1}\\), overall cost variance multilevel estimator \\(\\sum_{l=0}^L N_l C_l\\) \\(\\sum_{l=0}^L N_l^{-1} V_l\\), respectively. idea behind method, provided product \\(V_l C_l\\) decreases \\(l\\), .e. cost increases level slower variance decreases, one can achieve significant computational savings, can formalised Theorem 1 Giles (2015). information multilevel Monte Carlo methods, see webpage https://people.maths.ox.ac.uk/gilesm/mlmc_community.html lists research groups working area, main publications. function based GPL-2 'Matlab' code Mike Giles.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Multi-level Monte Carlo estimation — mlmc","text":"Giles, M.B. (2008) 'Multilevel Monte Carlo Path Simulation', Operations Research, 56(3), pp. 607–617. Available : doi:10.1287/opre.1070.0496 . Giles, M.B. (2015) 'Multilevel Monte Carlo methods', Acta Numerica, 24, pp. 259–328. Available : doi:10.1017/S096249291500001X . Heinrich, S. (1998) 'Monte Carlo Complexity Global Solution Integral Equations', Journal Complexity, 14(2), pp. 151–175. Available : doi:10.1006/jcom.1998.0471 .","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Multi-level Monte Carlo estimation — mlmc","text":"Louis Aslett Mike Giles Tigran Nagapetyan ","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multi-level Monte Carlo estimation — mlmc","text":"","code":"mlmc(2, 6, 1000, 0.01, opre_l, option = 1) #> $P #> [1] 10.44813 #> #> $Nl #> [1] 4294178 357038 106626 22315 #> #> $Cl #> [1] 1 4 16 64 #> mlmc(2, 10, 1000, 0.01, mcqmc06_l, option = 1) #> $P #> [1] 10.43656 #> #> $Nl #> [1] 3018378 56809 28405 8180 3002 1100 378 146 #> #> $Cl #> [1] 1 2 4 8 16 32 64 128 #>"},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":null,"dir":"Reference","previous_headings":"","what":"Multi-level Monte Carlo estimation test suite — mlmc.test","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"Computes suite diagnostic values MLMC estimation problem.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"","code":"mlmc.test( mlmc_l, N, L, N0, eps.v, Lmin, Lmax, parallel = NA, silent = FALSE, ... )"},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"mlmc_l user supplied function provides estimate level \\(l\\). must take least two arguments, first level number simulated second number paths. Additional arguments can taken desired: additional ... arguments function forwarded user defined mlmc_l function. user supplied function return named list containing one element named sums second named cost, : sums vector length two \\(\\left(\\sum Y_i, \\sum Y_i^2\\right)\\) \\(Y_i\\) iid simulations expectation \\(E[P_0]\\) \\(l=0\\) expectation \\(E[P_l-P_{l-1}]\\) \\(l>0\\). cost scalar total cost paths simulated. example, financial options samplers included package, calculated \\(NM^l\\), \\(N\\) number paths requested call user function mlmc_l, \\(M\\) refinement cost factor (\\(M=2\\) mcqmc06_l() \\(M=4\\) opre_l()), \\(l\\) level sampled. See function (source code ) opre_l() mcqmc06_l() package example user supplied level samplers. N number samples use tests L number levels use tests N0 initial number samples used first 3 levels subsequent levels automatically added. Must \\(> 0\\). eps.v vector one target accuracies tests. Must \\(> 0\\). Lmin minimum level refinement. Must \\(\\ge 2\\). Lmax maximum level refinement. Must \\(\\ge\\) Lmin. parallel integer supplied, R fork parallel parallel processes. done convergence tests section splitting N samples evenly possible across cores sampling level. also done MLMC complexity tests passing parallel argument mlmc() driver targeting accuracy level eps. silent set TRUE supress running output (identical output can still printed printing return result) ... additional arguments passed user supplied mlmc_l function called","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"mlmc.test object contains computed diagnostic values. object can printed plotted (see plot.mlmc.test).","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"See one example level sampler functions (e.g. opre_l) example usage. function based GPL-2 'Matlab' code Mike Giles.","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"Louis Aslett Mike Giles Tigran Nagapetyan ","code":""},{"path":"https://mlmc.louisaslett.com/reference/mlmc.test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Multi-level Monte Carlo estimation test suite — mlmc.test","text":"","code":"if (FALSE) { # \\dontrun{ # Example calls with realistic arguments # Financial options using an Euler-Maruyama discretisation tst <- mlmc.test(opre_l, N = 2000000, L = 5, N0 = 1000, eps.v = c(0.005, 0.01, 0.02, 0.05, 0.1), Lmin = 2, Lmax = 6, option = 1) tst plot(tst) # Financial options using a Milstein discretisation tst <- mlmc.test(mcqmc06_l, N = 20000, L = 8, N0 = 200, eps.v = c(0.005, 0.01, 0.02, 0.05, 0.1), Lmin = 2, Lmax = 10, option = 1) tst plot(tst) } # } # Toy versions for CRAN tests tst <- mlmc.test(opre_l, N = 10000, L = 5, N0 = 1000, eps.v = c(0.025, 0.1), Lmin = 2, Lmax = 6, option = 1) #> #> ********************************************************** #> *** Convergence tests, kurtosis, telescoping sum check *** #> *** using N = 10000 samples *** #> ********************************************************** #> #> l ave(Pf-Pc) ave(Pf) var(Pf-Pc) var(Pf) kurtosis check cost #> --------------------------------------------------------------------------------------- #> 0 9.9864e+00 9.9864e+00 1.5806e+02 1.5806e+02 0.0000e+00 0.0000e+00 1.0000e+00 #> 1 2.3616e-01 1.0528e+01 4.6195e+00 2.0513e+02 2.0180e+01 3.5003e-01 4.0000e+00 #> 2 3.6916e-02 1.0709e+01 1.1293e+00 2.2145e+02 1.3114e+01 1.5936e-01 1.6000e+01 #> 3 3.7534e-03 1.0384e+01 2.6563e-01 2.1298e+02 6.6822e+00 3.6542e-01 6.4000e+01 #> 4 2.3320e-03 1.0483e+01 6.7543e-02 2.1957e+02 6.4185e+00 1.0816e-01 2.5600e+02 #> 5 1.5741e-03 1.0830e+01 1.8175e-02 2.2166e+02 5.8218e+00 3.8607e-01 1.0240e+03 #> #> ****************************************************** #> *** Linear regression estimates of MLMC parameters *** #> ****************************************************** #> #> alpha = 1.844283 (exponent for MLMC weak convergence) #> beta = 2.004277 (exponent for MLMC variance) #> gamma = 2.000000 (exponent for MLMC cost) #> #> ***************************** #> *** MLMC complexity tests *** #> ***************************** #> #> eps value mlmc_cost std_cost savings N_l #> ----------------------------------------------------------- #> 0.0250 1.0470e+01 1.370e+06 2.908e+07 21.22 685621 57426 13880 3639 #> 0.1000 1.0323e+01 6.383e+04 4.724e+05 7.40 35781 3013 1000 #> tst <- mlmc.test(mcqmc06_l, N = 10000, L = 8, N0 = 1000, eps.v = c(0.025, 0.1), Lmin = 2, Lmax = 10, option = 1) #> #> ********************************************************** #> *** Convergence tests, kurtosis, telescoping sum check *** #> *** using N = 10000 samples *** #> ********************************************************** #> #> l ave(Pf-Pc) ave(Pf) var(Pf-Pc) var(Pf) kurtosis check cost #> --------------------------------------------------------------------------------------- #> 0 9.9254e+00 9.9254e+00 1.9093e+02 1.9093e+02 0.0000e+00 0.0000e+00 1.0000e+00 #> 1 1.8237e-01 1.0161e+01 1.6474e-01 2.0577e+02 1.5619e+02 6.1665e-02 2.0000e+00 #> 2 1.0610e-01 1.0567e+01 4.3677e-02 2.1657e+02 2.4251e+01 3.4217e-01 4.0000e+00 #> 3 5.3915e-02 1.0397e+01 1.1391e-02 2.1350e+02 1.6232e+01 2.5413e-01 8.0000e+00 #> 4 2.8379e-02 1.0610e+01 3.1579e-03 2.2062e+02 1.6977e+01 2.0880e-01 1.6000e+01 #> 5 1.4092e-02 1.0527e+01 8.3114e-04 2.1503e+02 1.3656e+01 1.0984e-01 3.2000e+01 #> 6 6.9390e-03 1.0364e+01 2.0637e-04 2.1144e+02 1.0092e+01 1.9322e-01 6.4000e+01 #> 7 3.5004e-03 1.0411e+01 5.1394e-05 2.1552e+02 1.0496e+01 4.9106e-02 1.2800e+02 #> 8 1.7754e-03 1.0504e+01 1.3201e-05 2.1573e+02 8.9490e+00 1.0384e-01 2.5600e+02 #> #> ****************************************************** #> *** Linear regression estimates of MLMC parameters *** #> ****************************************************** #> #> alpha = 0.967513 (exponent for MLMC weak convergence) #> beta = 1.942754 (exponent for MLMC variance) #> gamma = 1.000000 (exponent for MLMC cost) #> #> ***************************** #> *** MLMC complexity tests *** #> ***************************** #> #> eps value mlmc_cost std_cost savings N_l #> ----------------------------------------------------------- #> 0.0250 1.0462e+01 5.305e+05 2.887e+07 54.42 471243 9357 3473 1309 468 158 57 #> 0.1000 1.0562e+01 3.641e+04 4.707e+05 12.93 29249 1000 1000 81 32 #>"},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":null,"dir":"Reference","previous_headings":"","what":"Financial options using an Euler-Maruyama discretisation — opre_l","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"Financial options based scalar geometric Brownian motion Heston models, similar Mike Giles' original 2008 Operations Research paper, Giles (2008), using Euler-Maruyama discretisation","code":""},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"","code":"opre_l(l, N, option)"},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"l level simulated. N number samples computed. option option type, 1 5. options : 1 = European call; 2 = Asian call; 3 = lookback call; 4 = digital call; 5 = Heston model.","code":""},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"function based GPL-2 'Matlab' code Mike Giles.","code":""},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"Giles, M.B. (2008) 'Multilevel Monte Carlo Path Simulation', Operations Research, 56(3), pp. 607–617. Available : doi:10.1287/opre.1070.0496 .","code":""},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"Louis Aslett Mike Giles Tigran Nagapetyan ","code":""},{"path":"https://mlmc.louisaslett.com/reference/opre_l.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Financial options using an Euler-Maruyama discretisation — opre_l","text":"","code":"if (FALSE) { # \\dontrun{ # These are similar to the MLMC tests for the original # 2008 Operations Research paper, using an Euler-Maruyama # discretisation with 4^l timesteps on level l. # # The differences are: # -- the plots do not have the extrapolation results # -- two plots are log_2 rather than log_4 # -- the new MLMC driver is a little different # -- switch to X_0=100 instead of X_0=1 N0 <- 1000 # initial samples on coarse levels Lmin <- 2 # minimum refinement level Lmax <- 6 # maximum refinement level test.res <- list() for(option in 1:5) { if(option == 1) { cat(\"\\n ---- Computing European call ---- \\n\") N <- 1000000 # samples for convergence tests L <- 5 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } else if(option == 2) { cat(\"\\n ---- Computing Asian call ---- \\n\") N <- 1000000 # samples for convergence tests L <- 5 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } else if(option == 3) { cat(\"\\n ---- Computing lookback call ---- \\n\") N <- 1000000 # samples for convergence tests L <- 5 # levels for convergence tests Eps <- c(0.01, 0.02, 0.05, 0.1, 0.2) } else if(option == 4) { cat(\"\\n ---- Computing digital call ---- \\n\") N <- 4000000 # samples for convergence tests L <- 5 # levels for convergence tests Eps <- c(0.02, 0.05, 0.1, 0.2, 0.5) } else if(option == 5) { cat(\"\\n ---- Computing Heston model ---- \\n\") N <- 2000000 # samples for convergence tests L <- 5 # levels for convergence tests Eps <- c(0.005, 0.01, 0.02, 0.05, 0.1) } test.res[[option]] <- mlmc.test(opre_l, N, L, N0, Eps, Lmin, Lmax, option = option) # print exact analytic value, based on S0=K T <- 1 r <- 0.05 sig <- 0.2 K <- 100 k <- 0.5*sig^2/r; d1 <- (r+0.5*sig^2)*T / (sig*sqrt(T)) d2 <- (r-0.5*sig^2)*T / (sig*sqrt(T)) if(option == 1) { val <- K*( pnorm(d1) - exp(-r*T)*pnorm(d2) ) } else if(option == 2) { val <- NA } else if(option == 3) { val <- K*( pnorm(d1) - pnorm(-d1)*k - exp(-r*T)*(pnorm(d2) - pnorm(d2)*k) ) } else if(option == 4) { val <- K*exp(-r*T)*pnorm(d2) } else if(option == 5) { val <- NA } if(is.na(val)) { cat(sprintf(\"\\n Exact value unknown, MLMC value: %f \\n\", test.res[[option]]$P[1])) } else { cat(sprintf(\"\\n Exact value: %f, MLMC value: %f \\n\", val, test.res[[option]]$P[1])) } # plot results plot(test.res[[option]]) } } # } # The level sampler can be called directly to retrieve the relevant level sums: opre_l(l = 7, N = 10, option = 1) #> $sums #> [1] 1.064477e-02 2.275113e-02 -6.541730e-04 1.403334e-04 1.485436e+02 #> [6] 4.556201e+03 #> #> $cost #> [1] 163840 #>"},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot an mlmc.test object — plot.mlmc.test","title":"Plot an mlmc.test object — plot.mlmc.test","text":"Produces diagnostic plots result mlmc.test function call.","code":""},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot an mlmc.test object — plot.mlmc.test","text":"","code":"# S3 method for class 'mlmc.test' plot(x, which = \"all\", cols = NA, ...)"},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot an mlmc.test object — plot.mlmc.test","text":"x mlmc.test object produced call mlmc.test function. vector strings specifying plots produce, \"\" diagnostic plots options : \"var\" = \\(\\log_2\\) variance level; \"mean\" = \\(\\log_2\\) absolute value mean level; \"consis\" = consistency level; \"kurt\" = kurtosis level; \"Nl\" = \\(\\log_2\\) number samples level; \"cost\" = \\(\\log_{10}\\) cost \\(\\log_{10}\\) epsilon (accuracy). cols number columns across plot override default value. ... additional arguments passed plotting functions.","code":""},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Plot an mlmc.test object — plot.mlmc.test","text":"plots produced relatively self-explanatory. However, consistency kurtosis plots particular may require background. highly recommended refer Section 3.3 Giles (2015), rationale diagnostic plots addressed full detail.","code":""},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Plot an mlmc.test object — plot.mlmc.test","text":"Giles, M.B. (2015) 'Multilevel Monte Carlo methods', Acta Numerica, 24, pp. 259–328. Available : doi:10.1017/S096249291500001X .","code":""},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Plot an mlmc.test object — plot.mlmc.test","text":"Louis Aslett ","code":""},{"path":"https://mlmc.louisaslett.com/reference/plot.mlmc.test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot an mlmc.test object — plot.mlmc.test","text":"","code":"if (FALSE) { # \\dontrun{ tst <- mlmc.test(opre_l, N = 2000000, L = 5, N0 = 1000, eps.v = c(0.005, 0.01, 0.02, 0.05, 0.1), Lmin = 2, Lmax = 6, option = 1) tst plot(tst) } # }"},{"path":"https://mlmc.louisaslett.com/news/index.html","id":"mlmc-201","dir":"Changelog","previous_headings":"","what":"mlmc 2.0.1","title":"mlmc 2.0.1","text":"Package removed CRAN didn’t notice old Oxford email address wasn’t forwarding longer. order comply CRAN changes, C++ routines now registered maintainer info updated Durham email. User level sampling functions must now also return total cost samples simulated level. Therefore user level sampler functions must return list sums cost element. gamma argument longer required, since used automatic cost computation, can estimated alpha beta. mlmc.test() longer takes M, level refinement factor, since used calculate cost N*M^l. Per comment, user now defines cost completely via return level sampler function. Along lines, mlmc.test() now uses user returned cost places: previously CPU time measured cost convergence tests section, whilst MLMC complexity tests previously forced costs N*M^l. () old bugs squashed Euler-Maruyama discretisation level sampler, opre_l() affected lookback call Heston model options. managed get hold Matlab license, now confirmed examples docs return (within sampling variability) results Euler-Maruyama Milstein discretisation example level sampler functions. now hex sticker! hopefully fairly self explanatory: many fast simulations done low levels (lots dice, hare running bottom stairs); fewer simulations done higher levels (fewer dice go step, tortoise fewest dice top step)! now documentation website https://mlmc.louisaslett.com/","code":""},{"path":"https://mlmc.louisaslett.com/news/index.html","id":"mlmc-100","dir":"Changelog","previous_headings":"","what":"mlmc 1.0.0","title":"mlmc 1.0.0","text":"CRAN release: 2016-04-24 Initial CRAN submission.","code":""}]
diff --git a/sitemap.xml b/sitemap.xml
index c66b7e3..864f041 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -2,6 +2,7 @@
https://mlmc.louisaslett.com/404.html
https://mlmc.louisaslett.com/authors.html
https://mlmc.louisaslett.com/index.html
+https://mlmc.louisaslett.com/news/index.html
https://mlmc.louisaslett.com/reference/index.html
https://mlmc.louisaslett.com/reference/mcqmc06_l.html
https://mlmc.louisaslett.com/reference/mlmc.html