MCMultiVariateIntegration

class MCMultiVariateIntegration(function: FunctionMVIfc, sampler: MVRVariableIfc, antitheticOptionOn: Boolean = true) : MCExperiment

Provides for the integration of a multidimensional function via Monte-Carlo sampling. The user is responsible for providing a function that when evaluated at the sample from the provided sampler will evaluate to the desired integral over the range of possible values of the sampler.

The sampler must have the same range as the desired integral and the function's domain (inputs) must be consistent with the range (output) of the sampler. There is no checking if the user does not supply appropriate functions or samplers.

As an example, suppose we want the evaluation of the integral of g(x) over the range from a to b. If the user selects the sampler as U(a,b) then the function to supply for the integration is NOT g(x). The function should be h(x) = (b-a)*g(x).

In general, if the sampler has pdf, w(x), over the range a to b. Then, the function to supply for integration is h(x) = g(x)/w(x). Again, the user is responsible for providing a sampler that provides values over the interval of integration. And, the user is responsible for providing the appropriate function, h(x), that will result in their desired integral. This flexibility allows the user to specify h(x) in a factorization that supports an importance sampling distribution as the sampler.

See the detailed discussion for the class MCExperiment.

Parameters

function

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

sampler

the sampler over the interval, must not be null

antitheticOptionOn

true represents use of antithetic sampling

See also

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 sample size refers to the number of independent antithetic pairs observed. Thus, this will require two function evaluations at each observation. The user can consider the implication of the cost of function evaluation versus the variance reduction obtained.

Constructors

Link copied to clipboard
constructor(function: FunctionMVIfc, sampler: MVRVariableIfc, antitheticOptionOn: Boolean = true)

Properties

Link copied to clipboard
open override var confidenceLevel: Double

the desired confidence level

Link copied to clipboard
open override var desiredHWErrorBound: Double

the desired half-width bound for the experiment

Link copied to clipboard
open override var initialSampleSize: Int

the initial sample size for pilot simulation

Link copied to clipboard
Link copied to clipboard
open override var maxSampleSize: Long

the maximum number of samples permitted

Link copied to clipboard
open override var microRepSampleSize: Int

the number of micro replications to perform

Link copied to clipboard
open override var printInitialOption: Boolean

Indicates if initial results are printed

Link copied to clipboard
open override var resetStreamOption: Boolean

determines whether the reset stream option is on (true) or off (false)

Functions

Link copied to clipboard
open override fun checkStoppingCriteria(): Boolean
Link copied to clipboard
open override fun estimateSampleSize(): Double
Link copied to clipboard
open override fun estimateSampleSizeForRelativeError(relativeError: Double): Double

See page 513 of Law & Kelton

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 runInitialSample(printResultsOption: Boolean): Double

The purpose of the initial sample is to estimate the variability and determine an approximate number of additional samples needed to meet the desired absolute error. This method must ensure or assumes that no previous sampling has occurred. All statistical accumulators should be reset when this is executed.

Link copied to clipboard
fun runMacroReplications(numMacroReps: Int): Double

Runs numMacroReps macro replications of the micro replications. Does not check half-width or other stopping criteria. Uses the current setting of the number of micro replications per macro replication. Does not perform a pilot run to determine stopping criteria or number of samples to meet desired half-width. Requires 2 or more macro replications.

Link copied to clipboard
open override fun runSimulation(): Double
Link copied to clipboard
open override fun statistics(): Statistic
Link copied to clipboard
open override fun toString(): String