Phorgy Phynance

Archive for the ‘VaR’ Category

More fun with maximum likelihood estimation

with one comment

A while ago, I wrote a post

Fun with maximum likelihood estimation

where I jotted down some notes. I ended the post with the following:

Note: The first time I worked through this exercise, I thought it was cute, but I would never compute \mu and \sigma^2 as above so the maximum likelihood estimation, as presented, is not meaningful to me. Hence, this is just a warm up for what comes next. Stay tuned…

Well, it has been over a year and I’m trying to get a friend interested in MLE for a side project we might work on together, so thought it would be good to revisit it now.

To briefly review, the probability of observing N independent samples X\in\mathbb{R}^N may be approximated by

\begin{aligned} P(X|\theta) = \prod_{i = 1}^N P(x_i|\theta) = \left(\Delta x\right)^N \prod_{i=1}^N \rho(x_i|\theta),\end{aligned}

where \rho(x|\theta) is a probability density and \theta represents the parameters we are trying to estimate. The key observation becomes clear after a slight change in perspective.

If we take the Nth root of the above probability (and divide by \Delta x), we obtain the geometric mean of the individual densities, i.e.

\begin{aligned} \langle \rho(X|\theta)\rangle_{\text{geom}} = \prod_{i=1}^N \left[\rho(x_i|\theta)\right]^{1/N}.\end{aligned}

In computing the geometric mean above, each sample is given the same weighting, i.e. 1/N. However, we may have reason to want to weigh some samples heavier than others, e.g. if we are studying samples from a time series, we may want to weigh the more recent data heavier. This inspired me to replace 1/N with an arbitrary weight w_i satisfying

\begin{aligned} w_i\ge 0,\quad\text{and}\quad \sum_{i=1}^N w_i = 1.\end{aligned}

With no apologies for abusing terminology, I’ll refer to this as the likelihood function

\begin{aligned} \mathcal{L}(\theta) = \prod_{i=1}^N \rho(x_i|\theta)^{w_i}.\end{aligned}

Replacing w_i with 1/N would result in the same parameter estimation as the traditional maximum likelihood method.

It is often more convenient to work with log likelihoods, which has an even more intuitive expression

\begin{aligned}\log\mathcal{L}(\theta) = \sum_{i=1}^N w_i \log \rho(x_i|\theta),\end{aligned}

i.e. the log likelihood is simply the weighted (arithmetic) average of the log densities.

I use this approach to estimate stable density parameters for time series analysis that is more suitable for capturing risk in the tails. For instance, I used this technique when generating the charts in a post from back in 2009:

80 Years of Daily S&P 500 Value-at-Risk Estimates

which was subsequently picked up by Felix Salmon of Reuters in

How has VaR changed over time?

and Tracy Alloway of Financial Times in

On baseline VaR

If I find a spare moment, which is rare these days, I’d like to update that analysis and expand it to other markets. A lot has happened since August 2009. Other markets I’d like to look at would include other equity markets as well as fixed income. Due to the ability to cleanly model skew, stable distributions are particularly useful for analyzing fixed income returns.

Daily S&P 500 Value-at-Risk Estimates

with 3 comments

A few people have commented about the methodology used to produce the charts in my last post. Keep in mind, I threw those together quickly for Felix based on charts already put together for a seminar at UCLA. If you want to see what I actually look at on a regular basis, I put the following chart together:


This is the 99%, 1-day VaR using a weighting scheme that places more weight on the most recent data.

Again, note the divergence between the two charts in recent months. Risk systems (like most third party vendors) based on normal distributions are likely indicating that risk continues to decrease. However, the stable distribution indicates the opposite, i.e. risk has begun increasing again.

Written by Eric

August 8, 2009 at 9:49 am

80 Years of Daily S&P 500 Value-at-Risk Estimates

with 10 comments

For Felix:

S&P 500 Daily Value at Risk: Jab 1930 - May 2009

And the last 10 years…


Update: Felix has updated his post with a link to my charts above, but makes some comments that I thought I should address.

If we use a shorter horizon that better captures what is going on at this moment, we see that risk plateaued in June and has actually ticked up significantly in the past several weeks as measured via the “stable” distribution. On the other hand, volatility has actually decreased during the past several weeks. What this means, i.e. the discrepancy between “stable” and “normal” is that the tails have become fatter recently.


Also keep in mind that although risk appears to have decreased since the beginning of the year, it is still at extremely high levels. We would have to go back to 1934 to see comparable risk levels, so it is no time to become complacent.

Written by Eric

August 6, 2009 at 6:32 am

Posted in VaR

Another word for hedged… leveraged

with 2 comments

Market turmoil is still quite fascinating to me and I still believe the current environment will be one for the history books and I’m still trying to take as much as I can from this learning experience.

My professional work experience is in fixed income. For two years, I was very “plugged in” to the markets and was meeting regularly with some of the greatest thinkers out there, but now I’m more of a pure “quant” and most of my news comes from blogs, web news, etc. Unfortunately, I’m not yet spending as much time with the traders as I’d like (but that should change soon I hope). Most of the major news sources, e.g. Bloomberg, seem to concentrate more on equity markets than credit and fixed income. I pay more attention to the Dow now than ever before. That is why I am so perplexed by the stock market. I thought stocks were supposed to be easier than bonds, i.e all the smart guys are in fixed income, right?

So while the credit markets seem to be imploding, stocks are doing just dandy. Maybe people are taking cues from the market cheat sheet?

Anyway, I’ve blabbered quite a bit on this blog (and at my former employer) expressing my opinion of CDOs. I even managed to upset quite a few people while expressing my opinions as well. No regrets though. I’m happy to have this hugely public diary, both here and on NP, to later look back and see how I did in regards to thinking events through. Occasionally, I still like to poke my nose in over at NP and I see kr is still giving out the occasional nugget. Here is one of his latest:

A few thoughts:
– If you took all the writedowns at a single med-to-large bank rather than seeing them across the street, you could have reduced that entity’s equity to ZERO. For instance, MER has only something like USD54bn of mkt cap and USD39bn of book equity.
– If the view is that there will be another round of writedowns in the same amount as Q3 then you will have banks desperate to raise equity (i.e. it is not just the monolines). Who would buy that equity right now? Prince Alwaleed for example has floated his own holdings so I see him more as seller than buyer for example. I don’t see guys like JC Flowers or Cerberus well positioned for this job – in retrospect, even Barclays/RBS have not been with respect to ABN, as can be seen by the action in their share price and cost of jr capital.
– Another possibility would be the downgrade to BBB like the Japanese banks, with all the implications that brings with it. I.e. serious change in business model. That has contagion and macro effects. One example is that flow trading of financials has cost people a lot.
– I think investors will call foul on the FAS157 Level-3 assets, and it will hit guys like GS seriously as their L3 reporteds are a big multiple of their mkt cap.
– There was a funny comment in this month’s BBG mag about “nobody really knows how desks are hedging the CDO assets.” That is bull – the answer is that most people were NOT HEDGING AT ALL, BECAUSE THEY COULDN’T. Stuff was originated to sell, and the exit has vanished, or, it was originated to live forever on a trading book even though people tried to avoid saying that, and there is no decent MTM approach so instead banks are showing huge volatility, mostly to the downside.
– Implications of SIV / CDO / CP demise are pretty vast. There seem to be an increasing amount of trade receivables on the market, b/c there are no conduits to fund them… means corp cost of cap is going up in unexpected areas.

My hunch is that the fed cuts on the 11th b/c liquidity is dropping again, especially with year-end. It is out of control – specifically Ben’s control. It looks like political support for the various subprime fixes has stalled. What I think is that liquidity of all things financial (i.e. non-corporate) is going to get weaker and cause a full-on crisis for a market-traded institution. The talk about Citi cutting their div is one tremor, trading activity in Barclays is another, and the fact that even AFTER all the reported loss numbers, people still don’t feel comfortable, is yet another.

I think vols are still cheap, maybe looking to buy some.

All the while I was complaining about CDOs, I was coming at it from the angle of a “quant”, i.e. thinking about how to model CDOs and how those models are used in risk management, asset allocation, etc. Too bad I didn’t understand more about the legal/accounting aspects of CDOs. The term everyone has now heard of is SIV. I was blabbering about off balance sheet leverage and fair value accounting, but didn’t realize that the entire CDO market was (to a jaded eye) a big play on accounting in addition to the obvious play on ratings agencies. If I had known about SIVs, I might have been able to do more to help some who may have now lost a lot of money. Maybe not. That’s all in hindsight. But what am I missing now? Where is the next weakest link? How are corporations hiding off balance sheet debt? Has anyone looked at “Level 3” assets in corporate, i.e. non-financial, balance sheets? Are they as scary as the big banks?

I’ll say it again… this is not a subprime issue. Subprime contagion does not explain the current environment. Subprime was just the first to blow. We are experiencing the blowup of a global fixed income bubble. In fact, some would say we’re experiencing a general global asset bubble.

Who’s going to get hurt? Financial institutions for sure. Anyone who depends directly on the value of paper assets.

Who’s going to win? People whose wealth depends on physical assets.

I’ve already lost all hope in Bernanke. He is not going to let his monicker “Helicopter Ben” go by the wayside in a “time of need”. Bernanke is going to lower rates and weaken the USD until oil exporters are forced to break the peg to the USD and inflation skyrockets. I predict that all these gloom mongers about home prices dropping by 30% will turn out to be wrong in nominal terms even if they are correct in real terms. In other words, home owners are going to be saved by the dropping value of the USD. All those on Wall Street who were so gleeful every time rates dropped are suddenly going to feel the pain when the value of their paper securities go up in smoke.

Watch out for the “happy stage of inflation”, i.e. wage increases. It will be interesting to see what the world will look like when oil is priced in EUR and the USD is no longer the world currency. Fortunately, I still have faith that we’ll come out of the current mess stronger as a country, but there will certainly be pain felt at the higher end of the wealth spectrum.

I’m actually ironically optimistic about the outlook for suburban and rural economic development. A weaker dollar will make outsourcing less attractive. That will bring manufacturing jobs back home. I can imagine a boon in suburban and rural development. Just imagine if communities developed decent broadband via fiber-to-the-home/business. Suddenly, there will be attractive jobs and living standards in affordable places.

Maybe a weak dollar is what this country needs, i.e. a good kick in the pants. Pain is the best teacher, right?

[Edit: PS, the title of the post was inspired by a great article on Financial Armageddon, but I never got around to explaining why, but have a look and it might be obvious.]

WSJ: Seeking Hidden Losses, Regulators Comb Books Of Wall Street Titans

with one comment

This is bound to end up badly.

From the Wall Street Journal:

Seeking Hidden Losses, Regulators Comb Books Of Wall Street Titans

Here are some excerpts (my emphasis in bold):

The SEC is looking into whether Wall Street brokers are using consistent methods to calculate the value of subprime-mortgage assets in their own inventory, as well as assets held for customers such as hedge funds, the same people said. The concern: that the firms may not be marking down their inventory as aggressively as assets held by clients.


… few big Wall Street firms have reported big subprime losses despite the turmoil roiling the markets.


No one really knows how to price asset-backed securities and CDOs and that’s a real problem in the market now,” says Ann Rutledge, principal of R&R Consulting, a structured finance consultancy in New York.


The pricing issue is crucial for brokers and banks, some of which hold significant amounts of mortgage or CDO securities on their books. Analysts said it was common in past years for Wall Street underwriters to keep portions of the securities of CDOs or mortgage bond deals they arranged.

The SEC’s market-regulation division has been in touch with all big brokerage firms to ensure their risk-management systems are up to speed in light of the quick deterioration in the subprime market. The asset-pricing inquiry is being conducted by the agency’s office of compliance, inspections and examinations.

This is all part of a bigger picture we are discussing here

Some of the best quants in the world are hotly debating appropriate methods for pricing CDOs. When I hear their arguments, the only conclusion I can come to is that NOBODY KNOWS how to price these things. If you can’t price them to determine the value of fund shares and if you can’t value them for GAAP accounting and if you can’t price them for the purposes of allocating capital for risk management purposes, then what does that mean? It means people have been flying blindfolded for years. Who knows where we will end up, but my suspicion is that the place will not be pretty.

Oh yeah, don’t forget I’m an optimist 😉

Written by Eric

August 10, 2007 at 10:20 am

CDOs and Risk Management

with 4 comments

If you ever talk to quants *gasp* or traders, you may occasionally hear them refer to structured securities such as CDOs using terms like “ratings agency arbitrage”. As usual, the word “arbitrage” is totally inappropriate in this context. What they essentially mean is that the structures are designed to take advantage of the weaknesses in the way the ratings agency do their job. This is part of what a former colleague of mine refers to as the “quant arms race”.

Now we are beginning to see how inappropriate the ratings agencies methods are in the context of subprime CDOs (see here and here). With ratings agencies rethinking the ratings on these securities, there will obviously be market impacts as some institutions become forced sellers, etc etc, but the thing on my mind is risk management.

Read the rest of this entry »

Written by Eric

July 10, 2007 at 4:09 pm