Software should not be patentable

Software patents never seemed to be a good idea. At last there is something to substantiate the claim that software should not be patentable. Here is a mathematical proof how US Patent 5,893,120 can be reduced to mathematical formulae, thus making it unpatentable under the US law.

In his other blog entry the author argues that, in fact, any software algorithm can be reduced to mathematical formulae, which are not patentable.

Posted in Uncategorized | Leave a comment

Diagonalising an intensity matrix of a reversible Markov chain

Recently I needed to build a Monte Carlo simulator of a continuous-time Markov chain. This is a pretty straightforward exercise; the only catch was that I wanted it to perform well, so I had to use a fast algorithm for matrix exponentiation.
Continue reading

Posted in Mathematics | Leave a comment

CVA calculation example

Let’s calculate CVA (credit value adjustment) analytically. We will see that analytical CVA calculation is quite complex even for a fairly simple transaction (a vanilla swap). A few shortcuts will help us simplify the calculation. Continue reading

Posted in Finance | Tagged , , , , , | 2 Comments

The dreadful 40-60 rule

When we have to calculate exposure at default (EAD) on a particular trade, we seldom have to compute it analytically (e.g. as shown here). More often we just take the current MtM of the trade and add the so-called add-on. The add-on is the notional amount of the trade multiplied by the coefficient specific to the trade type, underlying and remaining maturity:


where 20100302-M is the current MtM, 20100302-A is the add-on, 20100302-N is the notional amount and 20100302-a is the trade-specific coefficient.

This method works reasonably well for a single trade.

If we have several trades covered by a netting agreement, we have a problem. We cannot just calculate the exposure on a netted portfolio as a sum of exposures per trade: exposures are not additive. One way to tackle this problem is to use the 40-60 rule. This rule, however, is so seriously wrong that it becomes alarming how many people use it without thinking of its shortcomings. Continue reading

Posted in Finance | Tagged , , , | 1 Comment

Historical or implied?

To calculate counterparty exposure, we need to know the volatility of our risk factors (interest rates, stock prices, etc.) in the future. Continue reading

Posted in Finance | Tagged , , , , , | Leave a comment

Don't trust a model

Recently I was asked: “Are you not afraid of over-reliance on numerical methods in finance?”

Indeed, if I had to rely on numerical results in finance, I would be afraid. Continue reading

Posted in Uncategorized | Leave a comment

Exposures are not additive: case in point

If we have a portfolio of vanilla trades (say, swaps), we can calculate EAD on each trade individually (an example is discussed here). Naturally, it is tempting to say that the exposure on the portfolio is the sum of the exposures on individual trades. That’s very wrong because exposures are not additive. Continue reading

Posted in Finance | Tagged , , | 5 Comments

Counterparty risk calculation guide

This paper by S.  Zhu and M. Pykhtin provides a blueprint for counterparty risk modelling framework.

Posted in Finance | Leave a comment

Exposure at default calculation

Many believe that the calculation of exposure at default (EAD) on derivative contracts is fairly straightforward, so it can easily be done analytically. In many cases it is true, but not always.

Let us consider an easy case when EAD can be calculated analytically. By looking at how we do that, we will discover under which circumstances the method would not work.

Continue reading

Posted in Finance | Leave a comment

Implied density of the underlying

If we know call option prices for every strike (underlying and expiry date being the same for all of the options), and the option price is a twice differentiable function of the strike, then we can calculate the probability density of the underlying on the expiry date. This density is implied by the option prices.

If C(K) is the price of the option with strike K, then the implied density of the underlying on expiry date is C”(K). Remarkably, this does not imply any particular model for the underlying process. This fact is well known, but I could not find a proof of it anywhere in the literature. To me, the following informal reasoning sounds pretty convincing.
Continue reading

Posted in Finance | Leave a comment