mlmc.test: Multi-level Monte Carlo estimation test suite

Description Usage Arguments Details Value Author(s) Examples

View source: R/mlmc.test.R

Description

Computes a suite of diagnostic values for an MLMC estimation problem.

Usage

1
2
mlmc.test(mlmc_l, M, N, L, N0, eps.v, Lmin, Lmax, parallel = NA,
  silent = FALSE, ...)

Arguments

mlmc_l

a user supplied function which provides the estimate for level l

M

refinement cost factor (2^γ in the general MLMC Throrem)

N

number of samples to use in the tests

L

number of levels to use in the tests

N0

initial number of samples which are used for the first 3 levels and for any subsequent levels which are automatically added. Must be > 0.

eps.v

a vector of all the target accuracies in the tests. Must all be > 0.

Lmin

the minimum level of refinement. Must be ≥ 2.

Lmax

the maximum level of refinement. Must be Lmin.

parallel

if an integer is supplied, R will fork parallel parallel processes an compute each level estimate in parallel.

silent

set to TRUE to supress running output (identical output can still be printed by printing the return result)

...

additional arguments which are passed on when the user supplied mlmc_l function is called

Details

See one of the example level sampler functions (e.g. opre_l) for example usage.

This function is based on GPL-2 'Matlab' code by Mike Giles.

Value

An mlmc.test object which contains all the computed diagnostic values. This object can be printed or plotted (see plot.mlmc.test).

Author(s)

Louis Aslett <[email protected]>

Mike Giles <[email protected]>

Tigran Nagapetyan <[email protected]>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
# Example calls with realistic arguments
tst <- mlmc.test(opre_l, M=4, 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)

tst <- mlmc.test(mcqmc06_l, M=2, 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)

## End(Not run)

# Toy versions for CRAN tests
tst <- mlmc.test(opre_l, M=4, N=10000,
                 L=5, N0=1000,
                 eps.v=c(0.025, 0.1),
                 Lmin=2, Lmax=6, option=1)

tst <- mlmc.test(mcqmc06_l, M=2, N=10000,
                 L=8, N0=1000,
                 eps.v=c(0.025, 0.1),
                 Lmin=2, Lmax=10, option=1)

louisaslett/mlmc documentation built on May 21, 2017, 2:39 p.m.