(Yield curves are obtained by bootstrapping the interest rate information contained in a range of risk-free/ near risk-free fixed income instruments (deposit rate, LIBOR, FRA, interest rate futures, interest rates wap, OIS swap, government bond…). Rather than treating each data point as separate, many are more interested in the term structure of the yield curve. Nelson-Siegel (and its extension Nelson-Seigel-Svensson) exponential components framework is one of the most popular yield curve models. The forward rates are readily available once a Nelson-Siegel model is obtained. As shown by Diebold & Li, the three time-varying components in Nelson-Siegel can be interpreted as factors corresponding to level, slope and curvature. These factors have also been shown by Diebold & Li to have some forecasting power. We will go through the meaning of various components of Nelson-Siegelmodel, its implementation and other alternatives in yield curve modelling. ` Continue reading “Nelson-Siegel Yield Curve Model”

# Category: Quant

## Nelson Siegel Model – Python Source Code

- Author: David Y
- Date of release: 2019-11-13
- Date of last update: 2019-12-01
- Version: 1.1.0
- License: BSD
- Language: Python (tested in python 3.7.1)

## Hurst Exponent – Python Source Code

- Maintainer: David Y
- Date of release: 2019-11-05
- Version: 1.0.0
- License: BSD
- Language: Python (tested in python 3.7.1)

## Pairs Trade – Practice

In the last post, we had reviewed some theory related to pairs trade. In this post, we will go through a textbook case of arbitrage to show how various test-statistics should look like. We also introduce the half-life of mean-reversion and the Hurst Exponent as performance indicators. We then look into a possible implementation for mean-reversion strategy before discussing the real-world issue in pairs trade.

## Pairs Trade – Theory

Pairs trade is one of the simplest market-neutral statistical arbitrage strategies. The goal is to find a pair of securities which historically move up and down in highly correlated fashion but the price differential between them is temporarily at an extreme. We then long the relatively cheap security and simultaneously short the other. Hopefully, the price differential would promptly revert back to normal such that we can realise some profit. We would review some useful statistical concept (such as co-integration, stationary process) and discuss the types of securities that are likely to form good trading pairs. Continue reading “Pairs Trade – Theory”

## Volatility Cone – C# Source Code

While the generation of volatility cone[1] [2] can be done via e.g. a spreadsheet, the calculation is a bit repetitive and is thus more convenient to code it in C#.

• Author: David Y

• Date of first release:2014-08-30

• Version: 1.0.0

• License: BSD

• Language: C# (tested in VS Express 2013 for Desktop)

## Volatility & Return Cone – Equity, FX, Bond

I am going to show the return and volatility cones[1] for a number of equity indices, currency pairs and bond yield indices in this post. The graphs are pretty self-explanatory. Continue reading “Volatility & Return Cone – Equity, FX, Bond”

## Demystify the Volatility Cone

Volatility cone is a visualisation tool for the display of historical volatility term structure. It was introduced by Burghardt and Lane[1] in early 1990 and is popular in the option trading community. Using the same methodology, we can extend the use of such chart for periodic return data. I find these charts useful not only for options but also for the general market. Continue reading “Demystify the Volatility Cone”

## One Factor Interest Rate Model – C# Source Code

I have looked into the analytics for callable bonds lately [1][2]. The involves the use of an interest rate tree. I thus implemented the Hull-White and Black-Karasinski one-factor short rate trees illustrated in Hull’s Options, Futures and Other Derivatives 6th Ed. Ch28.7. I included procedures to calibrate the rates tree using the premium of interest rate cap. Once a tree is generated, it can be used to price and calculate the OAS for callable bonds (both fixed and floating rate with flexible call schedule).

- Author: David Y
- Date of first release:2014-08-03
- Version: 1.0.0
- License: BSD
- Language: C# (tested in VS Express 2013 for Desktop)
- Model: Hull-White and Black-Karasinski one-factor short rate trees
- Dependence: ALGLIB numeric library (for optimisation code)