# RepaymentPlan: Calculation of Repayment Schedule under Mortgage Plan or... In RepaymentPlan: Calculation of Mortgage Plan or Repayment Plan

## Description

The function RepaymentPlan() calculates repayment schedules for various mortgage plans.

## Usage

 `1` ```RepaymentPlan(L, r, n, Last_year_due) ```

## Arguments

 `L` Loan amount in the money terms. It could be dollar or any other unit of currency. `r` Rate of interest charges on loan amount annually in fraction. If instead of providing 'n' in years, it is provided in months then divide the rate by 12 or if 'n' is provied in quarters, then divide the rate by 4 `n` No. of years in repayment plan or loan tenure.The loan tenure can also be provided in number of months and quarters but then one should not forget to adjust the rate of interest from annual to monthly or quarterly as needed. `Last_year_due` Amount Reserved for repayment in last year in case of only for partial repayment plan. Higher the value of this amount, greater is the cost of interest component in partial repayment plan. In case this argument is equal to principal sum then answer would be same as that of stragith end repayment plan

## Details

This function will provide four repayment plans detailed in the research paper of Vani et. al.,2018. According to Reddy et al.,2004, there are mainly four types of repayment plans for mortgage loan. These are straight end repayment plan, partial or balloon repayment plan, amortized decreasing repayment plan and amortized even repayment plan. In case of crop loans which are repaid within a year, straight end repayment plan is preferred. This is an interest only repayment plan where borrower pays no part of principal for any of the year in loan tenure except for the last year. However, interest is paid for all the years in loan tenure.

In case of loan taken for orchard development or machinary loans, partial repayment plan is preferred. In this plan, borrower commits to pay a specified sum of money towards principal in the last year of loan tenure. In rest of the years, the principal component remains fixed and the interest is charged on the balance.Thus, installment varies over the loan tenure.

For machinary loans, amortized decreasing repayment plan is also used. Amortized even repayment plan is the most popular one which is used for working out EMI or equated monthly installment. In this plan, installment remains constant unlike other plans. This is also used for loans related to livestock, construction work, land development and diggin of wells.

This function returns all the five repayment plans along with the summary of all the plans by calculating the total principal, interest and installment amount for each plan. Additionally this function also plots the barplot of interest amount in each repayment plan.

## Value

 `Partial.Repayment.Plan` Repayment Schedule under Partial Repayment plan `Amortized.Decreasing.Repayment.Plan` Repayment Schedule under Amortized Decreasing Repayment plan `Amortized.Even.Repayment.Plan` Repayment Schedule under Amortized Even Repayment plan `Straight.End.Repayment.Plan` Repayment Schedule underStraight End Repayment Plan `Summary.of.all.repayment.plans` This table provides the summary of all repayment plans by calculating the sum of principal, interest and installment in each repayment plan

## References

Vani, G. K., Awasthi, P. K., & Sahu, R. M. (2018). Generalized Mathematical Expressions for Various Repayment Plans and Long Term Cost Comparison. Economic Affairs, 63(3), 761-768.<doi:10.30954/0424-2513.3.2018.23>

Reddy, S. S., Ram, P. R., & Sastry, T. V. N. Devi. I. B (2009). Agricultural Economics. Oxford & IBH Publishing Co. PVT. Ltd. New Delhi <ISBN 10: 8120415965 ISBN 13: 9788120415966>.

## Examples

 ```1 2 3 4 5``` ```RepaymentPlan(L=100,r=0.12,n=10,Last_year_due=10) RepaymentPlan(2000,0.06,7,2000)# Last_year_due is set equal to principal sum RepaymentPlan(2000,0.06/4,7*4,200)# Adjustment for quarterly calculation RepaymentPlan(2000,0.06/12,7*12,200)# Adjustment for monthly calculation RepaymentPlan(2000,0.06/2,7*2,200)# Adjustment for harlf yearly calculation ```

### Example output

```\$Partial.Repayment.Plan
Year Principal Interest Installment Balance
1     1        10       12          22      90
2     2        10       11          21      80
3     3        10       10          20      70
4     4        10        8          18      60
5     5        10        7          17      50
6     6        10        6          16      40
7     7        10        5          15      30
8     8        10        4          14      20
9     9        10        2          12      10
10   10        10        1          11       0

\$Amortized.Decreasing.Repayment.Plan
Year Principal Interest Installment Balance
1     1        10       12          22      90
2     2        10       11          21      80
3     3        10       10          20      70
4     4        10        8          18      60
5     5        10        7          17      50
6     6        10        6          16      40
7     7        10        5          15      30
8     8        10        4          14      20
9     9        10        2          12      10
10   10        10        1          11       0

\$Amortized.Even.Repayment.Plan
Year Principal Interest Installment Balance
1     1         6       12          18      94
2     2         6       11          18      88
3     3         7       11          18      81
4     4         8       10          18      73
5     5         9        9          18      64
6     6        10        8          18      54
7     7        11        6          18      43
8     8        13        5          18      30
9     9        14        4          18      16
10   10        16        2          18       0

\$Straight.End.Repayment.Plan
Year Principal Interest Installment Balance
1     1         0       12          12     100
2     2         0       12          12     100
3     3         0       12          12     100
4     4         0       12          12     100
5     5         0       12          12     100
6     6         0       12          12     100
7     7         0       12          12     100
8     8         0       12          12     100
9     9         0       12          12     100
10   10       100       12         112       0

\$Summary.of.all.repayment.plans
Principal Interest Installment
Partial Repayment Plan                    100       66         166
Amortized Decreasing Repayment Plan       100       66         166
Amortized Even Repayment Plan             100       77         177
Straight End Repayment Plan               100      120         220

\$Partial.Repayment.Plan
Year Principal Interest Installment Balance
1    1         0      120         120    2000
2    2         0      120         120    2000
3    3         0      120         120    2000
4    4         0      120         120    2000
5    5         0      120         120    2000
6    6         0      120         120    2000
7    7      2000      120        2120       0

\$Amortized.Decreasing.Repayment.Plan
Year Principal Interest Installment Balance
1    1       286      120         406    1714
2    2       286      103         389    1429
3    3       286       86         371    1143
4    4       286       69         354     857
5    5       286       51         337     571
6    6       286       34         320     286
7    7       286       17         303       0

\$Amortized.Even.Repayment.Plan
Year Principal Interest Installment Balance
1    1       238      120         358    1762
2    2       253      106         358    1509
3    3       268       91         358    1241
4    4       284       74         358     958
5    5       301       57         358     657
6    6       319       39         358     338
7    7       338       20         358       0

\$Straight.End.Repayment.Plan
Year Principal Interest Installment Balance
1    1         0      120         120    2000
2    2         0      120         120    2000
3    3         0      120         120    2000
4    4         0      120         120    2000
5    5         0      120         120    2000
6    6         0      120         120    2000
7    7      2000      120        2120       0

\$Summary.of.all.repayment.plans
Principal Interest Installment
Partial Repayment Plan                   2000      840        2840
Amortized Decreasing Repayment Plan      2000      480        2480
Amortized Even Repayment Plan            2000      508        2508
Straight End Repayment Plan              2000      840        2840

\$Partial.Repayment.Plan
Year Principal Interest Installment Balance
1     1        67       30          97    1933
2     2        67       29          96    1867
3     3        67       28          95    1800
4     4        67       27          94    1733
5     5        67       26          93    1667
6     6        67       25          92    1600
7     7        67       24          91    1533
8     8        67       23          90    1467
9     9        67       22          89    1400
10   10        67       21          88    1333
11   11        67       20          87    1267
12   12        67       19          86    1200
13   13        67       18          85    1133
14   14        67       17          84    1067
15   15        67       16          83    1000
16   16        67       15          82     933
17   17        67       14          81     867
18   18        67       13          80     800
19   19        67       12          79     733
20   20        67       11          78     667
21   21        67       10          77     600
22   22        67        9          76     533
23   23        67        8          75     467
24   24        67        7          74     400
25   25        67        6          73     333
26   26        67        5          72     267
27   27        67        4          71     200
28   28       200        3         203       0

\$Amortized.Decreasing.Repayment.Plan
Year Principal Interest Installment Balance
1     1        71       30         101    1929
2     2        71       29         100    1857
3     3        71       28          99    1786
4     4        71       27          98    1714
5     5        71       26          97    1643
6     6        71       25          96    1571
7     7        71       24          95    1500
8     8        71       22          94    1429
9     9        71       21          93    1357
10   10        71       20          92    1286
11   11        71       19          91    1214
12   12        71       18          90    1143
13   13        71       17          89    1071
14   14        71       16          88    1000
15   15        71       15          86     929
16   16        71       14          85     857
17   17        71       13          84     786
18   18        71       12          83     714
19   19        71       11          82     643
20   20        71       10          81     571
21   21        71        9          80     500
22   22        71        8          79     429
23   23        71        6          78     357
24   24        71        5          77     286
25   25        71        4          76     214
26   26        71        3          75     143
27   27        71        2          74      71
28   28        71        1          72       0

\$Amortized.Even.Repayment.Plan
Year Principal Interest Installment Balance
1     1        58       30          88    1942
2     2        59       29          88    1883
3     3        60       28          88    1823
4     4        61       27          88    1763
5     5        62       26          88    1701
6     6        62       26          88    1639
7     7        63       25          88    1575
8     8        64       24          88    1511
9     9        65       23          88    1446
10   10        66       22          88    1379
11   11        67       21          88    1312
12   12        68       20          88    1244
13   13        69       19          88    1174
14   14        70       18          88    1104
15   15        71       17          88    1032
16   16        73       15          88     960
17   17        74       14          88     886
18   18        75       13          88     812
19   19        76       12          88     736
20   20        77       11          88     659
21   21        78       10          88     581
22   22        79        9          88     501
23   23        80        8          88     421
24   24        82        6          88     339
25   25        83        5          88     256
26   26        84        4          88     172
27   27        85        3          88      87
28   28        87        1          88       0

\$Straight.End.Repayment.Plan
Year Principal Interest Installment Balance
1     1         0       30          30    2000
2     2         0       30          30    2000
3     3         0       30          30    2000
4     4         0       30          30    2000
5     5         0       30          30    2000
6     6         0       30          30    2000
7     7         0       30          30    2000
8     8         0       30          30    2000
9     9         0       30          30    2000
10   10         0       30          30    2000
11   11         0       30          30    2000
12   12         0       30          30    2000
13   13         0       30          30    2000
14   14         0       30          30    2000
15   15         0       30          30    2000
16   16         0       30          30    2000
17   17         0       30          30    2000
18   18         0       30          30    2000
19   19         0       30          30    2000
20   20         0       30          30    2000
21   21         0       30          30    2000
22   22         0       30          30    2000
23   23         0       30          30    2000
24   24         0       30          30    2000
25   25         0       30          30    2000
26   26         0       30          30    2000
27   27         0       30          30    2000
28   28      2000       30        2030       0

\$Summary.of.all.repayment.plans
Principal Interest Installment
Partial Repayment Plan                   2000      462        2462
Amortized Decreasing Repayment Plan      2000      435        2435
Amortized Even Repayment Plan            2000      464        2464
Straight End Repayment Plan              2000      840        2840

\$Partial.Repayment.Plan
Year Principal Interest Installment Balance
1     1        22       10          32    1978
2     2        22       10          32    1957
3     3        22       10          31    1935
4     4        22       10          31    1913
5     5        22       10          31    1892
6     6        22        9          31    1870
7     7        22        9          31    1848
8     8        22        9          31    1827
9     9        22        9          31    1805
10   10        22        9          31    1783
11   11        22        9          31    1761
12   12        22        9          30    1740
13   13        22        9          30    1718
14   14        22        9          30    1696
15   15        22        8          30    1675
16   16        22        8          30    1653
17   17        22        8          30    1631
18   18        22        8          30    1610
19   19        22        8          30    1588
20   20        22        8          30    1566
21   21        22        8          30    1545
22   22        22        8          29    1523
23   23        22        8          29    1501
24   24        22        8          29    1480
25   25        22        7          29    1458
26   26        22        7          29    1436
27   27        22        7          29    1414
28   28        22        7          29    1393
29   29        22        7          29    1371
30   30        22        7          29    1349
31   31        22        7          28    1328
32   32        22        7          28    1306
33   33        22        7          28    1284
34   34        22        6          28    1263
35   35        22        6          28    1241
36   36        22        6          28    1219
37   37        22        6          28    1198
38   38        22        6          28    1176
39   39        22        6          28    1154
40   40        22        6          27    1133
41   41        22        6          27    1111
42   42        22        6          27    1089
43   43        22        5          27    1067
44   44        22        5          27    1046
45   45        22        5          27    1024
46   46        22        5          27    1002
47   47        22        5          27     981
48   48        22        5          27     959
49   49        22        5          26     937
50   50        22        5          26     916
51   51        22        5          26     894
52   52        22        4          26     872
53   53        22        4          26     851
54   54        22        4          26     829
55   55        22        4          26     807
56   56        22        4          26     786
57   57        22        4          26     764
58   58        22        4          26     742
59   59        22        4          25     720
60   60        22        4          25     699
61   61        22        3          25     677
62   62        22        3          25     655
63   63        22        3          25     634
64   64        22        3          25     612
65   65        22        3          25     590
66   66        22        3          25     569
67   67        22        3          25     547
68   68        22        3          24     525
69   69        22        3          24     504
70   70        22        3          24     482
71   71        22        2          24     460
72   72        22        2          24     439
73   73        22        2          24     417
74   74        22        2          24     395
75   75        22        2          24     373
76   76        22        2          24     352
77   77        22        2          23     330
78   78        22        2          23     308
79   79        22        2          23     287
80   80        22        1          23     265
81   81        22        1          23     243
82   82        22        1          23     222
83   83        22        1          23     200
84   84       200        1         201       0

\$Amortized.Decreasing.Repayment.Plan
Year Principal Interest Installment Balance
1     1        24       10          34    1976
2     2        24       10          34    1952
3     3        24       10          34    1929
4     4        24       10          33    1905
5     5        24       10          33    1881
6     6        24        9          33    1857
7     7        24        9          33    1833
8     8        24        9          33    1810
9     9        24        9          33    1786
10   10        24        9          33    1762
11   11        24        9          33    1738
12   12        24        9          32    1714
13   13        24        9          32    1690
14   14        24        8          32    1667
15   15        24        8          32    1643
16   16        24        8          32    1619
17   17        24        8          32    1595
18   18        24        8          32    1571
19   19        24        8          32    1548
20   20        24        8          32    1524
21   21        24        8          31    1500
22   22        24        8          31    1476
23   23        24        7          31    1452
24   24        24        7          31    1429
25   25        24        7          31    1405
26   26        24        7          31    1381
27   27        24        7          31    1357
28   28        24        7          31    1333
29   29        24        7          30    1310
30   30        24        7          30    1286
31   31        24        6          30    1262
32   32        24        6          30    1238
33   33        24        6          30    1214
34   34        24        6          30    1190
35   35        24        6          30    1167
36   36        24        6          30    1143
37   37        24        6          30    1119
38   38        24        6          29    1095
39   39        24        5          29    1071
40   40        24        5          29    1048
41   41        24        5          29    1024
42   42        24        5          29    1000
43   43        24        5          29     976
44   44        24        5          29     952
45   45        24        5          29     929
46   46        24        5          28     905
47   47        24        5          28     881
48   48        24        4          28     857
49   49        24        4          28     833
50   50        24        4          28     810
51   51        24        4          28     786
52   52        24        4          28     762
53   53        24        4          28     738
54   54        24        4          28     714
55   55        24        4          27     690
56   56        24        3          27     667
57   57        24        3          27     643
58   58        24        3          27     619
59   59        24        3          27     595
60   60        24        3          27     571
61   61        24        3          27     548
62   62        24        3          27     524
63   63        24        3          26     500
64   64        24        2          26     476
65   65        24        2          26     452
66   66        24        2          26     429
67   67        24        2          26     405
68   68        24        2          26     381
69   69        24        2          26     357
70   70        24        2          26     333
71   71        24        2          25     310
72   72        24        2          25     286
73   73        24        1          25     262
74   74        24        1          25     238
75   75        24        1          25     214
76   76        24        1          25     190
77   77        24        1          25     167
78   78        24        1          25     143
79   79        24        1          25     119
80   80        24        1          24      95
81   81        24        0          24      71
82   82        24        0          24      48
83   83        24        0          24      24
84   84        24        0          24       0

\$Amortized.Even.Repayment.Plan
Year Principal Interest Installment Balance
1     1        19       10          29    1981
2     2        19       10          29    1961
3     3        19       10          29    1942
4     4        20       10          29    1923
5     5        20       10          29    1903
6     6        20       10          29    1883
7     7        20        9          29    1863
8     8        20        9          29    1844
9     9        20        9          29    1824
10   10        20        9          29    1803
11   11        20        9          29    1783
12   12        20        9          29    1763
13   13        20        9          29    1743
14   14        21        9          29    1722
15   15        21        9          29    1701
16   16        21        9          29    1681
17   17        21        8          29    1660
18   18        21        8          29    1639
19   19        21        8          29    1618
20   20        21        8          29    1597
21   21        21        8          29    1576
22   22        21        8          29    1554
23   23        21        8          29    1533
24   24        22        8          29    1511
25   25        22        8          29    1490
26   26        22        7          29    1468
27   27        22        7          29    1446
28   28        22        7          29    1424
29   29        22        7          29    1402
30   30        22        7          29    1380
31   31        22        7          29    1357
32   32        22        7          29    1335
33   33        23        7          29    1312
34   34        23        7          29    1290
35   35        23        6          29    1267
36   36        23        6          29    1244
37   37        23        6          29    1221
38   38        23        6          29    1198
39   39        23        6          29    1175
40   40        23        6          29    1151
41   41        23        6          29    1128
42   42        24        6          29    1104
43   43        24        6          29    1081
44   44        24        5          29    1057
45   45        24        5          29    1033
46   46        24        5          29    1009
47   47        24        5          29     985
48   48        24        5          29     960
49   49        24        5          29     936
50   50        25        5          29     911
51   51        25        5          29     887
52   52        25        4          29     862
53   53        25        4          29     837
54   54        25        4          29     812
55   55        25        4          29     787
56   56        25        4          29     762
57   57        25        4          29     736
58   58        26        4          29     711
59   59        26        4          29     685
60   60        26        3          29     659
61   61        26        3          29     633
62   62        26        3          29     607
63   63        26        3          29     581
64   64        26        3          29     555
65   65        26        3          29     528
66   66        27        3          29     502
67   67        27        3          29     475
68   68        27        2          29     448
69   69        27        2          29     421
70   70        27        2          29     394
71   71        27        2          29     367
72   72        27        2          29     339
73   73        28        2          29     312
74   74        28        2          29     284
75   75        28        1          29     256
76   76        28        1          29     229
77   77        28        1          29     200
78   78        28        1          29     172
79   79        28        1          29     144
80   80        28        1          29     115
81   81        29        1          29      87
82   82        29        0          29      58
83   83        29        0          29      29
84   84        29        0          29       0

\$Straight.End.Repayment.Plan
Year Principal Interest Installment Balance
1     1         0       10          10    2000
2     2         0       10          10    2000
3     3         0       10          10    2000
4     4         0       10          10    2000
5     5         0       10          10    2000
6     6         0       10          10    2000
7     7         0       10          10    2000
8     8         0       10          10    2000
9     9         0       10          10    2000
10   10         0       10          10    2000
11   11         0       10          10    2000
12   12         0       10          10    2000
13   13         0       10          10    2000
14   14         0       10          10    2000
15   15         0       10          10    2000
16   16         0       10          10    2000
17   17         0       10          10    2000
18   18         0       10          10    2000
19   19         0       10          10    2000
20   20         0       10          10    2000
21   21         0       10          10    2000
22   22         0       10          10    2000
23   23         0       10          10    2000
24   24         0       10          10    2000
25   25         0       10          10    2000
26   26         0       10          10    2000
27   27         0       10          10    2000
28   28         0       10          10    2000
29   29         0       10          10    2000
30   30         0       10          10    2000
31   31         0       10          10    2000
32   32         0       10          10    2000
33   33         0       10          10    2000
34   34         0       10          10    2000
35   35         0       10          10    2000
36   36         0       10          10    2000
37   37         0       10          10    2000
38   38         0       10          10    2000
39   39         0       10          10    2000
40   40         0       10          10    2000
41   41         0       10          10    2000
42   42         0       10          10    2000
43   43         0       10          10    2000
44   44         0       10          10    2000
45   45         0       10          10    2000
46   46         0       10          10    2000
47   47         0       10          10    2000
48   48         0       10          10    2000
49   49         0       10          10    2000
50   50         0       10          10    2000
51   51         0       10          10    2000
52   52         0       10          10    2000
53   53         0       10          10    2000
54   54         0       10          10    2000
55   55         0       10          10    2000
56   56         0       10          10    2000
57   57         0       10          10    2000
58   58         0       10          10    2000
59   59         0       10          10    2000
60   60         0       10          10    2000
61   61         0       10          10    2000
62   62         0       10          10    2000
63   63         0       10          10    2000
64   64         0       10          10    2000
65   65         0       10          10    2000
66   66         0       10          10    2000
67   67         0       10          10    2000
68   68         0       10          10    2000
69   69         0       10          10    2000
70   70         0       10          10    2000
71   71         0       10          10    2000
72   72         0       10          10    2000
73   73         0       10          10    2000
74   74         0       10          10    2000
75   75         0       10          10    2000
76   76         0       10          10    2000
77   77         0       10          10    2000
78   78         0       10          10    2000
79   79         0       10          10    2000
80   80         0       10          10    2000
81   81         0       10          10    2000
82   82         0       10          10    2000
83   83         0       10          10    2000
84   84      2000       10        2010       0

\$Summary.of.all.repayment.plans
Principal Interest Installment
Partial Repayment Plan                   2000      462        2462
Amortized Decreasing Repayment Plan      2000      425        2425
Amortized Even Repayment Plan            2000      454        2454
Straight End Repayment Plan              2000      840        2840

\$Partial.Repayment.Plan
Year Principal Interest Installment Balance
1     1       138       60         198    1862
2     2       138       56         194    1723
3     3       138       52         190    1585
4     4       138       48         186    1446
5     5       138       43         182    1308
6     6       138       39         178    1169
7     7       138       35         174    1031
8     8       138       31         169     892
9     9       138       27         165     754
10   10       138       23         161     615
11   11       138       18         157     477
12   12       138       14         153     338
13   13       138       10         149     200
14   14       200        6         206       0

\$Amortized.Decreasing.Repayment.Plan
Year Principal Interest Installment Balance
1     1       143       60         203    1857
2     2       143       56         199    1714
3     3       143       51         194    1571
4     4       143       47         190    1429
5     5       143       43         186    1286
6     6       143       39         181    1143
7     7       143       34         177    1000
8     8       143       30         173     857
9     9       143       26         169     714
10   10       143       21         164     571
11   11       143       17         160     429
12   12       143       13         156     286
13   13       143        9         151     143
14   14       143        4         147       0

\$Amortized.Even.Repayment.Plan
Year Principal Interest Installment Balance
1     1       117       60         177    1883
2     2       121       56         177    1762
3     3       124       53         177    1638
4     4       128       49         177    1510
5     5       132       45         177    1379
6     6       136       41         177    1243
7     7       140       37         177    1103
8     8       144       33         177     959
9     9       148       29         177     811
10   10       153       24         177     658
11   11       157       20         177     501
12   12       162       15         177     339
13   13       167       10         177     172
14   14       172        5         177       0

\$Straight.End.Repayment.Plan
Year Principal Interest Installment Balance
1     1         0       60          60    2000
2     2         0       60          60    2000
3     3         0       60          60    2000
4     4         0       60          60    2000
5     5         0       60          60    2000
6     6         0       60          60    2000
7     7         0       60          60    2000
8     8         0       60          60    2000
9     9         0       60          60    2000
10   10         0       60          60    2000
11   11         0       60          60    2000
12   12         0       60          60    2000
13   13         0       60          60    2000
14   14      2000       60        2060       0

\$Summary.of.all.repayment.plans
Principal Interest Installment
Partial Repayment Plan                   2000      462        2462
Amortized Decreasing Repayment Plan      2000      450        2450
Amortized Even Repayment Plan            2000      479        2479
Straight End Repayment Plan              2000      840        2840
```

RepaymentPlan documentation built on Oct. 30, 2019, 9:43 a.m.