Tweaking
4 Nov 2008, 22:31 PM
I've tweaked my blog 'system' a little bit this afternoon. Instead of being a pile of bash scripts, now it is a pile of bash and perl scripts. Unfortunately, all my blog feeds will be reposted, but on the plus side I now have a copy of all my old posts from various other platorms. Oh, and RSS feeds should now work again. They have been broken since the last time I messed around with the system. I spent a little bit of time writing some javascript to scrape my old blog posts from inside Google Reader, which had the only copy of my old posts from wordpress and blogger.com. There is probably an easier way to extract the posts, but I can always do with some practice on the reverse engineering front.
Ok. That's enough housekeeping. Back to my regular blogging schedule
Comments (5)
What is Obama's Erdos Number?
8 Oct 2008, 15:44 PM
Related Links
24 Sep 2008, 15:28 PM
Let me just reiterate how much I like Amazon's recommendation service. Collaborative filtering at it's finest, if you ask me. Collaborative filtering is the process of using what a system knows about others to make recommendations for an individual. If most people who like A and B also like C, then if you like A and B, you will probably like C. It is a simple concept and it works well in many applications. Netflix implements a similar system, which also looks at people's ratings of the movies that they have rented. If it turns out that I like A and B, but really hated C, the algorithm will find other people like me and perhaps recommend E instead of D.
Most of this is widely known. And then the human interest stories started popping up, the most famous of which covering the 'My Tivo thinks I'm gay' phenomenon:
While these stories are cute, they highlight the pitfalls of making recommendations that just don't fit. I've been noticing more news stories and blogs including related links at the bottom of their posts. They do this to increase the stickiness of their site, by redirecting traffic back to the original web site. It is a nice idea, but with the prevalence of good recommendation technologies, the slightest hint of bad is enough to train users to ignore such related links sections.Mr. Iwanyk, 32 years old, first suspected that his TiVo thought he was gay, since it inexplicably kept recording programs with gay themes. A film studio executive in Los Angeles and the self-described "straightest guy on earth," he tried to tame TiVo's gay fixation by recording war movies and other "guy stuff."
"The problem was, I overcompensated," he says. "It started giving me documentaries on Joseph Goebbels and Adolf Eichmann. It stopped thinking I was gay and decided I was a crazy guy reminiscing about the Third Reich."
Computer generated related links tend to suck because, unlike collaborative filtering, the technology tries to use high-power semantic analysis to understand the text and come up with related articles. And text analysis technology just isn't that good right now. At my firm we use some fairly run of the mill text processing to identify similar companies based on SEC filing text. This tends to work well as we have a large corpus of highly idiosyncratic text to work from. Short blog posts wouldn't work well with simple techniques, so more complex techniques are used. And they suck. Even worse, none of these technologies attempt to use any user feedback to help train the algorithms. I don't want to see explicit, click-here-if-you-think-this-story-is-related buttons, but at least track which links are clicked on to help optimize your algorithms.
My gut feel is that for the developers to prove the value of their technology they are compelled to include related links in as many stories as possible. This is a wrong-headed move. They should only include links when relevance is well established; otherwise users (like myself) will quickly learn to ignore that junk text that appears at the bottom of blog posts and articles. It took me a few days to subconsciously ignore the RSS feed 'flair' at the bottom of most posts. And now that my ignoring neurons are well trained, it took me all of nano-seconds to realize that 'Related Links' are junk.
Related Links: Email this Digg this Stumble it! Share on Facebook Share on MySpace Link to me on LinkedIn
Comments (0)
Interesting paper - The Promise & Perils of Credit Derivatives
23 Sep 2008, 18:21 PM

In this Article, we begin what we believe will be a fruitful area of scholarly inquiry: an in-depth analysis of credit derivatives. We survey the benefits and risks of credit derivatives, particularly as the use of these instruments affect the role of banks and other creditors in corporate governance. We also hope to create a framework for a more general scholarly discussion of credit derivatives.
We define credit derivatives as financial instruments whose payoffs are linked in some way to a change in credit quality of an issuer or issuers. Our research suggests that there are two major categories of credit derivative. First, a credit default swap is a private contract in which private parties bet on a debt issuer's bankruptcy, default, or restructuring. For example, a bank that has loaned $10 million to a company might enter into a $10 million credit default swap with a third party for hedging purposes. If the company defaults on its debt, the bank will lose money on the loan, but make money on the swap; conversely, if the company does not default, the bank will make a payment to the third party, reducing its profits on the loan.
Second, a collateralized debt obligation (CDO) is a pool of debt contracts housed within a special purpose entity (SPE) whose capital structure is sliced and resold based on differences in credit quality. In a cash flow CDO, the SPE purchases a portfolio of outstanding debt issued by a range of companies, and finances its purchase by issuing its own financial instruments, including primarily debt but also equity. In a synthetic CDO, the SPE does not purchase actual bonds, but instead enters into several credit default swaps with a third party, to create synthetic exposure to the outstanding debt issued by a range of companies. The SPE finances its purchase by issuing financial instruments to investors, but these instruments are backed by credit default swaps rather than any actual bonds.
In the Article's first substantive part, we discuss the benefits associated with both types of credit derivatives, which include increased opportunities for hedging, increased liquidity, reduced transaction costs, and a deeper and potentially more efficient market for trading credit risk. We then discuss the risks associated with credit derivatives, such as moral hazard and other incentive problems, limited disclosure, potential systemic risk, high transaction costs, and the mispricing of credit. After considering the benefits and risks, we discuss some of the implications of our findings, and make some preliminary recommendations. In particular, we focus on the issues of disclosure, regulatory licenses associated with credit ratings, and the special treatment of derivatives in bankruptcy.
You can download the paper here. It raises a few of the points I raised in my recent blog post about the lead up to the current mess[1], but does so in greater depth and eloquence.
[1] I think that post got lost in many RSS feeds due to me tweaking with my blog system. It's probably worth a read, and I'd appreciate your feedback.
Comments (0)
Machines
23 Sep 2008, 18:04 PM

Comments (0)
minor repairs
21 Sep 2008, 09:36 AM

I've been fixing a few things with my open-source blogging system. Probably introduced a few more bugs than I fixed.
Comments (0)
My $0.01, levered up 2X
21 Sep 2008, 02:13 AM
This is a bit of a long post. It stems from a conversation with friends last night where I tried my best to explain what is going on with the American financial system. My central theme is the dangers that arise from the decoupling of risk from reward and I take a tour of mortgage brokers and borrowers, accounting standards, credit rating agencies and finally the credit default swap market. The opinions, misunderstandings, gross simplifications, omissions and outright errors in the piece are wholly my own.

Mortgage Risks
Two main risks concern those bankers who originate mortgages: prepayment risk and default risk. Prepayment risk is the chance that during a decline in interest rates, borrowers will pre-pay their mortgages as they refinance at a lower rate. This hurts lenders as they originated the mortgage expecting 30 years of juicy interest payments. If a borrower pre-pays then the lender receives the principal balance, and possibly some fee income, but loses out on the opportunity for future interest income.
Default risk is the chance that a borrower will just stop paying altogether. Lenders would compensate themselves for this risk by looking at the credit rating of the borrower and charging a higher rate for those who show quantitative signs of default risk – as determined by their credit score, income and debt level and the size of the loan relative to the value of the property.
Or at least that is how the models work. At a higher level all risks can be placed on a spectrum from idiosyncratic to the systemic. Idiosyncratic risks are those that arise from situations that only impact the individual borrower, such as falling ill and having medical bills that take priority over mortgage payments. Systematic risks impact the mortgage market as a whole, such as volatility in interest rates. The whole idea of pooling together mortgages is that idiosyncratic risks are uncorrelated. Joe in Montana getting hit by a car is a statistically independent event from June in Miami getting fired. By pooling together these uncorrelated risks, the portfolio of loans has a lower idiosyncratic risk than any individual loan.
The cash flows generated by these pools of mortgages could be then segregated into tranches with different guarantees as to their payment priority. If there were, say, 1,000 loans in the portfolio, each paying $1,000 per month then the total monthly income would be $1m. The highest priority tranche would be set up so that each month $800k of the $1m would be paid out to those holders of the top tranche. Thus it would require 20% of the individual loans to default before the regular flow of $800k per month would be disrupted. Subsequent tranches would have higher risks of defaulting.
This structure meant that the top tranches would end up with a far higher credit rating than any of the individual mortgages, or even a simple pool of mortgages. As highly rated instruments institutions that traditionally were unable to buy assets as risky as mortgages could now enjoy the benefits of higher interest rates on their money whilst maintaining a portfolio of highly rated debt.
Consequently these products were in high demand. Couple this with the desire to allow more Americans to fulfill the dream of home ownership and an environment was created that allowed more and more people to attain mortgages. But somewhere along the line the risk-reward relationship that sits at the cornerstone of capitalism became dislodged.
Brokers + Regulatory Arbitrage
First there were the mortgage brokers. As poorly trained and lightly regulated commission sales agents, their role was to pre-qualify potential borrowers for mortgages. But as their income stream was tied to the number of applicants that passed the qualifications and ended up as borrowers, they had every incentive to make sure that those who applied for loans got them. And as the mortgage brokers bore no personal liability, apart from being charged of criminal mortgage fraud, many bent the rules and flat out lied along with applicants to get these deals done. This is what happens when people with no fiduciary duty are executing large financial transactions. However, on paper fiddling of applicant details wouldn't solve the problem of some of these applicants who simply couldn’t afford the monthly payments. For these borrowers complex ‘option ARM’ mortgages were offered, where initial payments were low but jumped after a certain number of years. These were issued to borrowers on the assumption that house prices would go up, giving borrowers the opportunity to refinance before their payment rates rose.
The brokers bore no liability from qualifying unqualified applicants, as they were not the ultimate source of cash that funded the loan. This cash was sourced by the banks that were happy as long as they could earn higher interest than what was available from other debt instruments with the same credit rating. Even better, from the banks' point of view, was that these mortgage backed securities and collateralized debt obligations were built in the form of special purpose vehicles and, as such, were not consolidated on the banks' balance sheet. If the account rules that govern consolidation of such vehicles sound familiar, you probably are remembering a thing or two from the Enron scandal.
As these new financial instruments weren’t listed on the balance sheet, important leverage ratios were not impacted. Regulation, such as the Basel accord, limits how much debt can be used to finance operations. Off balance sheet financing gave a way to game the system, a game known as regulatory arbitrage. Leverage is great for financial institutions when their bets are working for them. They can juice up their returns, borrowing at X% and earning money at 20 x (Y – X); which is all fine and well when Y is greater than X. It was this strict interpretation of the letter of the law, but not the spirit, that drove the demand for mortgages to be repacked. And as long as the mortgage backed securities received high credit ratings, this was a great way for bankers and brokers to make money whilst giving affordable housing to those who would not usually qualify for loans.
Credit Ratings
But the models that were used, both by the banks and by the credit rating agencies (often working together from the same bed) underestimated the impact of systemic risk. If house prices are artificially elevated by an environment where everyone is suddenly able to qualify for a mortgage due to diminished underwriting standards, then as soon as the music stops home prices should return to their natural, unsubsidized level. And that they did.
Across America home prices began to collapse in 2006 as lenders began to see the impact of the declining quality of borrowers. And anything that has an effect across America is no longer an idiosyncratic risk. Add on to that the fact that many borrowers had borrowed more than their house was worth, under the assumption that home prices would continue to rise, suddenly found themselves owing far more than their house would be worth at any point in the near future. This brought to an end the domestic spending fueled by home equity withdrawals, a significant and growing part of GDP over the past 10 years. At its peak between 2004 and 2006, mortgage equity withdrawals were about 9% of GDP, nearly five times larger than they were just ten years prior.
While corners of the press/punditsphere were predicting a severe decline in house prices, the prognosticators at the credit agencies seemed to lack the same foresight. Even worse, the agencies had no problem with slapping AAA credit ratings on vehicles filled with dodgy loans. Here again we see the consequences of a disconnect between risk and reward. In a situation reminiscent of Arthur Andersen, the consulting / accounting firm that audited Enron's books, the credit rating agencies also provided consulting services. If you were a bank looking to get a AAA rating, the rating agencies were more than happy to provide consulting services to ensure that the rating arm of the firm would get your desired rating.
As an aside, I don't really understand why ratings agencies even exist. Investors are more than happy to do their own leg-work and purchase stock in companies without any seal of approval from third parties.
Credit Default Swaps
There is another piece of the puzzle that also leaves me somewhat confused: credit default swaps. When you decide to loan money to someone, you are at risk of not receiving all of your money back if the other party somehow defaults on the loan. To get around this, you will often charge a higher interest rate to make up for the credit risk. But if you lend them money today, and they go bankrupt tomorrow, then you won't even get your first interest payment. Enter credit default swaps (CDSs).
In a CDS, you essentially buy insurance from a third-party that will pay out if your counter-party (the person you loaned money to) defaults. But CDS's are not regulated as insurance. As a homeowner it is fraudulent to take out multiple policies against your single home. If not, I could insure my house 20 times, burn it down tomorrow and buy 20 more the following day. This isn't the case for credit default swaps. I can buy as many as I like, and insure as much money as I want against the chance of some company going bankrupt. Although not regulated as insurance policies, many insurers got into this game – including AIG. It seemed like a no-brainer, here were companies looking to buy insurance against the possible default of AAA rated companies and bonds. With AAA ratings the purported likelihood of default was de minimus so the insurers were happy to oblige. And so the CDS market grew to cover about 50 trillion dollars worth of insurance - about the same size as the total sum of the entire US corporate bond market.
This worked great for the insurers of mortgage bonds until they started to default. But that's the risk you take as an insurer. However, the dollar value of the insurance can be much larger than the dollar value of the loss when more people are insured against a default than there are counter-parties exposed to that default. This becomes particularly interesting when insuring against corporate bond default. As more and more people buy insurance against the risk of a company going bankrupt, the cost of that insurance goes up – simple supply and demand. And as the cost of insurance goes up, the market perceives a greater risk of default and demands higher interest rates on bonds issued by the target company. Thus the cost of financing goes up and it can get to the point whereby the company's cost of capital is greater than their return on equity, and the company can no longer operate profitably. The more reliant a company is on debt to fund its operations, the more risk they are exposed to from their cost of financing. And companies that rely of high levels of leverage, by definition, are highly exposed to such risks.
And then...
This is what was playing out over the past few weeks. Banks, using their low cost of capital, to trade in highly-(mis)rated mortgage instruments, earned highly levered returns to fuel their profits. Seeing this as a problem, people took the opportunity to buy credit default swaps against these banks, and at the same time short sold their equity to doubly profit from the demise of the bank. Depending on your point of view, this is either capitalism at its finest, preying on the weak to allow the strong to survive. Or it is rampant manipulation, using credit default swaps to force banks into bankruptcy. In reality, it is probably a bit of both.
Short-selling, while still not widely understood by the folk outside of finance, has been blamed by many for the market activity of late. This is like a poor student failing a test and blaming the teacher for making the test too hard. As best as I can tell, there is hardly any impact on a firm's ability to operate in the face of declining stock prices. So unlike speculative purchases of default swaps, which negatively impact a firm's ability to borrow, short-selling stock should not decrease the ability of a firm to continue operating. [See here] Nonetheless, regulators in the USA, the UK and Pakistan(!) have intervened in the market to limit short-selling. But they have done nothing to address the underlying disconnects that led to our current predicament. Credit default swap markets remain lightly regulated and highly opaque.
The Treasury wants to buy up 'toxic' mortgage debt to the tune of half a trillion dollars and while this will probably solve the problem quickly, it may not be the best way of doing so. The way I see it, doing so is simply an extension of the stimulus check program, but with benefits going to the 5 million odd borrowers from the past decade who already spent that money. It is like putting a helicopter in a time machine and handing out free money to those who responded positively to the requests of fraudulent mortgage brokers to lie on their loan applications.
I'm not sure what the right solution is. There probably isn't one. Certainly nothing that won't be painful. But I do hope that capitalism restores the relationship between risk and reward and aligns incentives so that we don't find ourselves in the same miss any time soon.
:wq
Comments (0)
Don't Panic
19 Sep 2008, 21:37 PM
-- John Stuart Mill
Comments (0)
Security Theater
18 Sep 2008, 23:52 PM

In response to my post from earlier today, I repost Bruce Schneier's article from 2007:
January 25, 2007
In Praise of Security Theater
While visiting some friends and their new baby in the hospital last week, I noticed an interesting bit of security. To prevent infant abduction, all babies had RFID tags attached to their ankles by a bracelet. There are sensors on the doors to the maternity ward, and if a baby passes through, an alarm goes off.
Infant abduction is rare, but still a risk. In the last 22 years, about 233 such abductions have occurred in the United States. About 4 million babies are born each year, which means that a baby has a 1-in-375,000 chance of being abducted. Compare this with the infant mortality rate in the U.S. -- one in 145 -- and it becomes clear where the real risks are.
And the 1-in-375,000 chance is not today's risk. Infant abduction rates have plummeted in recent years, mostly due to education programs at hospitals.
So why are hospitals bothering with RFID bracelets? I think they're primarily to reassure the mothers. Many times during my friends' stay at the hospital the doctors had to take the baby away for this or that test. Millions of years of evolution have forged a strong bond between new parents and new baby; the RFID bracelets are a low-cost way to ensure that the parents are more relaxed when their baby was out of their sight.
Security is both a reality and a feeling. The reality of security is mathematical, based on the probability of different risks and the effectiveness of different countermeasures. We know the infant abduction rates and how well the bracelets reduce those rates. We also know the cost of the bracelets, and can thus calculate whether they're a cost-effective security measure or not. But security is also a feeling, based on individual psychological reactions to both the risks and the countermeasures. And the two things are different: You can be secure even though you don't feel secure, and you can feel secure even though you're not really secure.
The RFID bracelets are what I've come to call security theater: security primarily designed to make you feel more secure. I've regularly maligned security theater as a waste, but it's not always, and not entirely, so.
It's only a waste if you consider the reality of security exclusively. There are times when people feel less secure than they actually are. In those cases -- like with mothers and the threat of baby abduction -- a palliative countermeasure that primarily increases the feeling of security is just what the doctor ordered.
Tamper-resistant packaging for over-the-counter drugs started to appear in the 1980s, in response to some highly publicized poisonings. As a countermeasure, it's largely security theater. It's easy to poison many foods and over-the-counter medicines right through the seal -- with a syringe, for example -- or to open and replace the seal well enough that an unwary consumer won't detect it. But in the 1980s, there was a widespread fear of random poisonings in over-the-counter medicines, and tamper-resistant packaging brought people's perceptions of the risk more in line with the actual risk: minimal.
Much of the post-9/11 security can be explained by this as well. I've often talked about the National Guard troops in airports right after the terrorist attacks, and the fact that they had no bullets in their guns. As a security countermeasure, it made little sense for them to be there. They didn't have the training necessary to improve security at the checkpoints, or even to be another useful pair of eyes. But to reassure a jittery public that it's OK to fly, it was probably the right thing to do.
Security theater also addresses the ancillary risk of lawsuits. Lawsuits are ultimately decided by juries, or settled because of the threat of jury trial, and juries are going to decide cases based on their feelings as well as the facts. It's not enough for a hospital to point to infant abduction rates and rightly claim that RFID bracelets aren't worth it; the other side is going to put a weeping mother on the stand and make an emotional argument. In these cases, security theater provides real security against the legal threat.
Like real security, security theater has a cost. It can cost money, time, concentration, freedoms and so on. It can come at the cost of reducing the things we can do. Most of the time security theater is a bad trade-off, because the costs far outweigh the benefits. But there are instances when a little bit of security theater makes sense.
We make smart security trade-offs -- and by this I mean trade-offs for genuine security -- when our feeling of security closely matches the reality. When the two are out of alignment, we get security wrong. Security theater is no substitute for security reality, but, used correctly, security theater can be a way of raising our feeling of security so that it more closely matches the reality of security. It makes us feel more secure handing our babies off to doctors and nurses, buying over-the-counter medicines, and flying on airplanes -- closer to how secure we should feel if we had all the facts and did the math correctly.
Of course, too much security theater and our feeling of security becomes greater than the reality, which is also bad. And others -- politicians, corporations and so on -- can use security theater to make us feel more secure without doing the hard work of actually making us secure. That's the usual way security theater is used, and why I so often malign it.
But to write off security theater completely is to ignore the feeling of security. And as long as people are involved with security trade-offs, that's never going to work.
This essay appeared on Wired.com, and is dedicated to my new godson, Nicholas Quillen Perry.
Comments (0)
Pie
18 Sep 2008, 23:41 PM
Here at i2pi, we feel a strong brotherhood with all things pie, as demonstrated in the image below*:

And as statistics & visualization junkies, we think we have found the only good use for a pie chart:

*: Vegemite & Lentil pie!
Comments (0)












Anonymous - 5 Nov 2008, 21:58 PM
Anonymous - 5 Nov 2008, 23:40 PM
Anonymous - 5 Nov 2008, 23:42 PM
Joshua Reich - 5 Nov 2008, 23:43 PM
Anonymous - 5 Nov 2008, 23:45 PM