Learn R Programming

mcsm (version 1.0)

dyadic: A dyadic antithetic improvement for a toy problem

Description

Using dyadic replicas of a uniform sample, when evaluating the mean of $h(x)=(cos(50*x) +sin(20*x))^2$, this function shows the corresponding improvement in variance. The parameter q is used to break the unit interval into $2^q$ blocks where a transform of the original uniform sample is duplicated.

Usage

dyadic(N = 10^4,q=4)

Arguments

N
final number of simulations
q
number of dyadic levels

Value

Produces a plot comparing the qth and (2q)th dyadic improvements with the original.

References

From Chapter 4 of EnteR Monte Carlo Statistical Methods

Examples

Run this code
dyadic(N=10^2,q=5)

Run the code above in your browser using DataLab