Created
May 3, 2012 18:18
-
-
Save andrewschoen/2587812 to your computer and use it in GitHub Desktop.
Revisions
-
andrewschoen revised this gist
May 3, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ def sliding_payment_fv(start_pmt=100, annual_pmt_increase=100, max_pmt=300, future_value = 0 pmt = start_pmt for year in range(years): yearly_increase = np.fv(interest_rate/12, 12, -pmt, -present_value) future_value += yearly_increase print "amount of contribution / month for year %s: %d" % (year+1, pmt) print "value for year %d %s" % (year+1, -
andrewschoen renamed this gist
May 3, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
andrewschoen revised this gist
May 3, 2012 . 2 changed files with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ import numpy as np import locale locale.setlocale(locale.LC_ALL, '') def sliding_payment_fv(start_pmt=100, annual_pmt_increase=100, max_pmt=300, File renamed without changes. -
andrewschoen created this gist
May 3, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ import numpy as np import locale locale.setlocale(locale.LC_ALL, '') def sliding_payment_fv(start_pmt=100, annual_pmt_increase=100, max_pmt=300, years=10, interest_rate=0.05, present_value=100): future_value = 0 pmt = start_pmt for year in range(years): yearly_increase = np.fv(interest_rate/12, 1*12, -pmt, -present_value) future_value += yearly_increase print "amount of contribution / month for year %s: %d" % (year+1, pmt) print "value for year %d %s" % (year+1, locale.currency(future_value, grouping=True)) if pmt < max_pmt: pmt += annual_pmt_increase if __name__ == "__main__": sliding_payment_fv() This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ $ python future_value.py amount of contribution / month for year 1: 100 value for year 1 $1,333.00 amount of contribution / month for year 2: 200 value for year 2 $3,893.89 amount of contribution / month for year 3: 300 value for year 3 $7,682.66 amount of contribution / month for year 4: 300 value for year 4 $11,471.43 amount of contribution / month for year 5: 300 value for year 5 $15,260.21 amount of contribution / month for year 6: 300 value for year 6 $19,048.98 amount of contribution / month for year 7: 300 value for year 7 $22,837.75 amount of contribution / month for year 8: 300 value for year 8 $26,626.53 amount of contribution / month for year 9: 300 value for year 9 $30,415.30 amount of contribution / month for year 10: 300 value for year 10 $34,204.07