View source: R/aasim_classes.r
initializeSim | R Documentation |
Intialize a Simulation
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"
)
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. |
List with values describing simulation
[calcRandHistReturns()], [simulateRandom()]
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.