* using log directory ‘/data/blackswan/ripley/R/packages/tests-devel/mlmc.Rcheck’ * using R Under development (unstable) (2025-11-17 r89032) * using platform: x86_64-pc-linux-gnu * R was compiled by gcc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3) GNU Fortran (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3) * running under: Fedora Linux 40 (Workstation Edition) * using session charset: UTF-8 * checking for file ‘mlmc/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘mlmc’ version ‘2.1.1’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘mlmc’ can be installed ... [23s/23s] OK * used C++ compiler: ‘g++ (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3)’ * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [14s/14s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking line endings in C/C++/Fortran sources/headers ... OK * checking compilation flags used ... OK * checking compiled code ... OK * checking examples ... [10s/11s] OK * checking examples with --run-donttest ... [30m/31m] ERROR Running examples in ‘mlmc-Ex.R’ failed The error most likely occurred in: > ### Name: opre_l > ### Title: Financial options using an Euler-Maruyama discretisation > ### Aliases: opre_l > > ### ** Examples > > ## No test: > # 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 > # > # Note the following takes quite a while to run, for a toy example see after > # this block. > > 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]]) + } ---- Computing European call ---- ********************************************************** *** Convergence tests, kurtosis, telescoping sum check *** *** using N = 1e+06 samples *** ********************************************************** l ave(Pf-Pc) ave(Pf) var(Pf-Pc) var(Pf) kurtosis check cost --------------------------------------------------------------------------------------- 0 1.0207e+01 1.0207e+01 1.6112e+02 1.6112e+02 0.0000e+00 0.0000e+00 1.0000e+00 1 2.1123e-01 1.0428e+01 4.4389e+00 2.0122e+02 1.9509e+01 1.1153e-01 4.0000e+00 2 2.6233e-02 1.0428e+01 1.0607e+00 2.1199e+02 1.1894e+01 2.9465e-01 1.6000e+01 3 6.3348e-03 1.0451e+01 2.7266e-01 2.1672e+02 7.6120e+00 1.8357e-01 6.4000e+01 4 1.4853e-03 1.0466e+01 6.9072e-02 2.1688e+02 6.2269e+00 1.4787e-01 2.5600e+02 5 3.1274e-04 1.0433e+01 1.7263e-02 2.1608e+02 5.9507e+00 3.7030e-01 1.0240e+03 ****************************************************** *** Linear regression estimates of MLMC parameters *** ****************************************************** alpha = 2.294186 (exponent for MLMC weak convergence) beta = 1.995350 (exponent for MLMC variance) gamma = 2.000000 (exponent for MLMC cost) ***************************** *** MLMC complexity tests *** ***************************** eps value mlmc_cost std_cost savings N_l ----------------------------------------------------------- 0.0050 1.0448e+01 3.384e+07 7.397e+08 21.86 17048544 1414930 346862 87253 0.0100 1.0456e+01 8.475e+06 1.849e+08 21.82 4267604 351013 86307 22221 0.0200 1.0458e+01 2.091e+06 4.623e+07 22.11 1060004 88326 21170 5304 0.0500 1.0420e+01 2.386e+05 1.809e+06 7.58 142062 12669 2869 0.1000 1.0225e+01 6.314e+04 4.522e+05 7.16 36092 2761 1000 Exact value: 10.450584, MLMC value: 10.447717 ---- Computing Asian call ---- ********************************************************** *** Convergence tests, kurtosis, telescoping sum check *** *** using N = 1e+06 samples *** ********************************************************** l ave(Pf-Pc) ave(Pf) var(Pf-Pc) var(Pf) kurtosis check cost --------------------------------------------------------------------------------------- 0 5.1054e+00 5.1054e+00 4.0287e+01 4.0287e+01 0.0000e+00 0.0000e+00 1.0000e+00 1 6.0636e-01 5.7114e+00 1.5895e+01 5.7746e+01 4.8911e+00 7.7865e-03 4.0000e+00 2 4.9226e-02 5.7610e+00 1.4232e+00 6.2183e+01 5.9200e+00 7.6687e-03 1.6000e+01 3 5.1203e-03 5.7586e+00 1.5289e-01 6.3052e+01 6.2321e+00 1.5465e-01 6.4000e+01 4 6.3810e-04 5.7656e+00 2.4925e-02 6.3541e+01 5.9447e+00 1.3351e-01 2.5600e+02 5 4.2087e-05 5.7615e+00 5.3806e-03 6.3483e+01 5.7044e+00 8.7447e-02 1.0240e+03 ****************************************************** *** Linear regression estimates of MLMC parameters *** ****************************************************** alpha = 3.389848 (exponent for MLMC weak convergence) beta = 2.889245 (exponent for MLMC variance) gamma = 2.000000 (exponent for MLMC cost) ***************************** *** MLMC complexity tests *** ***************************** eps value mlmc_cost std_cost savings N_l ----------------------------------------------------------- 0.0050 5.7553e+00 2.721e+07 2.152e+08 7.91 7645173 2400605 358762 65903 0.0100 5.7589e+00 6.808e+06 5.380e+07 7.90 1912840 601282 89715 16481 0.0200 5.7402e+00 1.234e+06 3.316e+06 2.69 412247 129588 18984 0.0500 5.7212e+00 2.009e+05 5.306e+05 2.64 67355 20682 3174 0.1000 5.9106e+00 5.298e+04 1.327e+05 2.50 16388 5148 1000 Exact value unknown, MLMC value: 5.755342 ---- Computing lookback call ---- ********************************************************** *** Convergence tests, kurtosis, telescoping sum check *** *** using N = 1e+06 samples *** ********************************************************** l ave(Pf-Pc) ave(Pf) var(Pf-Pc) var(Pf) kurtosis check cost --------------------------------------------------------------------------------------- 0 2.0634e+01 2.0634e+01 1.7508e+02 1.7508e+02 0.0000e+00 0.0000e+00 1.0000e+00 1 -2.5023e+00 1.8142e+01 1.4036e+01 1.9950e+02 4.4920e+00 1.1757e-01 4.0000e+00 2 -6.8731e-01 1.7443e+01 4.8877e+00 2.0897e+02 4.0035e+00 1.2777e-01 1.6000e+01 3 -1.7974e-01 1.7297e+01 1.4343e+00 2.1259e+02 3.7955e+00 3.6957e-01 6.4000e+01 4 -4.4990e-02 1.7235e+01 3.8773e-01 2.1279e+02 3.7198e+00 1.8922e-01 2.5600e+02 5 -1.1182e-02 1.7237e+01 1.0055e-01 2.1306e+02 3.7056e+00 1.4202e-01 1.0240e+03 ****************************************************** *** Linear regression estimates of MLMC parameters *** ****************************************************** alpha = 1.954509 (exponent for MLMC weak convergence) beta = 1.790609 (exponent for MLMC variance) gamma = 2.000000 (exponent for MLMC cost) ***************************** *** MLMC complexity tests *** ***************************** eps value mlmc_cost std_cost savings N_l ----------------------------------------------------------- 0.0100 1.7221e+01 4.788e+07 2.909e+09 60.76 10568514 1493764 442501 119800 31219 8393 0.0200 1.7220e+01 1.204e+07 7.272e+08 60.40 2653338 374639 110798 30094 7885 2120 0.0500 1.7219e+01 1.335e+06 2.905e+07 21.76 352402 49643 14679 4136 1112 0.1000 1.7301e+01 3.213e+05 7.263e+06 22.61 86974 12339 3567 962 259 0.2000 1.7541e+01 5.957e+04 4.535e+05 7.61 18054 2522 1000 241 Exact value: 17.216802, MLMC value: 17.221030 ---- Computing digital call ---- ********************************************************** *** Convergence tests, kurtosis, telescoping sum check *** *** using N = 4e+06 samples *** ********************************************************** l ave(Pf-Pc) ave(Pf) var(Pf-Pc) var(Pf) kurtosis check cost --------------------------------------------------------------------------------------- 0 5.6938e+01 5.6938e+01 2.1742e+03 2.1742e+03 0.0000e+00 0.0000e+00 1.0000e+00 1 -2.7911e+00 5.4154e+01 2.5771e+02 2.2186e+03 3.2110e+01 4.6500e-02 4.0000e+00 2 -6.9670e-01 5.3464e+01 1.6570e+02 2.2273e+03 5.4145e+01 4.2605e-02 1.6000e+01 3 -1.7001e-01 5.3255e+01 8.6394e+01 2.2297e+03 1.0463e+02 2.5361e-01 6.4000e+01 4 -4.0285e-02 5.3239e+01 4.3842e+01 2.2299e+03 2.0636e+02 1.6283e-01 2.5600e+02 * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * checking for new files in some other directories ... OK * DONE Status: 1 ERROR See ‘/data/blackswan/ripley/R/packages/tests-devel/mlmc.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 32:29.79, 1882.11 + 25.24