Discount¶
Note: This definition of discount may differ from what you are used to in finance. If you typically use the terms interest rate and discount rate interchangeably, then stick with the interest rate operations in TmVal. If you encounter the term ‘discount rate’ in TmVal, please be aware that it refers to actuarial discount, discount interest, or interest up front.
For loans, sometimes, interest is paid up front. For example, if you were to take out a loan for $1000 to be repaid in 1 year, the lender may ask you to pay $100 immediately for use of the remaining $900. This value of $100 is known as the discount on the loan.
Mathematically, discount be expressed as:
Where is the amount of the loan, is the amount of discount, and is the amount available to the borrower at time 0.
We can also think of discount as a rate. The effective discount rate over an interval is defined as:
When ,
The discount rate for the -th time period is defined as:
Examples¶
Suppose we borrow 1000 to be paid back in 1 year, and we need to pay 100 of discount up front. What is the effective discount on the loan?
To solve this problem, we can use the discount_interval()
method of the Amount
class. TmVal also has a class called SimpleLoan
which is a special case of money growth in which a lump sum is borrowed and paid back with a single payment at a later point in time. These loans are common between people outside the context of banking.
SimpleLoan
is callable, and can be passed to the Amount
class just like a growth function.
To create a simple loan, supply the principal, term, and discount amount to SimpleLoan
. Then we can use discount_interval()
to get the discount rate over the interval :
In [1]: from tmval import Amount, SimpleLoan
In [2]: my_loan = SimpleLoan(principal=1000, term=1, discount_amt=100)
In [3]: my_amt = Amount(gr=my_loan, k=1000)
In [4]: print(my_amt.discount_interval(t1=0, t2=1))
0.1
Note that since the term is just one period, we can also simply this calculation by using the method effective_discount()
:
In [5]: print(my_amt.effective_discount(n=1))
0.1
The SimpleLoan
class also has some attributes that can be called to obtain information about the loan:
In [6]: print(my_loan.principal)
1000
In [7]: print(my_loan.discount_amt)
100
In [8]: print(my_loan.discount_rate)
0.1
In [9]: print(my_loan.amount_available)
900