MC1DIntegration

class MC1DIntegration(function: FunctionIfc, sampler: RVariableIfc, antitheticOption: Boolean = true) : MCExperiment(source)

Provides for the integration of a 1-D function via Monte-Carlo sampling.

The evaluation will automatically utilize antithetic sampling to reduce the variance of the estimates unless the user specifies not to do so. In the case of using antithetic sampling, the micro replication sample size refers to the number of independent antithetic pairs observed. Thus, this will require two function evaluations for each micro replication. The user can consider the implication of the cost of function evaluation versus the variance reduction obtained. The default confidence level has been set to 99 percent.

Let f(x) be the probability distribution for the random variable supplied by the sampler. Let g(x) be the function that needs to be integrated. Let h(x) be a factorization of g(x) such that g(x) = h(x)*f(x), that is h(x) = g(x)/f(x)

The interval of integration is defined based on the domain of f(x).

Parameters

function

the representation of h(x), must not be null

sampler

the sampler over the interval, must not be null

antitheticOption

true represents use of antithetic sampling

Constructors

Link copied to clipboard
constructor(function: FunctionIfc, sampler: RVariableIfc, antitheticOption: Boolean = true)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun replication(j: Int): Double

Runs the rth replication for a sequence of replications r = 1, 2, ... , getMicroRepSampleSize()

Link copied to clipboard
open override fun runSimulation(): Double