Monthly Archives: December 2007

Brad DeLong on Financial Crises

Brad DeLong writes:

A full-scale financial crisis is triggered by a sharp fall in the prices of a large set of assets that banks and other financial institutions own, or that make up their borrowers’ financial reserves. The cure depends on which of three modes define the fall in asset prices.

The first — and easiest to handle — mode is when investors refuse to buy at normal prices not because they know that economic fundamentals are suspect, but because they fear that others will panic, forcing everybody to sell at fire-sale prices.

The cure for this mode — a liquidity crisis caused by declining confidence in the financial system — is to ensure that banks and other financial institutions with cash liabilities can raise what they need by borrowing from others or from central banks.

This is the rule set out by Walter Bagehot more than a century ago: Calming the markets requires central banks to lend at a penalty rate to every distressed institution that would be able to put up reasonable collateral in normal times.

Once everybody is sure that, no matter how much others panic, financial institutions won’t have to dump illiquid assets at a loss, the panic will subside. And the penalty rate means that financial institutions can’t profit from the investment behavior that left them illiquid — and creates an incentive to take due care to guard against such contingencies in the future.

In the second mode, asset prices fall because investors recognize that they should never have been as high as they were, or that future productivity growth is likely to be lower and interest rates higher. Either way, current asset prices are no longer warranted.

This kind of crisis cannot be solved simply by ensuring that solvent borrowers can borrow, because the problem is that banks aren’t solvent at prevailing interest rates. Banks are highly leveraged institutions with relatively small capital bases, so even a relatively small decline in the prices of assets that they or their borrowers hold can leave them unable to pay off depositors, no matter how long the liquidation process.

In this case, applying the Bagehot rule would be wrong.

The problem is not illiquidity but insolvency at prevailing interest rates. But if the central bank reduces interest rates — and credibly commits to keeping them low in the future — asset prices will rise. Thus, low interest rates can make the problem go away, while the Bagehot rule — with its high lending rate for banks — would make matters worse.

Of course, easy monetary policy causes inflation, and the failure to “punish” financial institutions that exercised poor judgment in the past may lead to more of the same in the future. But as long as the degree of insolvency is small enough that a relatively minor degree of monetary easing can prevent a major depression and mass unemployment, this is a good option in an imperfect world.

The third mode is like the second: A bursting bubble or bad news about future productivity or interest rates drives the fall in asset prices. But the fall in values is larger. Thus easing monetary policy won’t solve this kind of crisis, because even moderately lower interest rates cannot boost asset prices enough to restore the financial system to solvency.

When this happens, governments have two options. First, they can simply nationalize the broken financial system and have the Treasury sort things out — and ideally reprivatize the functioning and solvent parts as rapidly as possible. Government is not the best form of organization for financial intermediation in the long term, and even in the short term it is not very good. It is merely the best organization available.

The second option is simply inflation. Yes, the financial system is insolvent, but it has nominal liabilities and either it or its borrowers have some real assets. Print enough money and boost the price level enough, and the insolvency problem goes away without the risks entailed by putting the government in the investment and commercial banking business.

The inflation may be severe, implying massive unjust redistributions and at least a temporary grave degradation in the price system’s capacity to guide resource allocation. But even this is almost surely better than a depression.

Since late summer, the US Federal Reserve has been attempting to manage the slow-moving financial crisis triggered by the collapse of the US housing bubble.

At the start, the Fed assumed that it was facing a first-mode crisis — a mere liquidity crisis — and that the principal cure would be to ensure the liquidity of fundamentally solvent institutions.

But the Fed has shifted over the past two months toward policies aimed at a second-mode crisis — more significant monetary loosening, despite the risks of higher inflation, extra moral hazard and unjust redistribution.

As Fed Vice Chair Don Kohn recently put it: “We should not hold the economy hostage to teach a small segment of the population a lesson.”

No policymakers are yet considering the possibility that the financial crisis might turn out to be in the third mode.

* * * * *

It’s the exports, stupid…

Paul Krugman writes:

The housing bust has lived up fully to my expectations. So far, however, the economy has held up surprisingly well (ask me again in a few months). How come?

It’s the exports, stupid.

I haven’t seen this chart published elsewhere, but it seems to me that it tells the story. The blue line shows residential investment as a share of GDP (left scale). It has plunged impressively. The red line shows exports as a share of GDP (right scale). Thanks to the weak dollar, they’ve risen almost enough to offset the housing plunge.

Meanwhile, consumer spending has held up, and there has been a modest plus from state and local government spending.

No particular policy moral here, just an observation.

Converting MySQL data into CSV

A question from alt.php:

How to convert MYSQL data result to csv file format.

The high-performance solution is to run a SELECT INTO OUTFILE query:

The drawback of this approach is that the CSV file can only be created on the machine where MySQL server is running, which may or may not be feasible in your particular case.

The alternative is to simply dump the data into a file:

// Assume that the DB connection has already been established...
$result = mysql_query('SELECT * FROM myTable');
$fp = fopen('data.csv', 'w');
if ($fp == false) {
  die("Could not open data.csv for writing");
while ($record = mysql_fetch_row($result)) {
  fputcsv($fp, $record);

Note that fputcsv() is available only since PHP 5.1, so you may have to write your own CSV formatter if you have an earlier version of PHP…

* * * * *

A related question from another poster:

i added a link to download the file created with the url of the file. when i run it on my wamp server i click on the link and it prompts me to save the file, when i run it on my web server the csv opens in the browser instead of prompting to save the file.

any idea of how to solve this?

does it have to do with the php.ini settings?

No, it has to do with HTTP headers Web servers send out before serving actual data.

How do you solve this? By writing a script that would send the appropriate headers and then dump the data. Let’s assume that, in line with the previous example, you have created a file called data.csv. Now you can write a script that will serve this data and suggest to the browser that the data is to be saved as data.csv rather than viewed in the browser:

header('Content-type: application/');
header('Content-disposition: attachment; filename=data.csv');

Note, however, the word “suggest” above; the browser may choose to ignore the “Content-disposition:” header and still display data in browser of save it under the script’s name rather than as data.csv…

Coding from scratch vs. implementing third-party applications

A question from comp.lang.php:

php has several open-source system and some are free like oscommerce,etc. what is most advisable if you have a new project should you go for open source or create the project from scratch?

First of all, there are three options, not two:

  1. Code from scratch
  2. Code from scratch using a third-party foundation library or framework
  3. Implement (and possibly extend) an open-source application

In my opinion, you should choose option 3 when the open-source application closely matches the needs of the project and there are time and/or budget constraints. For example, if you want to put together a community site and you have a week to do it, you should consider Drupal. (Not to mention situations where you need to deploy a blog in two hours; try beating WordPress under those circumstances…)

The choice between 1 and 2 is largely personal; use of third-party tools can increase your productivity only if you understand them well. On the other hand, some third-party tools can increase programmer’s productivity by using techniques hindering the application’s performance, so, again, you need to understand the way those tools work…

Arbitrage opportunities in European rights offerings

From Institutional Investor:

The Rights Stuff

19 Dec 2007
Eric Uhlfelder

Rights offerings and other foreign corporate actions can sometimes create remarkable opportunities for U.S. investors.

It will be months, if not years, before it becomes clear whether a Royal Bank of Scotland–led consortium secured a good deal with its record €71.1 billion ($104 billion) takeover of ABN Amro Bank in October. But the acquisition has already created a juicy opportunity for canny U.S. investors.

Fortis, the Belgian-Dutch insurance and banking group that is taking ABN Amro’s domestic Dutch banking business as part of the deal, financed its share of the takeover by making a €13 billion rights offering. The September issue created a quick windfall for buyers of Fortis’s American depositary receipts because of a pricing anomaly between those ADRs and the group’s Brussels- and Amsterdam-listed ordinary shares. What’s more, the growing number of rights issues by international companies can offer similar arbitrage possibilities to investors, fund managers say.

Ed Cofrancesco, president of Orlando, Florida–based broker-dealer International Assets Advisory, which has $300 million under management, took advantage of the Fortis rights issue immediately after the company’s ordinary shares went ex-rights on September 25. The ordinaries opened down €4.20, or 16.6 percent, from the previous day’s close of €25.30, reflecting the loss of the right to buy new shares. The ADRs, however, opened just $2.15, or 6.1 percent, lower than the previous day’s close of $35.40, then proceeded to sink to an intraday low of $28.50 before recovering to close at $33.25.

“Market makers were pricing the ADRs as though they had gone ex-rights as well,” recalls Cofrancesco, “but ADRs typically go ex-rights weeks after the ordinaries do because of the time it takes the respective U.S. depositary to determine the value of the rights.”

The reason for this time lag, explains Claudine Gallagher, global head of depositary receipts at JPMorgan Chase & Co. in New York, is that most rights offerings for international companies are not registered in the U.S. This means that American investors can’t purchase the new shares. But the participating depositary still receives the rights and then sells them abroad on the secondary market during the time in which the rights trade — a period that typically runs several weeks. “Only after we sell all these rights and repatriate the proceeds into dollars can we determine their value for U.S. investors and set a record date,” explains Gallagher. “Until this is done, the ADRs trade with rights.”

Cofrancesco began buying the ADRs when he saw the price drop below $29, then sold out of his position later the same day after the price rebounded to $33, earning a profit of nearly 15 percent in a matter of hours.

Such quick returns on foreign rights issues aren’t unusual, says Christopher Meyers, a former market maker who now runs the New York–based investment partnership Q 4 General Partners. “It takes time,” he says, “for investors to discern the value of certain corporate actions across markets, especially when one of the two may be closed and when fungibility is suspended — as is the case after local shares go ex-date.”

Investors have a good shot at finding arbitrage opportunities, given the tremendous growth in rights offerings. The value of non-U.S. rights issues this year through mid-November soared to $78.1 bil­lion, compared with $56.5 bil­lion in all of 2006 and just $26.1 billion in 2002, according to data provider Dealogic.

Meyers believes arbitrage possibilities are more pronounced when they involve Pink Sheets–traded ADRs, the pricing of which is dependent upon market makers. Their pricing programs often do not take account of rights issued because there’s no data to input, explains Meyers.

Spin-offs and regular dividend payments can also create arbitrage windows, Meyers says. An example was Volvo’s 2004 spin-off of its 24.8 percent stake in truck maker Scania into a new holding company, Ainax. At the time, Volvo’s ADRs, listed on the Nasdaq Stock Market, were trading below the implied value of its ordinary shares plus the spin-off.

“The deal was a bit complicated, with investors having been offered two shares of Ainax,” Meyers recalls. “But the implied value of the ADRs became increasingly transparent as Ainax began trading publicly in Stockholm before Volvo’s ADRs went ex.” On June 4, eight days after the Swedish shares went ex-rights, the shares plus the spin-off were worth the equivalent of $35.31, but Volvo’s ADRs traded down to an intraday low of $33.69. Going long the ADRs and short the ordinary shares secured a profit of 4.5 percent in less than two weeks. Meyers surmises that many institutional investors were doing just that as ADR daily trading volume soared tenfold between the two ex-dates.

Joshua Duitz, a research analyst at Alpine Woods Capital Investors and a former trader at Bear, Stearns & Co., says that rights arbitrage opportunities can also be found with ADRs listed on the New York Stock Exchange. British water company United Utilities raised £1 billion ($1.57 billion) in a two-tranche rights issue that began in 2003. On the day the shares went ex-rights, the company’s Big Board–traded shares moved down as well, falling from the previous day’s close of $17.21 to an intraday low of $16.10. With the ADRs still trading with rights, their implied value based on the local share price plus the rights was $17.34. Five days later, while London shares remained flat, the ADRs traded $1.47 higher.

“The instantaneous flow of information across the globe and the inherent pricing inefficiencies between markets makes arbitrage possible,” observes IAA’s Cofrancesco. The increasing size and number of offerings is expanding the opportunities for investors who want to do the homework.

Quotes from Keynes

This page will probably expand over time, but here’s a first couple. While I am at it, here’s a link to the full text of The General Theory of Employment, Interest and Money at University of Adelaida in Australia…

To say that net output to-day is greater, but the price-level lower, than ten years ago or one year ago, is a proposition of a similar character to the statement that Queen Victoria was a better queen but not a happier woman than Queen Elizabeth—a proposition not without meaning and not without interest, but unsuitable as material for the differential calculus.

(The General Theory, Chapter 4)

…the ideas of economists and political philosophers, both when they are right and when they are wrong, are more powerful than is commonly understood. Indeed the world is ruled by little else. Practical men, who believe themselves to be quite exempt from any intellectual influences, are usually the slaves of some defunct economist. Madmen in authority, who hear voices in the air, are distilling their frenzy from some academic scribbler of a few years back. I am sure that the power of vested interests is vastly exaggerated compared with the gradual encroachment of ideas. Not, indeed, immediately, but after a certain interval; for in the field of economic and political philosophy there are not many who are influenced by new theories after they are twenty-five or thirty years of age, so that the ideas which civil servants and politicians and even agitators apply to current events are not likely to be the newest. But, soon or late, it is ideas, not vested interests, which are dangerous for good or evil.

(The General Theory, Chapter 24)

* * * * *

A sound banker, alas, is not one who foresees danger and avoids it, but one who, when he is ruined, is ruined in a conventional way along with his fellows, so that no one can really blame him.

* * * * *

Words ought to be a little wild, for they are the assaults of thoughts on the unthinking.

* * * * *

What causes inflation to go up?

A question from Yahoo Answers:

What causes inflation to go up?

Why do prices go up each year, how can we stop it!

Let’s start at the end; why do you want to stop inflation? Inflation pushes savers to invest; without inflation, savers might just hoard money…

Also, there are more important things than inflation (most notably, unemployment). In the pre-euro years, many European central banks (most notably, Germany’s Bundesbank) were known as tough inflation fighters; but their countries were known as places where unemployment tended to stay in double digits. By cracking down on inflation, those central banks increased unemployment…

As to why prices go up, recall the Hume-Fisher equation of exchange:

MV = PQ,

where M is money supply,
V is money velocity,
P is price level, and
Q is real GDP

If you rewrite the equation:

P = MV / Q

you can easily see that prices can go up for three reasons: (1) an increase in money supply, (2) an increase in money velocity, and/or (3) a decrease in real GDP.

In practice, expansion of the money supply is the most significant source of inflation. Every once in a while, when inflationary expectations run high, you can see money velocity increase; people spend money fast in anticipation of it losing value…