Posted by: NC | November 20, 2008

Economics of spam

As seen on Freakonomics:

Since last Wednesday, the torrent of junk e-mail coursing through the internet has been slowed dramatically, with 40 percent or more of it cut off at the source.

The source of all that spam? San Jose, California. That’s where a group of servers responsible for much of the world’s spam had been operating until they were severed from the internet last week.

The servers had controlled some of the world’s biggest botnets, the legions of hijacked personal computers that flood your inbox with ads for male-enhancement drugs.

The shutdown could be a major blow to spammers’ finances. Every day the botnets remain down means revenue lost. But how much revenue?

Nobody knows for sure, but a team of computer scientists at U.C. Berkeley with an ingenious plan recently reported the first-ever hard numbers on the economics of spam.

After taking over part of an existing botnet, the Berkeley team waged its own spam campaign, sending out almost 350 million pieces of junk e-mail over 26 days. By the end of their trial, they had netted a whopping 28 sales. That’s about one response for every 12.5 million e-mails sent, a conversion rate of less than 0.00001 percent.

They estimate the yearly revenue of the botnet they had infiltrated at around $3.5 million (their full paper is available here).

To put that in perspective, spam costs U.S. companies $33 billion a year in lost productivity, according to one estimate, and $100 billion worldwide.

That means it seems likely the spam industry generates far less wealth than it destroys.

But the parasitic scam will remain with us as long as one in every 12 million or so of us buys the product they’ve been spammed for.

So what are the characteristics of the 28 good souls who decide to click on through and make a purchase?

* * * * *

Posted by: NC | November 20, 2008

A weird Firefox upload/download problem (solved)

This morning, my Firefox started acting up. It would freeze when I attempt to upload a file or use the right-click Save As… functionality. Upon a closer look, however, it turned out it wasn’t really freezing, but taking a very long pause; eventually, the File Upload or Save As… (as the case may be) dialog would be displayed.

It turns out that the reason for this behavior is that I recently downloaded to (or uploaded from) a location that is no longer accessible. In my case, it was a folder on a network share, but I would guess something like this could also happen with a removable storage device, such as an external hard drive or a Flash drive. So Firefox was essentially trying to access the location it accessed before, taking its time to repeatedly try it and eventually failing.

Now that I understood what the problem really was, fixing it was a matter of seconds. I typed about:config into the Firefox address bar, scrolled down to browser.download.lastDir configuration variable (highlighted in the picture below), and changed it from its old value (which was something like \\myServer\myFolder) to C:\temp, which was a name of a directory that exists on my system.

Firefox config window

Problem solved…

Posted by: NC | November 14, 2008

Meanwhile, in Mexico…

How Options Saved Mexico’s Budget
Nov-14-2008 | Source: Futures and Options Intelligence

The news that Mexico has locked in prices of at least $70 a barrel for 90% of next year’s oil exports has surprised many traders, and demonstrated the depth of the oil derivatives markets.

If reports are correct, Mexico has protected $37bn of revenue from oil sales, vital to its 2009 budget, at a cost of just $1.5bn. It is believed to have done so, far-sightedly, in late September and early October, while oil was falling from about $120 towards $90.

The government has already revised its budget, lowering its oil price target from $80 to $70.

With oil now dropping through $60, the country’s budget would have been devastated if it had not hedged so much of its production and if prices stay low. Oil revenues make up nearly 40% of public sector income.

By warding off this disaster, Mexico will likely have protected the public finances, its credit rating, its currency and its stockmarkets.

Moreover, Mexico used put options for the hedge, so that it will still be able to benefit if oil prices go high again, by choosing not to exercise its options.

News of the transaction appears to have broken in Reforma, a Mexican newspaper, on November 6.

The story was based on a footnote in the finance ministry’s quarterly report for the third quarter of 2008, saying that Ps15.5bn ($1.5bn) was spent from the country’s $10bn oil stabilisation fund on “financial investments, as part of the measures taken for risk management, and the payment of fees to the trustee and its auditors/advisors”.

It was then picked up by a team of UBS analysts in Mexico City, including strategist Tomás Lajous, who wrote a detailed and apparently well informed report on the deal the same day.

On November 11 the Financial Times reported the story, adding that Barclays Capital and Goldman Sachs had arranged the hedge.

Those banks have declined to comment, as has the Mexican Treasury. Deutsche Bank and Morgan Stanley are said to have participated in Mexico’s oil hedging programme in the past, but this could not be confirmed – nor is it clear why they were not involved this time.

Lajous believes the transaction was arranged privately in the over-the-counter market. The banks would then have hedged their own exposure in the open market.

Lajous estimates Mexico hedged about 90% of its annual production, expected to be 533m barrels, or 1.46m barrels per day (bpd).

He calculated the cost at $1.5bn, based on the Treasury report and the fact that in the past, Mexico has usually spent about $500m to hedge 20%-30% of its production.

That would mean the country bought put options for 480m barrels, which Lajous believes were at strike prices of $70-$100.

Based on options at $70 for a barrel of Mexican crude oil mix, equivalent to $82 for West Texas Intermediate, the hedge will be profitable for Mexico if WTI oil trades next year at any level below $80. In other words, the higher revenues Mexico obtains by selling through the options rather than in the open market will exceed the $1.5bn option cost.

Between $80 and $85 for WTI, the option cost will exceed any gain – above $85, the revenue from selling oil at higher prices again pays for the option cost and leaves a profit.

But this analysis clouds the real virtue of the hedge, which Lajous calculates is to lock in a maximum revenue shortfall, compared to budget, of $3bn, including the option cost, even if WTI oil falls to $40.

That cost is 7% of budgeted oil revenues. Without the hedge, at $40 a barrel for WTI, Mexico would lose 59% of its budgeted oil revenue.

Yet if oil goes back to $100 or $120, Mexico will still make $10bn-$20bn of extra revenue, and only give up $1.5bn of this.

The urgency of hedging is even more clear when one recognises that Mexico’s oil production – the sixth largest in the world – is falling steeply. In 2006 the country pumped 1.6m bpd. This dropped to 1.4m last year and is projected by some to fall to 0.9m in the coming years.

“A few years ago Mexico had more leverage to impact the market. But with demand rising and production on the low, after 2010 Mexico may no longer be an exporter of oil,” said Adam Sieminski, chief energy economist at Deutsche Bank. “It is no surprise that the Mexican government wants to see how much revenue it can get by selling oil, even just for forecasting purposes. It makes sense to do this.”

Food for thought

That Mexico was able to execute such a beneficial hedge on such a large scale may change the way other producers operate, and make market participants reconsider some of their assumptions.

If Goldman Sachs and Barclays Capital were indeed hedging their options during the last week of August and first half of September, that would coincide with a period of steeply falling oil prices.

Lajous analyses the six month out WTI future, which slid from about $118 to $91 in that time, before rebounding to nearly $110.

He argues this pattern of trading “supports the view that the hedge took place (and confirms oil market trading comments from the time, which suggested that a LatAm producer was involved in transactions that put pressure on the futures curve)”.

Raymond Carbone, president of Paramount Options in New York, told FOi: “There were clear signals that an oil producer was hedging over the summer. The December 2009 contract experienced a surge in volumes.”

Carbone believes Mexico’s hedging could have added some downward pressure to oil prices as the banks involved would have been pushed to sell the commodity in the derivatives markets to manage their risk.

But there is strong reason to believe that the mid-September bounce in the crude oil price was caused partly by US oil refiners being caught with an oil shortfall in the wake of Hurricanes Gustav and Ike (see the link below to Futures and Options Intelligence’s story on September 30).

And after the bounce, oil resumed its steady downward course until it sank below $70 in late October.

So there would seem to be little evidence that Mexico’s trading affected prices substantially.

The average daily trade in Nymex’s Light Sweet Crude Oil future was 504,000 contracts in August and 550,000 in September, representing about 500m barrels of oil a day for all delivery dates.

The corresponding option trades about one fifth as much: 111,000 in August and 146,000 in September, or roughly 100m barrels a day.

If the hedging was spread out over three weeks, it would therefore have constituted about 30% of daily trading in the WTI options markets, or 6% of the futures market – perhaps enough to move a placid market, but not one in which sentiment was being whipped by contrasting forces of economic gloom and hurricane damage.

However, stealth must have been an important part of the trade’s success. If the market had seen the two banks coming with $37bn of hedging to do for Mexico, it could not have got such good pricing.

“They have to be careful how they do this,” said Michael Wittner, global head of oil research at Société Générale. “They don’t want to sell too much or there will be too much downward pressure – they will end up shooting themselves in the foot.”

Mexico is said to be among the oil producing countries that is fairly transparent about its hedging strategy, while others are more secretive.

It will be a high priority for oil strategists to discover in the coming months how successful other nations and large oil companies have been at protecting themselves from what is already a savage fall in the oil price.

Posted by: NC | November 9, 2008

Paul Krugman on the New Deal

Paul Krugman writes:

 Everybody’s talking new New Deal these days — and, predictably, the FDR-haters are out in force, with all the usual claims about FDR having actually made the Great Depression worse. (To the right, way back when, FDR was “That Man.” Now Obama is “that one.” Interesting.)

Eric Rauchway is all over this. Basically, the anti-FDR argument on the data is based on (a) considering people employed by the WPA “unemployed” (even though they were getting paid, and building public works that are in use to this day) plus (b) always focusing on 1938 — the year in which the economy suffered a serious setback from the progress of the previous four years.

Let me offer two pictures, beyond what Eric provides, to clarify things.

First, here’s real GDP (in logs) from 1929 to 1941, plus the trend. (That’s to bypass the employment nonsense). You can see that the economy made up a lot of the output gap before the 1938 setback, but by no means all.

Potential vs. actual GDP

Now, you might say that the incomplete recovery shows that “pump-priming”, Keynesian fiscal policy doesn’t work. Except that the New Deal didn’t pursue Keynesian policies. Properly measured, that is, by using the cyclically adjusted deficit, fiscal policy was only modestly expansionary, at least compared with the depth of the slump. Here’s the Cary Brown estimates, from Brad DeLong:

Deficit as a share of potential GDP

Net stimulus of around 3 percent of GDP — not much, when you’ve got a 42 percent output gap. FDR might have been more of a Keynesian if Keynesian economics had existed — The General Theory wasn’t published until 1936. Note in particular that in 1937-38 FDR was persuaded to do the “responsible” thing and cut back — and that’s what led to the bad year in 1938, which to the WSJ crowd defines the New Deal.

Implications for Obama: be inspired by FDR, but don’t imitate him slavishly. In particular, your economic policy should be bolder, not more cautious.

 * * * * *

Posted by: NC | November 3, 2008

Sean Masaki Flynn explains author’s compensation

Sean Masaki Flynn, author of Economics For Dummies, answers a reader’s question on Freakonomics:

Q: Roughly what does one make for writing a Dummies book, and is it a more lucrative endeavor (in terms of dollars per hour) than the textbook route?

A: Author royalties are very paltry — both for textbooks and for other books. A typical royalty rate would be 6 percent or so of what the publisher can sell the book for at wholesale. That amount is typically half of the cover price. So if you see a hardcover selling for $30, the publisher probably got $15 at wholesale. So then 6 percent of that $15 would be only 90 cents. Then your literary agent will take 15 percent of that. So you are left with just 77 cents per copy.

And a book is considered a good seller if it sells 5,000 copies. Most sell far fewer. So basically, there is no money in publishing unless you can sell a lot of books.

Sadly, I am not J.K. Rowling.

* * * * *

Posted by: NC | November 3, 2008

TED spread madness

TED spread shot to all-time high in October, and then “subsided” to the level of ordinary panic:

TED spread

Posted by: NC | November 3, 2008

Include_HTML plugin: not-so-neat tricks

A question hoisted from comments:

I really want to use this plugin, seems perfect for me, but it doesnt seem to allow forms to work on the pages that are included. Is this possible? These are forms that would normally post to themselves.

There are options here, none of which is particularly elegant. Include_HTML was written to access content (including content from remote sites), not functionality…

One option is to include an iframe, show the form in that iframe and set the form’s target attribute to that same iframe. So when the form posts, only the iframe is updated. A slight variation of this approach is to write the included page as an AJAX client, so that it posts and updates without refreshing the whole WordPress page. This, by the way, is the approach used by the Contact Form plugin by Takayuki Miyoshi, which you can observe in action on the Contact page of this site.

Another way is to simply POST to the true location of the form and at the end of processing redirect back to the POSTing page (whose URL should be available as $_SERVER['HTTP_REFERER']).

But the most radical solution is simply to rewrite the plugin, requiring it to include() code rather than accessing content via file_get_contents().

Posted by: NC | October 16, 2008

Paul Krugman on Paul Krugman’s contributions

Paul Krugman writes:

Really, I don’t want to talk about me when the world is melting down, but I have had a number of requests for an informal explanation of what I got you-know-what for. So here’s an attempt.

It’s really about two related things: the “new trade theory” and the “new economic geography.”

OK, so what was the “old” trade theory? It’s what you probably learned if you took intro economics. Countries are different – they have different levels of productivity in particular industries, they have different resources, and those differences drive trade. Tropical countries grow and export bananas, temperate countries grow and export wheat. Countries with highly educated workers export high-tech goods, countries with less educated workers export shirts and pajamas.

The new trade theory starts with the observation that while this explains a lot of world trade, it also misses a lot. France and Germany sell lots of stuff to each other, even though they have similar climates and resources; so do the United States and Canada. What’s that about?

The answer is that there are many goods that aren’t like wheat or bananas, but are instead like wide-bodied jet aircraft. There are only a few places in which wide-bodied jets are produced, because of the enormous economies of scale – you only want a couple of factories worldwide. Those factories have to be somewhere, and those countries that get the factories export jets, while everyone else imports them.

But who gets the aircraft factories, or the factory producing a specialized kind of machine tool, or the plant producing a particular model of car that selected consumers all over the world want? The answer of new trade theory – and it was a tremendously liberating answer – is that it doesn’t matter. There are many economies-of-scale goods; everyone gets some of them; and the details, which may be largely a story of historical accident, aren’t important.

What matters, instead, is the overall pattern of trade: the broad pattern of what countries produce is determined by things like resources and climate, but there’s a lot of additional specialization due to economies of scale, and there’s much more trade, especially between similar countries, than you would expect from a purely resource-based theory.

You may think all this is obvious, and it is – now. But it was totally not obvious before 1980 or so – except for some prescient quotes from Paul Samuelson, you really can’t find anyone describing trade this way until after the theory had been laid out in mathematical models. The plain English version came later.

And you should bear in mind that economists have been thinking and writing about international trade for a couple of centuries; to come along and say, “Hey, we’ve been missing half the story” was a pretty big thing.

Now, on to geography. A decade after the original new trade stuff, I started thinking about what happens when some (but not all) economic resources, especially labor and capital, can move. In the world of the old trade theory, “factor mobility” was a substitute for trade: if factories and industrial workers can move freely, they’ll spread out to be close to the farmers, and neither food nor manufactured goods will have to be shipped long distances. But in the economies-of-scale world I had been studying, the “centrifugal” effect of widely dispersed resources, which tends to push economic activity into spreading out, would be opposed by the “centripetal” pull of access to large markets, which tend to promote concentration of economic activity.

Think of Henry Ford and his Model T. He could have established many factories, spread across the country, to be close to his customers. Instead, however, he found that it was worth incurring extra shipping costs to achieve the economies of scale of one big factory in Michigan.

And once you’re concentrating production in a limited number of locations, which locations will you choose? Locations where there’s a large market – which will be locations where lots of other producers have also chosen to concentrate their production. If the centripetal forces are strong enough, you’ll get a cumulative process: regions that for historical reason have a head start as centers of production will attract even more producers, becoming the economic “core” while other areas become the “periphery.” Thus for about a century, until the rise of the Sunbelt, the great bulk of U.S. manufacturing was crammed into a fairly narrow belt from New England to the inner Midwest; today, 60 million people live along a narrow stretch of the East Coast. Those 60 million people aren’t there because of the scenery; each of them is there because the other 60 million people are also there.

The same sort of logic explains why particular industries concentrate in certain locations, except that in such cases the logic involves things like a deep labor market for specialized skills and a good market for suppliers of specialized inputs. What determines which industry locates where? Often, accident: Silicon Valley owes its existence in large part to a couple of guys named Hewlett and Packard, who started some stuff in their garage, New York is New York because of a canal that only pleasure boaters use today.

Again, this may seem obvious, and it is now – but it wasn’t before 1991 or so. As with trade, the plain English version was possible only after the mathematical models had been worked out.

You may ask, where’s the policy implication of all this? Actually, the policy morals are fairly subtle – for example new trade theory does suggest a possible role for government interventions, but also suggests bigger gains from trade liberalization. Mainly my work in trade and geography was about understanding the world, not driving a political agenda.

So that’s what it was all about.

Add: Requests for public domain copies of the key papers cited. Here’s the 1980 paper; here’s the 1991 paper. Both pdf.

Great summary, methinks…

Posted by: NC | October 13, 2008

And this year’s Nobel in Economics goes to…

Paul Krugman! Although I must admit that his work on currency crises, in my opinion, was more than a mere footnote to his achievements in integrating trade theory and economic geography. But then again, maybe I am reading too much between the lines of the Nobel Prize Committee backgrounders. At any rate, congratulations to Dr. Krugman!

Posted by: NC | September 25, 2008

Applying case formatting in Excel

A question from Askville:

Excel question – is there any way to apply a function in place?

A couple of examples – I have a cell that is in lower case and I want it to be upper case. Can I apply that function to the cell? or do I have to create another column, apply the function there, copy and paste special:values to get the cell in the format I want? Or taking a cell with a name in it that isn’t “proper” – can I do that against the existing cell without having to go through all those other convulsions?

You can, but you’ll need to write a macro to do it. Something along these lines:

Sub ApplyUpper()
  For Each Cell In Selection
    Cell.Value = UCase(Cell.Value)
  Next Cell
End Sub

Sub ApplyProper()
  For Each Cell In Selection
    Cell.Value = StrConv(Cell.Value, vbProperCase)
  Next Cell
End Sub

« Newer Posts - Older Posts »

Categories