sim.outer {VarRedOpt}R Documentation

Main function for VarRedOpt simulation framework.

Description

This function creates the z matrix which is an input matrix with given dimension value, d, and given length, n. Values are generated from standard normal distribution. After creating the z matrix, this function sends this input matrix to given simulation function. After simulation steps are completed, simulate.outer function gets the final simulated values and calculates expected value and variance. For instance, if myq_asian and sim.AV functions are given in simulate.outer function as parameters, the input matrix will be sent to sim.AV function and sim.AV function will send input value to myq_asian function twice with opposite signs and gets simulation results. After collecting these results it applies Antithetic Variates algorithm and finds the final simulation value and sends it back to the simulate.outer function.

Usage

sim.outer(n, d, auto_repetition = 1, q.outer, ...)

Arguments

n

Simulation length.

d

Simulation dimension.

auto_repetition

Applies auto_repetition of auto_repetition = TRUE.

q.outer

Accepts the function name of the variance reduction / simulation algorithm.

...

ellipsis parameter. different parameters can be passed depending on the problem.

Value

estimation mean, standard error, confidence interval metrics if auto_repetition = TRUE

Examples

 sim.outer(n=1e3, d=3, q.outer = sim.AV,
q.av = myq_asian, K=100, ti=(1:3/12), r=0.03, sigma=0.3, S0=100)

[Package VarRedOpt version 0.1.0 Index]