Script:
~addons/finance/finexec/basicfinance/compound.ijs
Contributor: William Szuch
Updated: 2022 6-25
Depend: nil
Definitions: loaded to locale base
Status: done
Script source:
compound.ijs
Definitions for solving compound interest rate
problems for
a constant effective interest rate over a period.
present value
future value
effective and nominal interest rate conversions between time
units
Equations:

Definitions
A
|
an, an0, anD, anF
|
D
|
d
|
E
|
econvf, econvg, enominal
|
F
|
fvcf
|
P
|
pvcf
|
R
|
rconvf
|
S
|
sn, sn1, snD, snF
|
V
|
v, vf0, vf1, vt
|
W
|
w, wt
|
an (dyad)
Form: tacit
Same as an0 but payments deferred for 1 time unit
Payments in arrears
Syntax
(E)an(N)
E = constant effective interest rate per time unit over the period.
N = integer number of payments over the period
Example
(0.05)an(0 5 10)
0 0.952381 4.32948 7.72173
(0 0.05 0.10 0.15)an(0 5 10)
0 0 0 0
5 4.32948 3.79079 3.35216
10 7.72173 6.14457 5.01877
an0 (dyad)
Form: tacit
Present value of N payments of 1 paid at the beginning of each time
unit
for a constant effective interest rate E over the period.
Payments in advance
Syntax
(E)an0(N)
E = constant effective interest rate per time unit over the period.
N = integer number of payments over the period
Example
(0.0)an0(10)
10
(0.05)an0(10)
8.10782
(0.05)an0(0 5 10)
0 4.54595 8.10782
(0 0.05 0.10)an0(10)
10 8.10782 6.75902
(0 0.05 0.10 0.15)an0(0 5 10)
0 0 0 0
5 4.54595 4.16987 3.85498
10 8.10782 6.75902 5.77158
anD (dyad)
Form: tacit
Present value of N payments of 1 payable at the beginning of each time
unit
with the first payment deferred for D time units
for a constant effective interest rate E over the period.
Syntax
(E)anD(D;N)
E = constant effective interest rate per time unit over the period.
D = deferred period in time units to the first payment
N = number of payments in the period
Example
(0.0)anD(1;10)
10
(0.05)anD(0.5;10)
7.91242
(0.05)anD(1.5;0 5 10)
0 4.22514 7.53564
(0 0.05 0.10 0.15)anD(1;10)
10 7.72173 6.14457 5.01877
(0 0.05 0.10 0.15)anD(2;0 5 10)
0 0 0 0
5 4.12331 3.44617 2.91492
10 7.35403 5.58597 4.36415
anF (dyad)
Form: tacit
Present value of multiple payments of 1/F paid at intervals of 1/F of a
time unit
at start of the first payment
for a constant effective interest rate E over the period.
Payments in advance
Syntax
(E)anF(F;N)
E = constant effective interest rate per time unit over the period.
F = integer number of multiple payments in a time unit
N = integer number of time units over the period
Example
(0.05)anF(2;1)
0.98795
(0.05)anF(2;0 1 10)
0 0.98795 8.01012
(0 0.05 0.1)anF(2;5 10)
5 4.49117 4.07284
10 8.01012 6.60175
(0 0.05 0.10 0.15)anF(2;0 5 10)
0 0 0 0
5 4.49117 4.07284 3.72488
10 8.01012 6.60175 5.57681
d (monad)
Form: tacit
Effective rate of discount for one time unit for
an effective interest rate E.
Syntax
d(E)
E = effective interest rate for one time unit
Example
d(0.05)
0.047619
d(0.0 0.01 0.05 0.1)
0 0.00990099 0.047619 0.0909091
econvf (dyad)
Form: tacit
Convert an effective interest rate E for an initial time unit to
an equivalent effective interest rate for a new time unit of
1/F of the initial time unit.
Syntax
(E)econvf(F)
E = effective interest rate for the initial time unit
F = period of new time unit of 1/F times the initial time unit
Example
(0.05)econvf(2)
0.0246951
(0.05 0.1)econvf(2 4 12)
0.0246951 0.0488088
0.0122722 0.0241137
0.00407412 0.00797414
econvg (dyad)
Form: tacit
Convert an effective interest rate E for an initial time unit to
an equivalent effective interest rate for a new time unit of
G times the inital time unit.
Syntax
(E)econvg(G)
E = effective interest rate for old time unit
G = period of new time unit, G times the initial time unit
Example
(0.025)econvg(2)
0.050625
(0.025 0.01)econvg(2 4 12)
0.050625 0.0201
0.103813 0.040604
0.344889 0.126825
enominal (dyad)
Form: tacit
Convert a nominal interest rate for a period to an effective
interest rate for a time unit.
Syntax
(R)enominal(F)
R = nominal interest rate for a period
F = the number of times interest is payable and accumulated in the period
Example
(0.12)enominal(1 2 3 4 6)
0.12 0.06 0.04 0.03 0.02
(0.06 0.12)enominal(1 2 3 4 6)
0.06 0.12
0.03 0.06
0.02 0.04
0.015 0.03
0.01 0.02
fvcf (dyad)
Form: tacit
future value of a cash flow C accumulated for periods
of T time units.
Syntax
(E)fvcf(C;T)
E = constant effective interest rate per time unit over the period.
C = amount of cash flow
T = accumulation periods in time units of cash flow
Example
(0 0.05)fvcf(1;1)
1 1.05
(0.05)fvcf(1;1)
1.05
(0.05 0.1)fvcf(1 1 1;1 2 3)
3.31013 3.641
(0 0.05 0.1)fvcf((1+i. 10);(|. i. 10))
55 64.1357 75.3117
pvcf (dyad)
Form: tacit
Present value of a cash flow C payable at the periods
of T time units
for a constant effective interest rate E over the period.
Syntax
(E)pvcf(C;T)
E = constant effective interest rate per time unit over the period.
C = amount of cash flow
T = periods in time units of cash flow
Example
(0 0.05)pvcf(1;1)
1 0.952381
(0.05)pvcf(1;1)
0.952381
(0.05 0.1)pvcf(1 1 1;1 2 3)
2.72325 2.48685
(0.05 0.1)pvcf((1+i. 10);(1+ i. 10))
39.3738 29.0359
rconvf (dyad)
Form: tacit
Convert a nominal interest rate for a period to an effective
interest rate for time unit for the same period.
Syntax
(R)rconvf(F)
R = nominal interest rate for a period
F = the number of times interest is payable and accumulated in the period
Example
(0.12)rconvf(2)
0.1236
(0.12)rconvf(1 2 3 4 6)
0.12 0.1236 0.124864 0.125509 0.126162
(0.06 0.12)rconvf(1 2 3 4 6)
0.06 0.12
0.0609 0.1236
0.061208 0.124864
0.0613636 0.125509
0.0615202 0.126162
sn (dyad)
Form: tacit
Future value of N payments of 1 payable at intervals for a time
unit.
for a constant effective rate of interest E.
accumulated to the time of the last payment.
Payments in arrears
Syntax
(E)sn(N)
E = constant effective interest rate per time unit over the period.
N = number of payments over the period
Example
(0.0)sn(10)
10
(0.05)sn(10)
12.5779
(0.05)sn(0 5 10)
0 5.52563 12.5779
(0 0.05 0.10)sn(10)
10 12.5779 15.9374
(0 0.05 0.10 0.15)sn(0 5 10)
0 0 0 0
5 5.52563 6.1051 6.74238
10 12.5779 15.9374 20.3037
sn1 (dyad)
Form: tacit
Same as sn but payments accumulated for
an additional time unit.
Payments in advance
Syntax
(E)sn1(N)
E = constant effective interest rate per time unit over the period.
N = number of payments over the period
Example
(0 0.05 0.10 0.15)sn1(0 5 10)
0 0 0 0
5 5.80191 6.71561 7.75374
10 13.2068 17.5312 23.3493
snD (dyad)
Form: tacit
Futuret value of N payments of 1 payable interval of a time unit
accumulated for a further D time units from the last payment.
Syntax
(E)snD(D;N)
E = constant effective interest rate per time unit over the period.
D = period in time units from last payment
N = number of payments in the period
Example
(0.0)snD(1;10)
10
(0.05)snD(0.5;10)
12.8885
(0.05)snD(1.5;0 5 10)
0 5.94519 13.5329
(0 0.05 0.10 0.15)snD(1;10)
10 13.2068 17.5312 23.3493
(0 0.05 0.10 0.15)snD(2;0 5 10)
0 0 0 0
5 6.09201 7.38717 8.9168
10 13.8671 19.2843 26.8517
snF (dyad)
Form: tacit
Future value of multiple payments of 1/F paid at intervals 1/F of a time
unit
accumuleted to the last payment.
Payments in arrears
Syntax
(E)snF(F;N)
E = constant effective interest rate per time unit over the period.
F = integer number of multiple payments in a time unit
N = intenger number of time units over the period
Example
(0.05)snF(2;1)
1.01235
(0.05)snF(2;0 1 10)
0 1.01235 12.7332
(0 0.05 0.1)snF(2;5 10)
5 5.59386 6.25409
10 12.7332 16.3264
(0 0.05 0.10 0.15)snF(2;0 5 10)
0 0 0 0
5 5.59386 6.25409 6.98639
10 12.7332 16.3264 21.0385
v (monad)
Form: tacit
Present value of 1 payable in 1 time unit for a
effective interest rate E.
Syntax
v(E)
E = effective interest rate for one time unit
Example
v(0.05)
0.952381
v(0 0.05 0.1 0.15)
1 0.952381 0.909091 0.869565
vf0 (dyad)
Form: explicit
Present value of 1 paid over a single time unit.
Payments commencing at the start of the first frequency
interval in the time unit.
Paymenmt in advance.
Syntax
(E)vf0(F)
E = effective interest rate for the time unit
F = integer frequency of payments in time unit: 1/2/3/etc
and _ for continous payments.
Example
(0)vf0(0)
0
(0)vf0(_)
1
(0.1)vf0(0)
0
(0.1)vf0(2)
0.976731
(0.1)vf0(12)
0.957616
(0.1)vf0(_)
0.953824
vf1 (dyad)
Form: explicit
Present value of 1 paid over a single time unit.
Payments commencing at the end of the first frequency
interval in the time unit.
Payment in arrears.
Syntax
(E)vf1(F)
E = effective interest rate for the time unit.
F = integer frequency of payments in the time unit: 1/2/3/etc
and _ for continous payments.
Example
(0.1)vf1(2)
0.931277
(0.1)vf1(12)
0.950041
(0.1)vf1(_)
0.953824
vt (dyad)
Form: tacit
Present value of 1 payable in a period of T time units
for a constant effective interest rate E over the period.
Syntax
(E)vt(T)
E = constant effective interest rate per time unit over a period
T = number of time units in the period
Example
(0)vt(0)
1
(0.05)vt(10)
0.613913
(0 0.05 0.1 0.15)vt(10)
1 0.613913 0.385543 0.247185
(0.05)vt(0 5 10)
1 0.783526 0.613913
(0 0.05 0.1 0.15)vt(0 5 10)
1 1 1 1
1 0.783526 0.620921 0.497177
1 0.613913 0.385543 0.247185
w (monad)
Form: tacit
Future value of 1 payable in 1 time unit for a
effective interest rate E.
Syntax
w(E)
E = effective interest rate for one time unit
Example
w(0.05)
1.05
w(0 0.05 0.1 0.15)
1 1.05 1.1 1.15
wt (dyad)
Form: tacit
Future value of 1 payable in a period of T time units
for a constant effective interest E over the period.
Syntax
(E)wt(T)
E = constant effective interest rate per time unit over a period
T = number of time units in the period
Example
(0)wt(0)
1
(0.05)wt(10)
1.62889
(0 0.05 0.1 0.15)wt(10)
1 1.62889 2.59374 4.04556
(0.05)wt(0 5 10)
1 1.27628 1.62889
(0 0.05 0.1 0.15)wt(0 5 10)
1 1 1 1
1 1.27628 1.61051 2.01136
1 1.62889 2.59374 4.04556