Skip to contents

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 the mlmc.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.

Value

No return value, called for side effects.

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 .

Author

Louis Aslett <louis.aslett@durham.ac.uk>

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.0199e+01  1.0199e+01  1.6089e+02  1.6089e+02  0.0000e+00  0.0000e+00  1.0000e+00 
#>  1   2.0746e-01  1.0403e+01  4.4448e+00  2.0078e+02  1.9899e+01  5.5811e-02  4.0000e+00 
#>  2   2.9638e-02  1.0433e+01  1.0627e+00  2.1254e+02  1.2099e+01  7.8670e-03  1.6000e+01 
#>  3   5.5601e-03  1.0424e+01  2.7202e-01  2.1487e+02  7.4630e+00  2.2499e-01  6.4000e+01 
#>  4   1.2735e-03  1.0434e+01  6.8866e-02  2.1629e+02  6.2753e+00  1.3990e-01  2.5600e+02 
#>  5   4.3712e-04  1.0471e+01  1.7275e-02  2.1673e+02  5.9212e+00  5.7427e-01  1.0240e+03 
#> 
#> ******************************************************
#> *** Linear regression estimates of MLMC parameters ***
#> ******************************************************
#> 
#>  alpha = 2.232166  (exponent for MLMC weak convergence)
#>  beta  = 1.996237  (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.0451e+01  4.621e+07  2.953e+09    63.90  19931030   1650675    405130    102836     25843
#> 0.0100  1.0447e+01  8.422e+06  1.834e+08    21.77   4252711    351640     86157     21635
#> 0.0200  1.0431e+01  2.130e+06  4.584e+07    21.52   1068631     89774     21647      5566
#> 0.0500  1.0459e+01  2.405e+05  1.814e+06     7.54    142383     12790      2937
#> 0.1000  1.0505e+01  6.535e+04  4.534e+05     6.94     36775      3144      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.0199e+01  1.0199e+01  1.6089e+02  1.6089e+02  0.0000e+00  0.0000e+00  1.0000e+00 
#>  1   2.0746e-01  1.0403e+01  4.4448e+00  2.0078e+02  1.9899e+01  5.5811e-02  4.0000e+00 
#>  2   2.9638e-02  1.0433e+01  1.0627e+00  2.1254e+02  1.2099e+01  7.8670e-03  1.6000e+01 
#>  3   5.5601e-03  1.0424e+01  2.7202e-01  2.1487e+02  7.4630e+00  2.2499e-01  6.4000e+01 
#>  4   1.2735e-03  1.0434e+01  6.8866e-02  2.1629e+02  6.2753e+00  1.3990e-01  2.5600e+02 
#>  5   4.3712e-04  1.0471e+01  1.7275e-02  2.1673e+02  5.9212e+00  5.7427e-01  1.0240e+03 
#> 
#> ******************************************************
#> *** Linear regression estimates of MLMC parameters ***
#> ******************************************************
#> 
#>  alpha = 2.232166  (exponent for MLMC weak convergence)
#>  beta  = 1.996237  (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.0451e+01  4.621e+07  2.953e+09    63.90  19931030   1650675    405130    102836     25843
#> 0.0100  1.0447e+01  8.422e+06  1.834e+08    21.77   4252711    351640     86157     21635
#> 0.0200  1.0431e+01  2.130e+06  4.584e+07    21.52   1068631     89774     21647      5566
#> 0.0500  1.0459e+01  2.405e+05  1.814e+06     7.54    142383     12790      2937
#> 0.1000  1.0505e+01  6.535e+04  4.534e+05     6.94     36775      3144      1000
#> 
plot(tst)

# }