Archive for the ‘Technical’ Category

The Grammar of Graphics

Tuesday, March 8th, 2016

R’s ggplot2 has the most elegant graph API that I know. This article by Hadley Wickham himself is a great introduction to some of the ideas underlying The Grammar of Graphics that he implemented. I think it contains a lot of great ideas for API design.

NetSurveillance Web RTSP URL

Saturday, February 27th, 2016

Spent way too long discovering this.


Lagged asset correlations, a thought experiment

Monday, December 1st, 2014

Suppose I start a fund that imposes a 1-day withdrawal lead time, and takes your money and invests it in the S&P 500 on day 0, but then reports the day 0 return as the day 1 return, the day 1 return as the day 2 return, and so on, reporting the return on day 0 as 0. This fund has a return which is a tiny bit less than the S&P, but is completely uncorrelated on a daily basis. It would, however, have an almost perfect correlation on an annual basis, and that’s why you wouldn’t invest in such a thing. If you only used daily correlations when deciding whether to put this asset into your portfolio, you would have been greatly mislead!

If you optimized for track record Sharpe ratio you would actually invest in this stupid fund. That TYPE of smoothing is worthless though!

Exponential money fallacy / paradox

Tuesday, April 17th, 2012

After posting a stub of a blog post previously, I was surprised to see my friend CH comment on the post in facebook right away. Knowing that people actually see these posts is very encouraging. Readers, I am trying to write one post a day – the quality will not be that high in the beginning, and that’s why I need the practice. I am having difficulty picking topics – they are mostly either too dry (like today) or too personal for me to want to write about publicly – would appreciate any suggestions you might have.

Today I will address the exponential money paradox. This is a puzzle that is raised by newcomers to the concept of fractional reserve banking, the prevalent form of banking today.

An Economics Puzzle

The $100 bill

It’s a cold day in the small Saskatchewan town of Pumphandle and streets are deserted.  Times are tough, everybody is in debt, and everybody is living on credit.

A traveler comes to town and lays a $100 bill on the hotel desk saying he wants to inspect the rooms upstairs to pick one for the night.

As soon as he walks upstairs, the hotel owner grabs the bill and runs next door to pay his debt to the butcher.

The butcher takes the $100 and runs down the street to retire his debt to the pig farmer.

The pig farmer takes the $100 and heads off to pay his bill to his supplier, the Co-op.

The guy at the Co-op takes the $100 and runs to pay his debt to the local prostitute, who has also been facing hard times and has had to offer her “services” on credit.

The hooker rushes to the hotel and pays off her room bill with the hotel owner.

The hotel proprietor then places the $100 back on the counter so the traveler will not suspect anything.

At that moment the traveler comes down the stairs, states that the rooms are not satisfactory, picks up the $100 bill and leaves.

No one produced anything.  No one earned anything….

However, the whole town is now out of debt and now looks to the future with a lot more optimism.

The paradox

One criticism posits that since debt and the interest on the debt can only be paid in the same form of money, the total debt (principal plus interest) can never be paid in a debt-based monetary system unless more money is created through the same process. For example: if 100 credits are created and loaned into the economy at 10% per year, at the end of the year 110 credits will be needed to pay the loan and extinguish the debt. However, since the additional 10 credits does not yet exist, it too must be borrowed. This implies that debt must grow exponentially in order for the monetary system to remain solvent.

Credit and money are somewhat indistinguishable in our world. The flipside of credit is debt, and the picture that the exponential money paradox conjurs is that of a borrower who borrows to pay the interest on outstanding debt. This is an unsustainable situation, as the amount owed will thus grow exponentially and eventually overwhelm the borrower. People mistakenly (and vaguely) imagine that fractional-reserve banking dooms us to this type of failure.

The mistake made in picturing this scenario is in keeping track of where all the money goes and comes from. The relevant phrase to examine is “since the additional 10 credits does not yet exist”. In this statement, there is a confusion between the stock of money and the flow of money. The payment of interest is a flow, not a stock – unlike the principal amount, there is no accounting identity that relates the amount of interest paid to the amount of the loan. The process by which deposits come into existence under fractional reserve banking mark the loan value at the original principal amount loaned out, and says nothing about the interest amount.

The loan then sits in the bank’s book and generates interest income, and after subtracting costs, the net income accrues to the owners of the bank. Since the interest is a flow, it can be paid by moving money in a circle – the bank owners withdraw the cash, and go for a nice meal at the new restaurant downtown, and the restaurant uses that money to pay the interest on its mortgage – this results in no money creation.

However, if the restaurant was not making money, it could have gone to the bank for another loan to pay the interest. Instead of handing the bank owner a nice meal, they are handing the bank an IOU. This new loan is backed by bank equity, but not at a 1:1 ratio. In this scenario, money is indeed created.

Does this mean that if I borrowed money and invested in a bank, a lot of money gets created? Well, the hope here is that it would be recognized that your loan was a risky loan which needed to be backed at a 1:1 ratio. Loans backed 1:1 do not create money.


There are enough possibilities that the soundness or unsoundness of fractional-reserve banking is empirical and cannot be concluded by thought experiments.