Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. Put equal amounts of that 15% into just three different mutual funds:
  2.  
  3. • A U.S. total stock market index fund
  4. • An international total stock market index fund
  5. • A U.S. total bond market index fund
  6.  
  7. Over time, the three funds will grow at different rates, so once per year
  8. you'll adjust their amounts so that they're again equal.
  9.  
  10. That's it.
  11.  
  12. Vanguard Total Stock Market Index, MUTF: VTSMX
  13. Vanguard Total International Stock Index Fund Investor Shares, MUTF: VGTSX
  14. Vanguard Total Bond Market Index Fund Investor Shares, MUTF: VBMFX
  15.  
  16. annual salary total contributions final investment
  17. rise (%) over 21 years value after 21 years
  18. 0 20,955 43,557
  19. 1 23,210 47,265
  20. 2 25,776 51,424
  21.  
  22. funds = {"VTSMX", "VGTSX", "VBMFX"};
  23.  
  24. {tsm, ism, tbm} = FinancialData[#, {"April 29, 1996", DateList[], "Month"}] & /@ funds;
  25. DateListPlot[{tsm, ism, tbm}, PlotLegends -> funds]
  26.  
  27. salary = 550;
  28. investment = salary*0.15;
  29. nmonths = Length[tsm] - 1;
  30. d = ConstantArray[investment/3, nmonths];
  31.  
  32. (* add in inflation if wanted *)
  33. inflation = 0.02;
  34. y = First /@ Partition[d, UpTo@12];
  35. iy = Array[y[[#]] (1 + inflation)^(# - 1) &, Length[y]];
  36. d = Take[Flatten[ConstantArray[#, 12] & /@ iy], nmonths];
  37.  
  38. DateListPlot[Transpose[{Rest[First /@ tsm], 3 d}],
  39. PlotLabel -> Row[{"Monthly contributions - Total contributed: ",
  40. Total[3 d]}], PlotRange -> {Automatic, {0, Automatic}},
  41. PlotMarkers -> {Automatic, 6}]
  42.  
  43. {tsm2, ism2, tbm2} = Ratios@# - 1 & /@ Map[Last, {tsm, ism, tbm}, {2}];
  44. d2 = 0;
  45. vals = Array[(d2 = (d[[#]] + d2/3) (tsm2[[#]] + ism2[[#]] + tbm2[[#]] + 3)) &, nmonths];
  46. DateListPlot[Transpose[{Rest[First /@ tsm], vals}], PlotMarkers -> {Automatic, 8},
  47. PlotLabel -> Row[{"Investment value over time - Final value: ", Last[vals]}]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement