Thursday, 5 September 2019

calculate amortization-R

 How to calculate amortization R

Loan= loan amount
n= the number of payments/periods
pmt= value of level payments
i= nominal interest rate convertible ic times per year
ic= interest conversion frequency per year
pf= the payment frequency- number of payments per year
t= the specified period for which the payment amount, interest paid, principal paid, and loan balance are solved for
library("FinancialMath", lib.loc="~/R/win-library/3.6")

> amort.period(Loan=100,n=5,i=.01,t=3)

Loan          100.00000
PMT            20.60398
Eff Rate        0.01000
Years           5.00000
At Time 3:      3.00000
Int Paid        0.60596
Princ Paid     19.99802
Balance        40.59798
> amort.period(n=5,pmt=30,i=.01,t=3,pf=12)


Loan         149.627429
PMT           30.000000
Eff Rate       0.010000
i^(12)         0.009954
Periods        5.000000
Years          0.416667
At Time 3:     3.000000
Int Paid       0.074535
Princ Paid    29.925465
Balance       59.925424
> amort.period(Loan=100,pmt=24,ic=1,i=.01,t=3)
Loan         100.000000
PMT           24.000000
Eff Rate       0.010000
Years          4.277206
At Time 3:     3.000000
Int Paid       0.537700
Princ Paid    23.462300
Balance       30.307700

Calculate Level Annuity

> annuity.level(pv=NA,fv=101.85,n=10,pmt=8,i=NA,ic=1,pf=1,imm=TRUE)
         Level Annuity
PV          61.0029569
FV         101.8500000
PMT          8.0000000
Eff Rate     0.0525943
Years       10.0000000
> annuity.level(pv=80,fv=NA,n=15,pf=2,pmt=NA,i=.01,imm=FALSE)
         Level Annuity
PV        80.000000000
FV        86.198615501
PMT        5.521069443
Eff Rate   0.010000000
i^(2)      0.009975124
Periods   15.000000000
Years      7.500000000

Calculate Arithmatic annuity

> annuity.arith(pv=NA,fv=NA,n=20,p=100,q=4,i=.03,ic=1,pf=2,imm=TRUE)
         Arithmetic Annuity
PV             2.338128e+03
FV             3.142248e+03
P              1.000000e+02
Q              4.000000e+00
Eff Rate       3.000000e-02
i^(2)          2.977831e-02
Periods        2.000000e+01
Years          1.000000e+01
         Arithmetic Annuity
PV             1.827106e+03
FV             3.000000e+03
P              1.000000e+02
Q              1.664438e+00
Eff Rate       5.083796e-02
i^(3)          5.000000e-02
i^(2)          5.020776e-02
Periods        2.000000e+01
Years          1.000000e+01

         Geometric Annuity

PV            9.669279e+01
FV            1.000000e+02
P             9.000000e+00
K             2.000000e-02
Eff Rate      1.682984e-03
i^(2)         1.682276e-03
i^(0.5)       1.684400e-03
Periods       1.000000e+01
Years         2.000000e+01
Geometric Annuity


         Geometric Perpetuity

PV                   1.00e+03
P                    5.00e+00
K                    3.48e-02
Eff Rate             4.00e-02

No comments:

Post a comment

Intersection of subring

How to prove the intersection of two subrings is a subring? Let S1 and S2  be two subrings of a ring R. Then S1∩S2 is not empty since ...