I'm looking to buy a flat; I can expect it to cost between 1 and 2.5 MNOK (millions of Norwegian Krone); I have about 0.5 MNOK in ready capital at my disposal and, at a rough estimate, have about 10 k NOK per month that I can use to pay for accommodation; the interest rate for mortgages appears to be something like 4% per annum. I need to think about how expensive a flat I can afford and whether it's better to go for the most expensive flat I can afford or something more affordable to use as a stepping-stone to something more expensive later. So, time to do some theory.

With the classic repayment mortgage, the borrower pays off the loan and
interest on it at a fixed monthly rate. Let d(i) be the remaining debt after i
months; suppose the borrower pays back m per month; and let f be the monthly
growth factor for the loan, equal to (1+r)^{1/12}; its twelfth power is
one plus the interest rate (in which % means divide by 100; so 4% APR means
f^{12} is 1.04). We can then write:

- d(1+i) = d(i).f −m

If we introduce y = d −k for some constant k, we get

- y(1+i)
- = d(1+i) −k
- = d(i).f −k −m
- = (y(i) +k).f −k −m
- = y(i).f −m +k.(f−1)

so use k = m/(f−1) to obtain y(1+i) = y(i).f with solution y(i) = y(0).power(i, f) implying

- d(i)
- = m/(f−1) +power(i,f).(d(0) −m/(f−1))
- = d(0).power(i,f) −m.(power(i,f)−1)/(f−1)
- = d(0).power(i,f) −m.sum(: power(j,f) ←j |i)
- = power(i,f).(d(0) −m.sum(: power(j-i,f) ←j |i))
- = power(i,f).(d(0) −m.(1/f +1/f/f +… +1/power(i,f)))
- = power(i,f).(d(0) −m.(1 −power(i, 1/f))/(f −1))
- ≥ power(i,f).(d(0) −m/(f −1))

and, for f > 1, d(i) tends to this last from above for large i; in a conventional mortgage, d(0) < m/(f −1) makes this limit negative, and the mortgage ends when d(i) finally drops to (or below) 0.

Notice that if m = d(0).(f−1) then d(i) is constant: the monthly payment just covers the interest on the outstanding debt and the buyer never gets any closer to owning the house. That's the same position that someone renting a flat is in – so, if dividing your rent by f−1 yields the price of your home, or more, you're better off taking out a mortgage on it (or an equivalent property) instead of renting. Another way of looking at that is to say that renting a place amounts to declaring that you believe it to be worth at least the given threshold price.

Economists have a notion of net present value

which ascribes to a sum
of money at some time in the future a value equal to the sum of money you would
need, now, to invest so as to have the specified sum at the given future time.
This can also be applied to an income stream by summing the net present values
of a succession of sums of money at various times stretching into the future.
When the sums are equal, the time intervals between them are constant and the
times stretch indefinitely into the future, the result is equivalent to asking
for the sum of money which would earn, as interest in each of the time
intervals, an amount equal to each of the sums: the net present value of an
income m per month is thus m/(f−1), for some applicable interest factor f
(i.e. f−1 is the interest rate).

For m > d(0).(f−1), the mortgage shall be paid off when d(i) ≤ 0, i.e. when d(0)/m ≤ (1 −power(i,1/f))/(f−1), so

- i ≥ −log(1 −d(0).(f−1)/m)/log(f).

The net present value

of N months of an income m per month is
thus m.(1 −power(N,1/f))/(f−1); i.e. (1 −power(N,1/f)) times
the net present value of an indefinite income at the same rate. When power(N,f)
is 2, this factor is just 1/2, making N = log(2)/log(f) months equivalent to
half of infinity. When the interest rate is 3.6% per annum, so f is about
1.003, the N which achieves this is just over 235: so the first twenty years of
a steady income stream are (in the eyes of some economists) worth more than all
the rest, no matter how long it continues. At the very least, a perpetual
mortgage will buy you a property worth no more than twice what the first twenty
years could have bought you.

Now, in practice, things are not quite so simple. Defaulting on a mortgage tends to incur penalty fees, so those with income insecurity may be better off renting despite the above case. On the other hand, many folk are justifiably confident of earning more in a few years time than now; and we have every reason to expect house prices to rise, so taking out a mortgage one can initially only just afford may well be more economically efficient than waiting until you can afford to pay today's price, by which time that price won't buy as valuable a house.

We should, then, take account of inflation on both wages and property
prices. Ideally, the effect of property price inflation shall be to make the
value of the purchased property greater once it *is* yours, at the end of
the purchase; in practice we can also track its value during the purchase, as an
indicator (called your net equity

) of the amount you would walk away with
if you sold the house ahead of time and paid off the rest of the mortgage. The
effect of wage inflation, in contrast, is to make the value of m grow over time.

In practice, neither inflation rate is constant; in particular, wage inflation tends to happen at most once per year: none the less, I shall pretend (only because it makes the models easier) that each happens at a steady monthly rate. (You can simulate this, with irregular annual pay rises, by increasing m at a steady rate and applying surplus income some other way, e.g. to a savings account that'll let you keep on increasing m through a year when your pay-rise is disappointing.) It should also be noted that the relevant wage inflation is the one for a given purchaser's income, not the statistically averaged one for the whole work-force: the latter effectively compares today's workers of any given experience level in any given job with the comparable workers of the past, who are apt to have gained experience and associated pay rises above the average rate. So an individual's pay-rises during a career commonly exceed contemporary market-averages (in effect because those retiring are taking bigger drops in their income than the rise in income of those starting in their first jobs).

If we allow for inflation of property prices and wages with monthly factors (analogous to f) of g and h, respectively, then we get d(1+i) = d(i).f −m.power(i,h) and the value of the property varies as (d(0)+E).power(i,g), where E is how much non-loan capital went into buying the house, so that your net equity is e(i) = (d(0) +E).power(i,g) −d(i).

To solve for d, introduce y(i) = d(i) −k(i) for some sequence k; then

- y(1+i)
- = d(1+i) −k(1+i)
- = d(i).f −m.power(i,h) −k(1+i)
- = (y(i) +k(i)).f −m.power(i,h) −k(1+i)
- = y(i).f +k(i).f −k(1+i) −m.power(i,h)

so let k(i) = power(i,h).m/(f−h) to obtain y(i) = power(i,f).y(0) whence d(i) = power(i,h).m/(f−h) +power(i,f).(d(0) −m/(f−h)), at least when f and h differ (if they don't, you could make sensible estimates by simply under-estimating h to make them differ; you'll work out better off than the theory predicts in that case; but we'll soon see that we can do better than this). We then have:

- d(i)
- = power(i,f).d(0) +(power(i,h) −power(i,f)).m/(f−h)
- = power(i,f).(d(0) −m/h.(h/f +h.h/f/f +… +power(i, h/f)))

Note that, in its last form, we are rid of the factor f−h and the solution is demonstrably valid even when f = h. In this case, the debt it paid off, i.e. d(i) ≤ 0, when f.d(0)/m ≤ 1 +h/f +… power(i−1, h/f). In the case h = f, the right-hand side here is simply i and the debt is paid off once i≥ f.d(0)/m. Otherwise, the sum of powers of h/f can be reduced to (power(i,h/f) −1) / (h/f −1); the cases h>f and h<f have to be considered separately when converting this to a constraint on i, but each yields

- i ≥ log(1 +(h−f).d(0)/m)/log(h/f)

provided m ≥ d(0).(f−h). (We also, naturally, require m > 0, even when f < h.) The above leaves us with net equity, during the purchase, of

- e(i) = E.power(i,g) +power(i,f).(d(0).(power(i,g/f)−1) +m/h.(h/f +h.h/f/f +… +power(i, h/f)))

When d(i) finally reaches zero, the m/h.(h/f …) term is equal to d(0) and we obtain e(i) = power(i, g).(d(0) +E), as should be expected. So long as g > f, net equity increases with d(0), thus likewise with the initial size of loan.

Note that – during most of living memory and at least when averaged
over the kinds of periods for which folk generally take out mortgages – h
and f have tended to take fairly similar values (and note that the mortgage
rate, f−1, is generally lower than other interest rates, since a mortgage
is a secured loan); and g has exceeded background inflation by as much as 1.004
(annual growth rate: 5%) in the short term, sustained over large fractions of a
decade, but its surplus over background inflation has averaged around 1.0015
(annual growth rate: 1.8%) over reasonable numbers of cycles of its growth and
collapse. So
long as g exceeds both f and h, the first term, d(0).(power(i,g/f)−1),
tends to dominate in the above: the contribution of one's payments grows roughly
in proportion to i (since each power(i, h/f) is approximately one) while the
contribution due to property price inflation has grown exponentially. This is
often described as if it were unremittingly good news for home owners: however,
when you want to buy
further up the property ladder

, you'll find that the differences in price
have grown at the same rate.

In practice matters are even more complex: my salary rises at a different rate to the background rate of inflation on the ordinary goods I consume routinely; and my salary only increases once per year. Suppose my first pay rise, during the period of the mortgage, happens at i = P; pay rises shall happen at i = P + n.y for natural n with some fixed period, y probably = 12, between successive pay rises. … work in progress … So the amount of money I can afford to pay towards the mortgage grows as In.power(N,H) −Out.power(i,k) where N −12.i varies in a saw-tooth way, with constant min and max, H is my annual pay growth factor, power(12,h), In is my income, Out my non-housing spend and k the monthly inflation factor for Out.

However, f itself may be subject to some corrections: in Norway, for example, the government deducts, from one's tax bill, 28% of the interest one pays on a mortgage; so the effective mortgage rate is only 0.72 of what the bank charges. This reduces the interest rate from 3.6% to 2.592%

Naturally, I've
implemented the
calculations of all this as part of my
pythonic study package;
in `study.money.debt`, `affordable()` does the basic
calculation while `Debt` and `Instance` provide the means to
track finer details.

Now let's examine the strategic question of whether there's value to be had in starting modest and delaying ambition. To this end, consider a buyer with initial capital E and available income m.power(i,h) as before, buying a house at price E+H, paying off its mortgage and then buying a second house whose price was, initially, E+H+K. The first mortgage has d(0) = H; it is paid off once i ≥ f.H/m for h=f or i≥ log(1+(h−f).H/m)/log(h/f) otherwise; chose some i=N satisfying these constraints as the moment when we get to the second purchase. The second house's price is then (E+H+K).power(N,g) and our buyer has capital (E+H).power(N,g) so needs to borrow K.power(N,g). This shall be paid off after a further i months once i ≥ f.K.power(N,g/h)/m if h=f, else i ≥ log(1+(h−f).K.power(N,g/h)/m)/log(f/h). The total duration of this stragety is then N plus the least i satisfying these constraints.

The obvious alternative strategy is to go straight for E+H+K, borrowing H+K and paying off once i ≥ f.(H+K)/m for f=h, else once i ≥ log(1+(h−f).(K+H)/m)/log(f/h). For the h=f case, the two-step strategy takes (ignoring rounding glitches) time f.(H +K.power(N,g/h))/m, which is longer by (power(N,g/h) −1).f.K/m; unless you expect your income to grow faster than house prices, it's more profitable to go for the more expensive property directly. Alternatively, again ignoring rounding glitches, with distinct h and f, we take log( (1+(h−f).H/m).(1+(h−f).K.power(N,g/h)/m) )/log(f/h) in the two-step approach; the parameter of log in the numerator (all else being the same as in the single-step approach) is at least 1+(h−f).(H+K.power(N,g/h))/m, as compared to 1+(h−f).(H+K)/m. Thus, at least when g>h≥f, the two-stage approach is less economically effective than the direct approach, as long as everything goes according to plan.

The logic of all this depends on the borrower's confidence in future earnings (quite apart from growth at rate h); larger debts make it harder to cope with a gap in one's earnings. When the internet economy downturn of 2001 made me redundant for a while, I had savings and no debt; I could have coped comfortably with a year out of work and, indeed, the break was a most refreshing sabbatical. At other times in my life, I've taken a year out in like manner voluntarily: a debt needing regular repayment would make that hard to do. All the same, it should be possible to cope with such situations by selling the expensive property and buying something cheaper: some of one's equity shall be lost to overheads incurred in doing that, but the larger the original purchase, the more equity shall be available with which to do so.

Of course, one should also bear in mind that a house is (or, at least, should be) primarily a place to live, not a speculative investment: having a pleasant home convenient to where I work is more important to me than accumulating wealth.

Written by Eddy.