Thursday, October 6, 2011

Short note on Vasicek CDO pricing model

- It is a PRICING model, not a credit default rate model (i.e. neither structural nor reduced-form, it takes prob. of default as input)
- It assumes (in its most simple form) large, homogeneous pool
- It assumes Gaussian copula (can be relaxed)
- Just like B-S option pricing has implied volatility, Vasicek CDO pricing has implied correlation
- In its simplest form, the correlation matrix is assumed to be time-independent and all pairwise correlations are identical
- Industry people use Vasicek implied correlation as a convenient way to quote tranche price (cf. Black volatilities for cap/floor/swaption)
- Not surprisingly, the implied correlation is not constant across tranches - correlation smile
- Base correlation is smoother than compound correlation

Ref: This article by Elizalde

Wednesday, October 5, 2011

Shadow Rate

The original paper by Gorovoi and Linetsky, and a summary of it, is a pretty neat idea to resolve the shortcoming of Gaussian short rate models: that the interest rate can go below zero (but should we be concerned about negative rate, now that CHF Libor has seen negative values?).

The 'shadow rate,' which is a latent unobservable process, is still assumed to be Gaussian. The true short rate process is floored at zero of the latent process. Intuitively, people can always choose to hold cash when rate is below zero so the effective rate should never drop to negative.

They also use an eigenfunction expansion method to construct the solution to the PDE (derivative price).

Friday, September 9, 2011

(Original?) Brain teaser

There are 2 apartments, A and B. Apartment A has 10 tenants and 2 washing machines; apartment B has 20 tenants and 4 washing machines. If your objective is to minimize the probability that all machines are occupied when you want to do laundry, which one is better, A or B, or does it not matter? Assume that ‘Tenant i does laundry at time t’ follows mutually independent Poisson processes. Assume also that each and every laundry takes the same finite amount of time T.

Saturday, August 6, 2011

Physical vs. Risk-neutral Measures in BSM Credit Model

Unlike in equity or fixed income derivative pricing, the concepts of hedging and portfolio replication are usually bypassed in credit modeling, especially when structural models are considered (although Vaillant 2001 discusses replicating credit derivatives using risky bonds, which mirrors replicating interest rate derivatives using risk-free bonds). To facilitate discussion we consider the BSM asset default boundary model. Usually we would ignore the nuances of probability measures and presume physical measure when writing down the asset dynamics. This produces the Distance to Default (DD) under the physical measure, which allows us to compute the Probability of Default (PD) under the physical measure. This is all very well, but when we want to calculate bond (or other security) prices using PD, we have to first convert the PD under P-measure into the PD under Q-measure. Bohn's Active Credit Portfolio Management pp. 177 explains this.

Tuesday, July 12, 2011

Ginnie Mae, Fannie Mae and Freddie Mac

Ginnie Mae
- does NOT hold any bond
- does NOT originate MBS
- does guarantee MBS issued by banks with the right ingredients
- is backed by 'full faith of the government'

Fannie Mae and Freddie Mac
- does hold some bonds
- does originate MBS
- does guarantee MBS issued by banks with the right ingredients*
- (formally speaking) is NOT backed by 'full faith of the government

Note*:
1. Fannie Mae and Freddie Mac guarantee bonds, whether they are their own originations or not
2. "Right ingredients" here are different from those in Ginnie Mae guaranteed MBS

Tuesday, July 5, 2011

The volatility of corp bond yield

Q: How does the volatility of the yield of corporate bond compare to that of treasuries?

A: The question can be translated into "is the correlation between corporate yield spread and the underlying index yield (treasury yield) positive or negative?" Empirical study shows that they are negatively correlated. What is the economic story? When the underlying riskless treasury yield is high, the general economy is usually doing well (i.e. what is the objective of the Fed?) and so the corporates are in good shape to service their debts. Default is therefore less likely.

Since the correlation is negative, the answer to the original question is that the yield of corporate bond actually tends to be lower than that of treasury securities. This is a little anti-intuitive, as we expect the corporate bond to be riskier and hence has more volatile price.

Friday, June 24, 2011

Quant Interview Questions (Interest Rate Strat.)

1) What is the limit of F(n) when n is large, where F(n) is the n-th term in the Fibonacci series?

Ans:
The ratio between consecutive terms, x, approaches the golden ratio phi. Proof: we posit that
F(n) = x^n * F(0) = x^(n-1) * F(0) + x^(n-2) * F(0)
x^n = x^(n-1) + x^(n-2)
x = 0.5 * (1 +- sqrt(5))
The two values are phi and 1/phi, respective.

2) Write functions to compute F(n) and comment on the order of the algorithm.

Ans:
Recursive approach -
int Fib(int n){
if (n = 0) {Fib = 0}
else if (n = 1) {Fib = 1}
else {
Fib = Fib(n-1) + Fib(n-2)
}
return Fib;
}
Order ~ O(phi^n)
Note: alternatively we can store the intermediate values in a cache to reduce redundancy (for example to find F(4) we have to calculate F(2) = F(3-1) and F(2) = F(4-2) twice, which is a waste of time).

Bottom-up approach -
int Fib(int n){
temp1 = 0;
temp2 = 1;
if (n = 0) {Fib = 0}
if (n = 1) {Fib = 1}
for (int i = 0; i <= n; i++){
run_sum = temp1 + temp2;
temp1 = temp2;
temp2 = run_sum;
}
return run_sum;
}
Order ~ O(n)

See here for more interview questions/brainteasers

Tuesday, June 21, 2011

Quant Interview Questions (Equity Exotic Derivatives)

1) What is the Taylor expansion of exp(-1/x^2)?

Ans:
This function cannot be expanded at x = 0 because there is a singularity: the function is NOT analytic at x = 0.
http://en.wikipedia.org/wiki/Taylor_series#Analytic_functions

2) Suppose we have the prices of options with various strikes. How can we price an option with arbitrary payoff?

Ans:
Solve the Fokker-Planck Equation to obtain the risk-neutral probability density p(S). Then the price of an option with arbitrary payoff can be calculated as
exp(-r (T-t)) \int Payoff(S) p(S) dS
Note: In case of vanilla European call, p(S) can be found by the second partial derivative of the call price w.r.t. strike K

3) Suppose we have a volatility smile (same expiry, different strikes). What no-arbitrage condition can be imposed on the option implied volatilities (i.e. prices)?

Ans:
Recall the bull spread relation and the butterfly spread relation. In the continuous limit, they read
0 < -dC/dK < 1 [Note the negative sign]
d^2C/dK^2 > 0

4) Given two stock price time series of two stocks. After computing the correlation using the naive approach (rolling covariance divided by rolling standard deviations), the correlation matrix is NOT PSD. How can this be fixed?

Ans:
??

See here for more interview questions/brainteasers

Sunday, June 12, 2011

Barrier and Asian Options

In hedging barrier and Asian options, we do not need an extra asset in addition to the underlying stock. That is to say, although the payoff and value of the barrier (Asian) option does depend on the running extremum (average) process, such a process does not introduce an extra source of uncertainty (however they do introduce an extra dimension in numerical pricing).

- For barrier option, the running extremum can be handled using reflection principle.

- For Asian option, the running average can be handled by having an auxiliary process. Once again, no additional source of uncertainty is introduced by doing this.

See Shreve.

Friday, June 10, 2011

C++ Advanced Concepts

1) Initialization List
http://www.learncpp.com/cpp-tutorial/101-constructor-initialization-lists/
Also, http://www.cprogramming.com/tutorial/initialization-lists-c++.html:
"Before the body of the constructor is run, all of the constructors for its parent class and then for its fields are invoked. By default, the no-argument constructors are invoked. Initialization lists allow you to choose which constructor is called and what arguments that constructor receives.

If you have a reference or a const field, or if one of the classes used does not have a default constructor, you must use an initialization list."

2) Overloading Function and Copy Constructor
http://www.learncpp.com/cpp-tutorial/911-the-copy-constructor-and-overloading-the-assignment-operator/

3) Virtual Constructor Function
See Eckel "Thinking in C++":
"If you want to be able to call a virtual function inside the constructor and have it do the right thing, you must use a technique to simulate a virtual constructor. This is a conundrum. Remember, the idea of a virtual function is that you send a message to an object and let the object figure out the right thing to do. But a constructor builds an object. So a virtual constructor would be like saying, “I don’t know exactly what kind of object you are, but build the right type anyway.” In an ordinary constructor, the compiler must know which VTABLE address to bind to the VPTR, and even if it existed, a virtual constructor couldn’t do this because it doesn’t know all the type information at compile time. It makes sense that a constructor can’t be virtual because it is the one function that absolutely must know everything about the type of the object.

And yet there are times when you want something approximating the behavior of a virtual constructor..."

4) Virtual Destructor
Why we need virtual destructor is exactly because of polymorphism. Consider if we have BaseClass and ChildClass. If we do this:

BaseClass *p = new ChildClass;
delete p;

then we fail to delete the ChildClass object! Although the pointer of the BaseClass can point to an object of the ChildClass, the command delete could only get rid of a BaseClass object - unless it has a virtual destructor!

http://blogs.msdn.com/b/oldnewthing/archive/2004/05/07/127826.aspx

5) Avoiding changing value when passing by reference
Use the technique of passing by const reference (http://www.learncpp.com/cpp-tutorial/73-passing-arguments-by-reference):
"One of the major disadvantages of pass by value is that all arguments passed by value are copied to the parameters. When the arguments are large structs or classes, this can take a lot of time. References provide a way to avoid this penalty. When an argument is passed by reference, a reference is created to the actual argument (which takes minimal time) and no copying of values takes place. This allows us to pass large structs and classes with a minimum performance penalty.

However, this also opens us up to potential trouble. References allow the function to change the value of the argument, which in many cases is undesirable. If we know that a function should not change the value of an argument, but don’t want to pass by value, the best solution is to pass by const reference."

cf. http://iagtm.blogspot.com/2010/02/c-function-passing-by.html