TVM solve for interest rate, revisited
|
05-13-2022, 10:34 PM
Post: #2
|
|||
|
|||
RE: TVM solve for interest rate, revisited
Example:
lua> n,pv,pmt,fv = 10,50,-30,100 lua> pmt/fv, -pmt/pv -0.3 0.6 Note that rate cannot be below -1 (otherwise, log1p(x) = NaN) Both rates are valid (exclusive) edges. lua> lo = loan_rate(n,pv,pmt,fv,-0.3) lua> hi = loan_rate(n,pv,pmt,fv, 0.6) lua> for i=1,4 do print(i, lo(), hi()) end 1 -0.28463423878569005 0.5821069833315318 2 -0.28443603391367706 0.5820382979602389 3 -0.28443599888025706 0.5820382968834661 4 -0.28443599888025595 0.5820382968834662 loan_rate() use Newton's method to solve NPMT=0, for x Both true rates are bound within its edges, as expected. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 7 Guest(s)