initializeSim: Intialize a Simulation

View source: R/aasim_classes.r

initializeSimR Documentation

Intialize a Simulation

Description

Intialize a Simulation

Usage

initializeSim(
  description,
  nTrials,
  startValue,
  lengthType,
  length = 10,
  seed,
  defaultInflation = 0,
  ror,
  stdDev,
  targetValue = .Machine$double.eps,
  targetValueIsReal = TRUE,
  stockWt = 0.6,
  nConsecMonths = 12,
  retAdj = 0,
  minDate = min(sbi$Month),
  maxDate = max(sbi$Month),
  overrideInflation = TRUE,
  asOfDate = Sys.Date(),
  randReturnType = "S"
)

Arguments

description

Description of simulation

nTrials

number of trials

startValue

Starting dollar value

lengthType

'R' for random, or 'F' for fixed. If number of persons is 0, then F is assumed.

length

Length for fixed type of simulations in years

seed

Seed for random number generator

defaultInflation

Inflation rate in decimal

ror

Rate of Return in decimal

stdDev

Standard Deviation in decimal

targetValue

Dollar value used to determine if a trial is a success

targetValueIsReal

Logical to indicate if target value should be adjusted for inflation. Default is TRUE.

stockWt

The allocation to stocks, in decimal, used to generate historical random returns.

nConsecMonths

Number of consecutive months, 1, 2, 3, 4, 6, or 12 used to generate historical random returns.

retAdj

A value to add to each randomly generated annual historic return in decimal.

minDate

MinDate Earliest date to use when generating historical random returns.

maxDate

MaxDate Latest date to use when generating historical random returns.

overrideInflation

If TRUE, inflation inputs in cash flows will be overridden by the historical rates of inflation whenusing historical random returns.

asOfDate

Date to run the simulation as of. Used when calculating ages.

randReturnType

Either "S", the default, for statistical(random lognormal)or "H" for historical.

Value

List with values describing simulation

See Also

[calcRandHistReturns()], [simulateRandom()]

Examples

## Not run: initializeSim("Sim1 Test", nTrials=500, 1000000, lengthType="R",
length=0, seed=-101, defaultInflation=0, ror=0.10, stdDev=.08,
targetValue=.Machine$double.eps, targetValueIsReal=FALSE)
## End(Not run)

rexmacey/aasim documentation built on Sept. 18, 2024, 10:47 a.m.