Building a Future Value Calculator

I'm building a monte carlo simulator within R that incorporates a few variables:

  1. Starting value (say, $100k)
  2. Contributions/withdrawals at various years between n and n+30 (say, +10k per year for 10 years; then -30k for 20 years)
  3. Random stock return % (mean = 6%; std. dev = 15%)
  4. Random bond return % (mean = 1.5%; std. dev = 1.5%)
  5. Stock allocation through time (can be fixed or also fluctuate)

How would I do that? I've been able to get the random variables, but I'm not able to get them to combine on top of each other (i.e.: $100k * (1+ stock return year n) - withdrawals = ending value n; ending value n*(1 + stock return year n+1) - withdrawals n+1 = ending value n+1; ending value N+2 * (1+ stock return year n+3.... etc.)

Does anyone know of a way to do this?

I'd like to create a way to simulate the ending values for each simulation x 1,000 simulations for a financial planning Monte Carlo simulator.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.