Monday, May 7, 2012

Time Integral of Brownian Motion

This is a short note on computing the time integral of a Brownian motion:

$ \int_0^t W_s ds$

In fact I should have said the moments of such an integral. The first moment is just

$ E[\int_0^t W_s ds] = \int_0^t E[W_s] ds = 0$


The second moment is

\begin{align*} E[\int_0^t W_s ds \int_0^t W_u du] & =  E[\int_0^t \int_0^t W_s W_u ds du] \\ &= \int_0^t \int_0^t E[W_s W_u] ds du \\ &= \int_0^t \int_0^t min(u,s) ds du \\ &= \int_0^t \int_0^s u du ds + \int_0^t \int_s^t s du ds \\ &=\int_0^t \frac {s^2} {2} ds+\int_0^t (ts-s^2) ds \\ &= \frac {t^3}{3}\end{align*}

The trick is to separate the min function into two 
regimes.

Thursday, April 12, 2012

Short Note on Corp (or Risky) Credit Term Structure

Bootstrapping the risk-free yield curve is (relatively) straightforward. One might be tempted to repeat the same trick for Corp bonds, i.e. bootstrapping a risky yield curve and use it for pricing by adding it to the risk free rate.

However, this approach would produce very poor results especially for lower rating bonds. If one starts from short maturity and move to longer maturities according to the naive scheme, the yield usually
  • fluctuates a lot
  • drops sharply (thus almost surely producing an inverted curve)
  • or even unfolds in a way such that the PV of the earlier coupons of a long dated bond exceeds its observed price!
The problems arise because by adopting the naive bootstrapping approach that is borrowed from the risk free case, we completely ignored the effects of 1) recovery; and 2) CF timing shortening (due to default), which are dominant in the case of low rating bonds. Remember, the naive procedure is based on discounted (known) CF with no uncertainties either in timing or amount. When default is not only possible (since we are considering corp) but probable (since we are considering low ratings), this method breaks down.

One way to get by is to back out not the risky yield but the hazard rate (or equivalently the risk neutral default probability). To do that we have to express market bond price as a function of recovery and hazard rate, much like what is done for CDS pricing.

Reference:
Berd et al. 2004, "Defining, Estimating and Using Credit Term Structures" Part 1-3

Monday, April 9, 2012

Quant Interview: High Frequency

1. What is CAPM?

2. If I have a portfolio of long option that are Delta hedged, what daily P&L can be expected?

3. If on average the probability of seeing one car passing by per hour is $\kappa$, what is the probability of seeing one car passing by within 15 minutes?
Ans: $1-(1- \kappa)^{1/4}$

4. How many integers fulfill all 3 criteria below:
  • 3-digited
  • Odd
  • Does not contain any '5' in any place

See here for more interview questions/brainteasers

Thursday, March 29, 2012

Follow-up: Multi-curve Modeling

In [Mercurio 2009], two different approaches are proposed as attempts to resolve the new post-crisis market norm. (Recap: the issues include rate dependence on contract tenor, failure of textbook no-arb relationships between different rate securities)

The first approach focuses on the difference in counterparty risk for various contracts. For example, regarding the textbook case of replicating an FRA using a long and a short LIBOR deposits, we can introduce hazard rate and default time into the replication argument. That way, we end up with a forward LIBOR that is higher than the comparable FRA.

This approach, however, cannot be easily utilized in pricing, and more importantly the industry seems to favour 'segmenting market rates,' i.e. having multiple curves in existence simultaneously.

Digression: Bootstrapping
This is a description of how zero curve bootstrapping is done in general setting. (i.e. not limited to post-crisis multi-curve method)

A single kind of contract is unlikely to cover the entire range of maturities, hence different securities are required for different sections of the curve. What actually got to be chosen for curve construction depends on currency, but in general:
  • The shortest end is built from cash/money market deposit. Since there is only a single bullet payment in a deposit transaction, the 'bootstrapping' is trivially done by day count (and perhaps compounding) adjustment.
  • The middle section is built out of FRA or ED future contracts. Once again, since there is only one cash flow the bootstrapping is straight forward. Note however that if future contracts are used, a convexity adjustment is required so that the adjusted rate is comparable to that of a forward contract. (the convexity comes from the relative advantage of holding an interest rate future over forward, because MTM profit/loss can be reinvested/covered at a higher lower/rate)
  • Finally, the far end of the curve is built out of swap. In this case we have to proceed in an order of ascending maturity because there are more than one payments in a swap. Suppose the rates are known up to (t-1). Then, with the market swap rate, S(t), and the discount factor up to (t-1), P(0,T_i), the discount factor and hence the rate for t can be found using the swap rate formula.
End of Digression

In the multi curve case, the only difference from the general procedure above is that we would only use one family of securities in building a curve of a certain tenor. (e.g. 3m deposit, 3m FRA with various maturities and 3m LIBOR fixing swaps with various number of payments to build the 3m tenor curve)

Finally, as an aside, note that curve interpolation is a tricky business, especially if you want to also calculate the instantaneous forward curve which is very sensitive to local curve fluctuations.

Wednesday, March 21, 2012

Multi-curve Pricing: Short Notes

Issue:
After Mid 2007, a lot of the good-o textbook wisdom failed to hold, mainly in two aspects:
  1. Some rates use to match one another almost exactly (i.e. zero spread), for example deposit rate vs overnight swap rate; now the spread is much larger.
  2. Swaps with different settlement frequencies have very large rate spread, i.e. the size of the swap rate depends on the fixing.
Proposed remedies:
  1. Use separate curves for discounting and forwarding
  2. Treat LIBOR's with different fixings as independent underlyings

Questions:
Even in the good-o textbook context, shall we expect LIBOR's with different tenors to have zero spread? Or is it just that tenor used to be irrelevant in the old narrative?

Reference:
Henrard 2009, "Irony in Discounting: The Crisis"
Bianchetti 2009, "Two Curves, One Price"
Mercurio 2009, "Interest Rates and the Credit Crunch: New Formulas and Market Models"

Monday, March 5, 2012

Credit Flattener and Steepener: Duration and Convexity Exposures

Flattener/Steepener are long/short strategies that bet on the relative movements of long vs. short maturity ends on a curve. The curve can be interest rate, variance or credit spread. For the sake of discussion, we consider a credit spread flattener.

The three main exposures are TIME, CURVE SHIFT and DEFAULT. Here we focus on CURVE SHIFT. Surely, we can mitigate the risk by duration hedging (even so we will be left with convexity risk, see below). However, notional matching has the advantage of zero default exposure (at least until the shorter leg expires).

In a notional-matched flattener, the investor speculate on flattening credit curve by selling (buying) CDS protection at the long (short) end. If the curve steepens instead, we would of course have a loss. What if the curve tightens by a parallel shift?

The mark-to-market as the spread moves is calculated by multiplying spread change to risky DV01, which, to recap, is the CDS spread numeraire. Obviously, DV01 of longer leg > DV01 of shorter leg. Hence a parallel upward shift (widening) of the curve affects the long leg more. But widening spread is bad for protection seller. Therefore a flattener position is harmed by widening spread (because the benefit on the short end < the loss on the long end).

The previous paragraph assumes that DV01 remains constant when the shift is small enough, and it considers only the relative sizes of DV01's. Not surprisingly, DV01 itself does not stay constant as the curve shifts further and hence there is convexity effect, which concerns the relative sensitivities of DV01's. Turns out DV01 decreases as spread widens, and the DV01 of the long end is more sensitive to curve shift than the short end. It follows then, that a flattener has positive convexity (when spread widens => DV01 drops => bad effect at long end diminishes => good for investor) while steepener has negative convexity.

Reference: JP Morgan 'Credit Derivatives Handbook'

Tuesday, February 28, 2012

Quick Notes on Haug's Article (Know Your Weapon I)

Concerning vanilla options and good-O' Black- Scholes:
  1. Delta (the absolute value of which) can be greater than unity
  2. As a corollary, ITM put can have absolute Delta lower than 0.5 and OTM call can have Delta greater than 0.5
  3. Gamma and Vega attain their max NOT at-the-money-forward
  4. Ordinary way of computing Gamma has a saddle point; there's a peak at the long expiry zero underlying boundary
  5. As a consequence, GammaP might be more useful than Gamma in describing gamma risk
Ref: Haug, Know Your Weapon Part I

Saturday, February 11, 2012

Black-Scholes Pricing in F#

First, get Math.NET Library (Open source).

F# code:

\\ begin
#light

open MathNet.Numerics.FSharp
open MathNet.Numerics.Distributions

let d12 (S0,r,y,sigma,K,T,d1_d2) = (log (S0/K)+(r-y+(if d1_d2 = 1.0 then 1.0 else -1.0))*(sigma*sigma / 2.0)*(T))/(sigma * (sqrt(T)))

let normal = new Normal(0.0, 1.0)

let bsPrice (S0, r, y, sigma, K, T) = exp (-y*T) * S0 * normal.CumulativeDistribution(d12 (S0,r,y,sigma,K,T,1.0))-exp (-r*T) *K * normal.CumulativeDistribution(d12 (S0,r,y,sigma,K,T,2.0))

printfn "Price = %F" (bsPrice (1.0, 0.0, 0.0, 0.2, 1.0, 1.0))

open System
Console.ReadKey(true)
\\ end

Friday, February 10, 2012

Vega hedging (and good modeling practice in general)

Recently re-read two very good papers (see the bottom), and it's interesting to find that they have related themes.

Synopsis for Jarrow: A model can either be theoretical or statistical (think regression). A theoretical model can be rejected (or not) by inspecting the assumptions and implications (note, though, that a rejected model can still be used). If a theoretical model is rejected, then calibration to market data would effectively turn it into an ad hoc statistical model.

For the sake of discussion consider B-S. It sets out to be a theoretical model, but volatility smile renders it rejected. By calibrating it to the volatility smile (local volatility), we are turning it into a statistical model. It can then be used to price other options (although, now being a statistical model, the econometric relationship would change over time and re-calibration is required). What we should not do is to use it for Delta/Gamma hedging, because it is exactly the failure of Delta hedging assumption that breaks its theoretical model status - there exist more than one sources of risk, which is why a single constant sigma does not suffice.

What is worse than using it for Delta hedging is to use it for Vega hedging, because under B-S the stock volatility is assumed to be a constant. Taking partial derivative with respect to sigma is mathematically sound, but it makes no sense other than spitting out an expression that lure you into believing its legitimacy. Which brings us to the uncertain parameters model Wilmott discussed. In his paper (and his book too) he explains why Vega is a terrible measure of volatility sensitivity when Gamma changes sign. Besides cliquet option, barrier option also falls into this category.

He proposes an uncertain parameter model that still uses Delta hedging argument. A non-linear PDE is produced. In a related chapter he discusses a similar technique for interest rate modeling, although in that case Delta hedging is dropped and the result of calibration is a yield envelop.

Jarrow 2011 - Risk Management Models: Construction, Testing, Usage
Wilmott - Cliquet Option Pricing
Also, PWOQF Ch. 52

Tuesday, February 7, 2012

Quick Notes on IR/Credit/Volatility Comparison

Modeling Approaches
Stochastic instantaneous spot
Short rate - Hazard rate - Stochastic volatility

Stochastic instantaneous forward
Instantaneous forward rate - ??? - xi in the Bergomi model

Market traded
LIBOR/Forward swap rate - Forward CDS rate - Forward variance swap rate

Others (Not exactly modeling)
Yield - ??? - Implied volatility

Question: where does local volatility fit in?