apaWealthSimulation(InitialWealth, CashFlowSchedule, RiskReturnSchedule, nSimulations, nTimeSteps, InvestmentHorizon, CashRateSchedule, ConfidenceLevel, nHistogramBins, Threshold, IsRecoveryAllowed, IsThresholdLowerBound, IsStochasticInvestments)
=apaWealthSimulation(InitialWealth, CashFlowSchedule, RiskReturnSchedule, nSimulations, nTimeSteps, InvestmentHorizon, CashRateSchedule, ConfidenceLevel, nHistogramBins, Threshold, IsRecoveryAllowed, IsThresholdLowerBound, IsStochasticInvestments)Result
Monte Carlo wealth simulation with cash flows and time-varying risk and return. Returns time, cash flows, shortfall probability, expected, median and confidence wealth, and a terminal wealth histogram.
Syntax
InitialWealth: initial wealth
CashFlowSchedule: m x 2 matrix of cash flows: time (in years) and amount. Positive amounts are inflows, negative amounts outflows.
RiskReturnSchedule: m x 3 matrix: time (in years), expected return and volatility of the investment strategy from that time on
nSimulations: number of simulations to perform
nTimeSteps: number of time steps of the simulation
InvestmentHorizon: investment horizon in years
CashRateSchedule: m x 2 matrix: time (in years) and cash rate from that time on
ConfidenceLevel: confidence level, e.g. 0.95.
nHistogramBins: number of bins of the terminal wealth histogram
Threshold: wealth shortfall threshold
IsRecoveryAllowed: TRUE if wealth can recover after falling below the threshold, FALSE if paths stop at the shortfall
IsThresholdLowerBound: TRUE if the threshold acts as a lower bound for wealth, FALSE otherwise
IsStochasticInvestments: TRUE for stochastic (risky) investment returns, FALSE for deterministic returns equal to the expected returns
Remarks
The simulation is performed using the following assumptions…
Cash flows are mapped to the time scale defined by nTimeSteps and InvestmentHorizon. Where necessary, a rounding is performed such that all cash flows are represented on the timeline.
Cash flows are assumed to occur at the beginning of the period and are compounded immediately.
Wealth is assumed to follow a normally distributed process for continuous returns with the drift rates and volatilities defined in RiskReturnSchedule.
All compounding is assumed to be continuous.
The parameters IsRecoveryAllowed and IsThresholdLowerBound have important implications for wealth at the end of the investment horizon and the calculation of shortfall probability.
