Author: shyam

Transfer Entropy

In investing, we are always trying to find the relationship between two entities. For example, to hedge a long portfolio, we typically calculate the “beta” with respect to an index and use that to go short the index. Here, the biggest assumption is that the relationship is linear (or at least, piecewise linear.)

However, relationships in finance are typically non-linear. Using the math behind calculating entropy is one way to overcome the “beta” problem.


From Wikipedia: Transfer entropy is a non-parametric statistic measuring the amount of directed (time-asymmetric) transfer of information between two random processes.

It tries to answer a simple question: what the effect of one entity over another, given a lag?

From StackExchange: TE(X↦Y)=0.624 means that the history of the X process has 0.624 bits of additional information for predicting the next value of Y. (i.e., it provides information about the future of Y, in addition to what we know from the history of Y). Since it is non-zero, you can conclude that X influences Y in some way.

Quick Look

Luckily, both R and python have libraries that help calculate transfer entropies between two variables.

Here’s the TE between Stock Futures and the NIFTY with a 500 day lookback and a single-day lag. FLOW_TO is a measure of information flow from the stock to the index and FLOW_FROM is the opposite direction.

Next Steps

This has interesting applications in portfolio risk management. Instead of calculating beta and hoping for the best, we could use TE to get a better understanding of how the individual constituents are affected by the index and hedge only those that have large values.

This post was inspired by Concepts of Entropy in Finance: Transfer entropy. Code and images for this post are on Github.

Book Review: The Birth of Plenty

In The Birth of Plenty: How the Prosperity of the Modern Work was Created (Amazon,) author Bill Bernstein illustrates how the prosperous west got that way and presents a hypothesis on how growth happens.

Prosperity flows naturally once a society acquires the four crucial factors—property rights, scientific rationalism, capital markets, and modern transportation and communication.

The wretched masses of the third world suffer not because they are deficient in factories and machines but because they lack institutions—property rights, a scientific outlook, and capital markets—while at the same time their countries experience explosive population growth from their glancing encounter with the advances of modern medicine.

It is a fascinating book and you should read it even if your interest in developmental economics is tepid, at best.

Recommendation: Must Read.

Book Review: Where Good Ideas Come From

In Where Good Ideas Come From: The Natural History of Innovation (Amazon,) author Steven Johnson lays out a big-picture of how ideas are formed and how to setup an environment that fosters innovation.

Readers in a hurry can stick to the last chapter of the book. That’s pretty much where the meat of the book is.


  • It is important to just get started solving a problem. And do it publicly if possible. You may not solve the problem you set out initially but along the way, you will find a solution to something else entirely.
  • Error often creates a path that leads you out of your comfortable assumptions. Being right keeps you in place. Being wrong forces you to explore. Some of the most important innovations in history have taken a long, messy torturous path.
  • Markets allow good ideas to erupt anywhere in the system. The decentralized pricing mechanism of the marketplace allows an entrepreneur to gauge the relative value of his or her innovation. If you come up with an interesting new contraption, you don’t need to persuade a government commission of its value. You just need to get someone to buy it.

Recommendation: Worth flipping through.

Book Review: Business Adventures

Business Adventures (Amazon,) is a collection of stories written by longtime New Yorker contributor John Brooks that capture the zeitgeist of the late 60’s.

It is dated and most of the stories are quite boring. And the few interesting ones, like the Piggly Wiggly short squeeze or the Ford Edsel disaster, have been discussed ad infinitum.


Most nineteenth-century American fortunes were enlarged by, if they were not actually founded on, the practice of insider trading. Not until 1910 did anyone publicly question the morality of corporate officers, directors, and employees trading in the shares of their own companies, not until the nineteen twenties did it come to be widely thought of as outrageous that such persons should be permitted to play the market game with what amounts to a stacked deck, and not until 1934 did Congress pass legislation intended to restore equity.

Recommendation: Avoid.

Book Review: Transaction Man

In Transaction Man: The Rise of the Deal and the Decline of the American Dream (Amazon,) author Nicholas Lemann makes a case for building a plural democracy. Did it have to be a book? Probably not.

The money quote:

Embracing pluralism has to begin with a kind of radical humility. It’s human nature, especially for people who think of themselves as educated, sophisticated, and public-spirited, to believe that what you want the world to look like is a broad, objectively determined meliorist plan that will help everyone.

Pluralism requires accepting a degree of messiness, squabbling, pettiness, and bargaining in the governing of a society: these things are a feature, not a bug. People have a strong and often demonstrated tendency to try to settle their differences through violence. Pluralism means to redirect this tendency into managed, nonviolent conflict. It imagines a system of groups endlessly in vigorous contention. No one group should be able to establish its dominion over the others, either out of selfishness or in the conviction that it represents some inarguably right outcome. There is no such thing as a commonsense solution to a major problem, one that is good for everyone.

Pluralism treats democratic processes, not particular outcomes, as moral absolutes.

The economic system, since the Industrial Revolution, has periodically generated extreme concentrations of power and wealth. Imbalances in economic power always turn into imbalances in political power, unless the political system forcibly corrects them. Concentrations of power always wind up harming people, no matter how benign the holders of power believe themselves to be.

The book meanders between trying to be a history lesson and an NYT human interest piece.

Recommendation: Avoid.