Examples

This section provides with examples of some standard and not that standard financial products built with the help of cffiddle.

Index of examples

  1. Cash flow generators
    1. Annuity
    2. Installment Loan
    3. Bullet Loan
    4. Zero bond
    5. Regular savings account
  2. Composites of standard cash flows
    1. Building Loan

Cash flows generators

The following examples are generated using the cash flows generators offered at the start page.

Annuity

Annuity type of loan is used very often. Since the salaries are more or less fixed each month, it's convenient to have also a loan payment which is also fixed, it makes it easier to plan the budget among other things.

For example, a house of 500'000 USD is mortgage-financed with 100'000 own capital (i.e. the loan is 400'000 USD) at fixed 3% p.a. interest rate for 20 years. It results in 2218.39 USD monthly. Here's the code for it: annuity(400000,0.03,20,x,12).

Installment loan

This type of loan is wide-spread for car loans (however, depends on the country). It makes it easier to understand and plan how much you owe the bank since the loan balance sinks linearly (in case if annuity it sinks exponentially).

For example, a car costs 30'000 USD and completely financed with installment loan for 5 years at 6% p.a. Then you start paying 650 USD a month, finishing with 502.50 USD a month 5 years later. Here's the code for it: installment(30000,0.06,5,12).

Bullet loan

This type of loan is rather wide-spread in corporate financing. For instance, a project requires some big initial investment and is expected to be sold with profit years later. This is exactly the opposite cash flow of bullet loan.

For example, a development company plans to buy an old brewery to make an attraction site out of it with small shops, clubs, cinema etc and sell it years later as the site gets attraction and produces stable rent cash flows. Thus, it needs a big amount at the beginning to buy it, repair it and redesign it, let's say 10 000 000 USD, later, it gets some constant cash flow renting out the rooms, and sells it 4 years later.

To match the expected cash flows it takes a bullet loan of 10 000 000 USD at 5% p.a. for 4 years, with interest paid out quarterly. Thus, the company needs to pay 125 000 USD each quarter and finally 10 000 000 USD in 4 years. Here's the code for it: bullet(10000000,0.05,4,4).

Zero bond

With zero bond you usually pay (if you are a buyer or a lender) a price with discount to nominal and years later you get the nominal.

A zero bond could also be used for other purposes. For example, given a card debt of 20'000 USD under 15% p.a., how big will it be in 3 years if not touched at all? We need to set the principal at 20'000, maturity at 3 years, the imputed interest at 15 and set the face value as the free parameter. It will grow from 20'000 USD to more than 30'000 USD, i.e. more than 50% in 3 years! Here's the code for it: zero(20000,0.15,3,x).

Regular savings

Regular savings account helps to save towards some sum paying a fixed amount each month.

For example, parents want to save towards their daughter college tuition of 30 000 USD who enters the college age in 8 years. Their local banks offers them this type of account at 1.5 % p.a.. They need to save 294.32 USD each month in this case. Here's the code for it: regular(30000,0.015,8,x,12).

Composites of standard cash flows

The following examples are the combinations of cash flows generated using the cash flows generators offered at the start page.

Building loan

Usually a building loan consist of saving period and loan period. During the saving period you need to save some amount of the house price (e.g. 40-50%) and then get the rest as a loan.

For example, you save for 8 years at 1% towards 100 000 USD and buy (who knows what happens in 8 years, but let's make some assumptions) buy an appartment for 210 000 USD, thus, getting the loan of 110'000 for 10 years at 2% (in 8 years). How could it be represented? The saving period could be represented as regular savings account with 100 000 USD as saving goal, 8 years maturity, 1% p.a. interest rate and monthly payment as a free parameter. It turns out to be 1000.99 USD a month.

The loan period could be represented as annuity with 110 000 USD principal, 2% p.a. interest rate, 10 years maturity and monthly payment as a free parameter. It turns out you need to pay 1012.15 USD monthly in the loan period. Since the loan will be given in 8 years, we need to perform an operation on time points, namely, shift it by 8 years.

The overall portfolio has 2 cash flows. Here's the code for it regular(100000,0.01,8,x,12);+;annuity(110000,0.02,10,x,12);shift_t(8);/.