Produces diagnostic plots on the result of an mlmc.test
function call.
Usage
# S3 method for class 'mlmc.test'
plot(x, which = "all", cols = NA, ...)
Arguments
- x
an
mlmc.test
object as produced by a call to themlmc.test
function.- which
a vector of strings specifying which plots to produce, or
"all"
to do all diagnostic plots The options are:"var"
= \(\log_2\) of variance against level;"mean"
= \(\log_2\) of the absolute value of the mean against level;"consis"
= consistency against level;"kurt"
= kurtosis against level;"Nl"
= \(\log_2\) of number of samples against level;"cost"
= \(\log_{10}\) of cost against \(\log_{10}\) of epsilon (accuracy).
- cols
the number of columns across to plot to override the default value.
- ...
additional arguments which are passed on to plotting functions.
Details
Most of the plots produced are relatively self-explanatory. However, the consistency and kurtosis plots in particular may require some background. It is highly recommended to refer to Section 3.3 of Giles (2015), where the rationale for these diagnostic plots is addressed in full detail.
References
Giles, M.B. (2015) 'Multilevel Monte Carlo methods', Acta Numerica, 24, pp. 259–328. Available at: doi:10.1017/S096249291500001X .
Examples
# \donttest{
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)
#>
#> **********************************************************
#> *** Convergence tests, kurtosis, telescoping sum check ***
#> *** using N = 2e+06 samples ***
#> **********************************************************
#>
#> l ave(Pf-Pc) ave(Pf) var(Pf-Pc) var(Pf) kurtosis check cost
#> ---------------------------------------------------------------------------------------
#> 0 1.0202e+01 1.0202e+01 1.6129e+02 1.6129e+02 0.0000e+00 0.0000e+00 1.0000e+00
#> 1 2.1014e-01 1.0417e+01 4.4552e+00 2.0129e+02 1.9673e+01 8.0284e-02 4.0000e+00
#> 2 2.8422e-02 1.0428e+01 1.0613e+00 2.1264e+02 1.1720e+01 2.7044e-01 1.6000e+01
#> 3 5.9586e-03 1.0423e+01 2.7188e-01 2.1507e+02 7.5254e+00 1.7456e-01 6.4000e+01
#> 4 1.4902e-03 1.0437e+01 6.8853e-02 2.1588e+02 6.2866e+00 2.0275e-01 2.5600e+02
#> 5 3.2438e-04 1.0467e+01 1.7287e-02 2.1681e+02 5.9238e+00 4.6968e-01 1.0240e+03
#>
#> ******************************************************
#> *** Linear regression estimates of MLMC parameters ***
#> ******************************************************
#>
#> alpha = 2.293234 (exponent for MLMC weak convergence)
#> beta = 1.996557 (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.0445e+01 3.387e+07 7.341e+08 21.67 17049661 1419280 346601 87520
#> 0.0100 1.0451e+01 8.457e+06 1.835e+08 21.70 4262024 352482 86700 21841
#> 0.0200 1.0462e+01 2.141e+06 4.588e+07 21.43 1072807 89338 22072 5588
#> 0.0500 1.0496e+01 2.471e+05 1.815e+06 7.34 149418 12491 2983
#> 0.1000 1.0467e+01 6.762e+04 4.536e+05 6.71 38372 3313 1000
#>
tst
#>
#> **********************************************************
#> *** Convergence tests, kurtosis, telescoping sum check ***
#> *** using N = 2e+06 samples ***
#> **********************************************************
#>
#> l ave(Pf-Pc) ave(Pf) var(Pf-Pc) var(Pf) kurtosis check cost
#> ---------------------------------------------------------------------------------------
#> 0 1.0202e+01 1.0202e+01 1.6129e+02 1.6129e+02 0.0000e+00 0.0000e+00 1.0000e+00
#> 1 2.1014e-01 1.0417e+01 4.4552e+00 2.0129e+02 1.9673e+01 8.0284e-02 4.0000e+00
#> 2 2.8422e-02 1.0428e+01 1.0613e+00 2.1264e+02 1.1720e+01 2.7044e-01 1.6000e+01
#> 3 5.9586e-03 1.0423e+01 2.7188e-01 2.1507e+02 7.5254e+00 1.7456e-01 6.4000e+01
#> 4 1.4902e-03 1.0437e+01 6.8853e-02 2.1588e+02 6.2866e+00 2.0275e-01 2.5600e+02
#> 5 3.2438e-04 1.0467e+01 1.7287e-02 2.1681e+02 5.9238e+00 4.6968e-01 1.0240e+03
#>
#> ******************************************************
#> *** Linear regression estimates of MLMC parameters ***
#> ******************************************************
#>
#> alpha = 2.293234 (exponent for MLMC weak convergence)
#> beta = 1.996557 (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.0445e+01 3.387e+07 7.341e+08 21.67 17049661 1419280 346601 87520
#> 0.0100 1.0451e+01 8.457e+06 1.835e+08 21.70 4262024 352482 86700 21841
#> 0.0200 1.0462e+01 2.141e+06 4.588e+07 21.43 1072807 89338 22072 5588
#> 0.0500 1.0496e+01 2.471e+05 1.815e+06 7.34 149418 12491 2983
#> 0.1000 1.0467e+01 6.762e+04 4.536e+05 6.71 38372 3313 1000
#>
plot(tst)
# }