VII. Applications: sciences, economics and optimization

50. Economics, finance and insurance

Financial and economic calculations are on the home screen in the section "Applications", field Economics: interest for days (30E/360, ACT/360, ACT/365), a bill of exchange and its discount, an annuity paid out of savings (temporary, deferred, a perpetuity), mixed interest, savings with an initial deposit and yearly crediting, a loan repaid by a constant principal, interest on a deposit (simple, compound, continuous, with tax and inflation), regular savings, a loan with its amortization schedule and APR, a bond, an investment (NPV, IRR, payback), currency conversion, the break-even point, profit maximization, market equilibrium, Leontief's model and Markov chains, and actuarial mathematics – life tables, life insurance, annuities, reserves and non-life insurance with bonus-malus.

Investing in P2P loans computes the portfolio value (the cash on the account and the outstanding principal) month by month: the deposits are invested in whole amounts per loan, the loans are repaid by an annuity, the platform takes an origination fee and a share of the interest, the losses are a yearly default rate; for comparison a closed formula with continuous reinvestment. Inversely it finds the monthly deposit or the time for a target amount.

Amounts can be in any currency – pick it in the form (the default is your phone's country's); the calculation doesn't depend on it. Currency conversion takes the Czech National Bank's daily rates (in Czech or on a phone set to Czechia) or the European Central Bank's reference rates (in the other languages) and converts any pair through a common currency, showing the rates' source and date.

Amounts in a currency are written by the custom of the app's language and the region in the phone's settings (2,431.50 USD; in Czech 2 431,50 Kč; in German 2.431,50, in Switzerland 2’431.50), and so is the rate table's date.

The steps show the formulas, the substitution and the intermediate results: the effective and the real rate, the amortization schedule, the flows' present value, marginal revenue and cost as derivatives, surpluses as integrals, the Leontief inverse and the stationary distribution by solving a system. Actuarial mathematics uses the commutation numbers; the reserve is shown prospectively and retrospectively.

Examples

A deposit with monthly compounding, tax on interest and inflation.
Input: model(deposit; find=Kn[one]; K0=100000[one]; p=5[pct]; n=10[one]; d=15[pct]; infl=3[pct]; kind=compound; freq=monthly; cur=CZK)
model(deposit; find=Kn[one]; K0=100000[one]; p=5[pct]; n=10[one]; d=15[pct]; infl=3[pct]; kind=compound; freq=monthly; cur=CZK)
model(deposit; find=Kn[one]; K0=100000[one]; p=5[pct]; n=10[one]; d=15[pct]; infl=3[pct]; kind=compound; freq=monthly; cur=CZK)model(deposit; find=Kn[one]; K0=100000[one]; p=5[pct]; n=10[one]; d=15[pct]; infl=3[pct]; kind=compound; freq=monthly; cur=CZK)
Monthly savings for 15 years.
Input: model(savings; find=S[one]; a=2000[one]; p=3[pct]; n=15[one]; d=15[pct]; timing=due; freq=monthly; cur=CZK)
model(savings; find=S[one]; a=2000[one]; p=3[pct]; n=15[one]; d=15[pct]; timing=due; freq=monthly; cur=CZK)
model(savings; find=S[one]; a=2000[one]; p=3[pct]; n=15[one]; d=15[pct]; timing=due; freq=monthly; cur=CZK)model(savings; find=S[one]; a=2000[one]; p=3[pct]; n=15[one]; d=15[pct]; timing=due; freq=monthly; cur=CZK)
A mortgage of 3 million for 25 years – payment, schedule and APR.
Input: model(loan; find=a[one]; D=3000000[one]; p=5[pct]; n=25[one]; F=15000[one]; freq=monthly; cur=CZK)
model(loan; find=a[one]; D=3000000[one]; p=5[pct]; n=25[one]; F=15000[one]; freq=monthly; cur=CZK)
model(loan; find=a[one]; D=3000000[one]; p=5[pct]; n=25[one]; F=15000[one]; freq=monthly; cur=CZK)model(loan; find=a[one]; D=3000000[one]; p=5[pct]; n=25[one]; F=15000[one]; freq=monthly; cur=CZK)
Saving 1,000 a month with an initial deposit and interest credited yearly (as taught at Czech schools).
Input: model(savings; find=S[one]; a=1000[one]; K0=20000[one]; p=2[pct]; n=5[one]; timing=due; freq=monthly; credit=annual; cur=CZK)
model(savings; find=S[one]; a=1000[one]; K0=20000[one]; p=2[pct]; n=5[one]; timing=due; freq=monthly; credit=annual; cur=CZK)
model(savings; find=S[one]; a=1000[one]; K0=20000[one]; p=2[pct]; n=5[one]; timing=due; freq=monthly; credit=annual; cur=CZK)model(savings; find=S[one]; a=1000[one]; K0=20000[one]; p=2[pct]; n=5[one]; timing=due; freq=monthly; credit=annual; cur=CZK)
Investing in P2P loans: 2,000 CZK a month for 10 years, 200 CZK per loan, with a fee and losses.
Input: model(lending; find=V[one]; a=2000[one]; p=8[pct]; f=1[pct]; loss=2[pct]; L=200[one]; M=60[one]; n=10[one]; cur=CZK)
model(lending; find=V[one]; a=2000[one]; p=8[pct]; f=1[pct]; loss=2[pct]; L=200[one]; M=60[one]; n=10[one]; cur=CZK)
model(lending; find=V[one]; a=2000[one]; p=8[pct]; f=1[pct]; loss=2[pct]; L=200[one]; M=60[one]; n=10[one]; cur=CZK)model(lending; find=V[one]; a=2000[one]; p=8[pct]; f=1[pct]; loss=2[pct]; L=200[one]; M=60[one]; n=10[one]; cur=CZK)
A loan repaid by a constant principal – falling payments compared with an annuity.
Input: model(loan; find=a[one]; D=1200000[one]; p=5[pct]; n=10[one]; freq=monthly; method=constant; schedule=short; cur=CZK)
model(loan; find=a[one]; D=1200000[one]; p=5[pct]; n=10[one]; freq=monthly; method=constant; schedule=short; cur=CZK)
model(loan; find=a[one]; D=1200000[one]; p=5[pct]; n=10[one]; freq=monthly; method=constant; schedule=short; cur=CZK)model(loan; find=a[one]; D=1200000[one]; p=5[pct]; n=10[one]; freq=monthly; method=constant; schedule=short; cur=CZK)
Interest for days by 30E/360 with a 15 % tax.
Input: model(daycount; find=Kn[one]; K0=50000[one]; p=2[pct]; start=2026-03-15; end=2026-09-20; d=15[pct]; basis=e30; cur=CZK)
model(daycount; find=Kn[one]; K0=50000[one]; p=2[pct]; start=2026-03-15; end=2026-09-20; d=15[pct]; basis=e30; cur=CZK)
model(daycount; find=Kn[one]; K0=50000[one]; p=2[pct]; start=2026-03-15; end=2026-09-20; d=15[pct]; basis=e30; cur=CZK)model(daycount; find=Kn[one]; K0=50000[one]; p=2[pct]; start=2026-03-15; end=2026-09-20; d=15[pct]; basis=e30; cur=CZK)
A bill discounted – what the bank pays 90 days before maturity.
Input: model(bill; find=payout[one]; N=100000[one]; dr=6[pct]; start=2026-01-10; end=2026-04-10; basis=act360; cur=CZK)
model(bill; find=payout[one]; N=100000[one]; dr=6[pct]; start=2026-01-10; end=2026-04-10; basis=act360; cur=CZK)
model(bill; find=payout[one]; N=100000[one]; dr=6[pct]; start=2026-01-10; end=2026-04-10; basis=act360; cur=CZK)model(bill; find=payout[one]; N=100000[one]; dr=6[pct]; start=2026-01-10; end=2026-04-10; basis=act360; cur=CZK)
A monthly annuity from 2 million for 20 years, deferred by 5 years.
Input: model(annuity; find=a[one]; PV=2000000[one]; p=3[pct]; n=20[one]; k=5[one]; kind=temporary; timing=ordinary; freq=monthly; cur=CZK)
model(annuity; find=a[one]; PV=2000000[one]; p=3[pct]; n=20[one]; k=5[one]; kind=temporary; timing=ordinary; freq=monthly; cur=CZK)
model(annuity; find=a[one]; PV=2000000[one]; p=3[pct]; n=20[one]; k=5[one]; kind=temporary; timing=ordinary; freq=monthly; cur=CZK)model(annuity; find=a[one]; PV=2000000[one]; p=3[pct]; n=20[one]; k=5[one]; kind=temporary; timing=ordinary; freq=monthly; cur=CZK)
A bond's price and duration.
Input: model(bond; find=price[one]; N=1000[one]; cp=5[pct]; n=5[one]; y=4[pct]; freq=annual; cur=EUR)
model(bond; find=price[one]; N=1000[one]; cp=5[pct]; n=5[one]; y=4[pct]; freq=annual; cur=EUR)
model(bond; find=price[one]; N=1000[one]; cp=5[pct]; n=5[one]; y=4[pct]; freq=annual; cur=EUR)model(bond; find=price[one]; N=1000[one]; cp=5[pct]; n=5[one]; y=4[pct]; freq=annual; cur=EUR)
An investment's internal rate of return.
Input: model(npv; find=irr[one]; CF=-1000 300 400 500 200[one]; r=10[pct]; cur=EUR)
model(npv; find=irr[one]; CF=-1000 300 400 500 200[one]; r=10[pct]; cur=EUR)
model(npv; find=irr[one]; CF=-1000 300 400 500 200[one]; r=10[pct]; cur=EUR)model(npv; find=irr[one]; CF=-1000 300 400 500 200[one]; r=10[pct]; cur=EUR)
Euros to korunas by today's ČNB rate.
Input: model(exchange; find=converted[one]; A=100[one]; from=EUR; to=CZK; source=cnb)
model(exchange; find=converted[one]; A=100[one]; from=EUR; to=CZK; source=cnb)
The profit maximum from marginal revenue and cost.
Input: model(profit; find=optimum[one]; a=100[one]; b=2[one]; F=200[one]; cv=20[one]; e=0.5[one]; cur=CZK)
model(profit; find=optimum[one]; a=100[one]; b=2[one]; F=200[one]; cv=20[one]; e=0.5[one]; cur=CZK)
model(profit; find=optimum[one]; a=100[one]; b=2[one]; F=200[one]; cv=20[one]; e=0.5[one]; cur=CZK)model(profit; find=optimum[one]; a=100[one]; b=2[one]; F=200[one]; cv=20[one]; e=0.5[one]; cur=CZK)
Market equilibrium, surpluses and a tax.
Input: model(market; find=equilibrium[one]; a=100[one]; b=2[one]; cs=10[one]; d=3[one]; t=5[one]; cur=CZK)
model(market; find=equilibrium[one]; a=100[one]; b=2[one]; cs=10[one]; d=3[one]; t=5[one]; cur=CZK)
model(market; find=equilibrium[one]; a=100[one]; b=2[one]; cs=10[one]; d=3[one]; t=5[one]; cur=CZK)model(market; find=equilibrium[one]; a=100[one]; b=2[one]; cs=10[one]; d=3[one]; t=5[one]; cur=CZK)
Leontief's model of three sectors.
Input: model(leontief; find=x[one]; A=0.2 0.3 0.1 0.4 0.1 0.2 0.1 0.2 0.3[one]; y=100 200 150[one])
model(leontief; find=x[one]; A=0.2 0.3 0.1 0.4 0.1 0.2 0.1 0.2 0.3[one]; y=100 200 150[one])
model(leontief; find=x[one]; A=0.2 0.3 0.1 0.4 0.1 0.2 0.1 0.2 0.3[one]; y=100 200 150[one])model(leontief; find=x[one]; A=0.2 0.3 0.1 0.4 0.1 0.2 0.1 0.2 0.3[one]; y=100 200 150[one])
Three brands' long-run customer shares.
Input: model(markov; find=stationary[one]; P=0.8 0.15 0.05 0.1 0.8 0.1 0.05 0.15 0.8[one])
model(markov; find=stationary[one]; P=0.8 0.15 0.05 0.1 0.8 0.1 0.05 0.15 0.8[one])
A woman's life expectancy at 65.
Input: model(mortality; find=expectancy[one]; x=65[one]; table=female)
model(mortality; find=expectancy[one]; x=65[one]; table=female)
model(mortality; find=expectancy[one]; x=65[one]; table=female)model(mortality; find=expectancy[one]; x=65[one]; table=female)
An endowment's annual premium.
Input: model(lifeinsurance; find=premium[one]; x=40[one]; n=20[one]; i=2.5[pct]; S=1000000[one]; product=endowment; payment=annual; table=male; cur=CZK)
model(lifeinsurance; find=premium[one]; x=40[one]; n=20[one]; i=2.5[pct]; S=1000000[one]; product=endowment; payment=annual; table=male; cur=CZK)
model(lifeinsurance; find=premium[one]; x=40[one]; n=20[one]; i=2.5[pct]; S=1000000[one]; product=endowment; payment=annual; table=male; cur=CZK)model(lifeinsurance; find=premium[one]; x=40[one]; n=20[one]; i=2.5[pct]; S=1000000[one]; product=endowment; payment=annual; table=male; cur=CZK)
A bonus-malus system and the average premium level.
Input: model(nonlife; find=stationary[one]; levels=100 90 80 70 60 50[one]; q=10[pct]; mode=bonusmalus; rule=reset; cur=CZK)
model(nonlife; find=stationary[one]; levels=100 90 80 70 60 50[one]; q=10[pct]; mode=bonusmalus; rule=reset; cur=CZK)
model(nonlife; find=stationary[one]; levels=100 90 80 70 60 50[one]; q=10[pct]; mode=bonusmalus; rule=reset; cur=CZK)model(nonlife; find=stationary[one]; levels=100 90 80 70 60 50[one]; q=10[pct]; mode=bonusmalus; rule=reset; cur=CZK)

Known limitations