Friday, June 10, 2011

Quant Interview Questions (Model Validation 2)

1) Consider the SDE dr = a r dt + b dW. What is the solution for r?

Ans:
This is a special case of O-U process. Try taking derivative of $ f \equiv r_t e^{-at} $

2) Toss a fair coin for 100 times. What is (approximately) the probability Pr(# of H >= 60)?

Ans:
Consider the binomial distribution
n C k*p^k*(1-p)^(n-k)
The mean of the distribution is n*p and the variance is n*p*(1-p). When n is large, the binomial distribution converges to normal distribution with mean = n*p and variance = n*p*(1-p). Hence the standard deviation in this case is 5, and H >= 60 would be two standard deviation away from the mean. The answer is therefore (1 - 95.4%)/2 = 2.3%.

3) What is copula and how can it be used for modeling correlated processes?

Ans:
Let F_X and G_Y be the cdf of random variables X and Y, and they are the marginal distribution of the bivariate distribution H_XY. Using the fact that U = F_X(X) and V = G_Y(Y) both have uniform distribution from 0 to 1 (because F_X(X) is the percentile function). Sklar's Theorem states that there exists a copula function C such that
H_XY = C(F_X, G_Y)
In other words, we can construct the joint distribution using the marginal distributions.

Reference: http://en.wikipedia.org/wiki/Copula_%28statistics%29

4) Why is holding the equity piece of a CDO longing default correlation?

Ans:
Holding the senior tranche is a short position in correlation - that is easy to understand, because the probability of loss for the senior tranche is low as long as not too many assets in the pool default together in a bad credit environment. However, for the equity piece it seems that it will not actively benefit from high correlation. The way to think of it is to consider when credit environment is good, a high correlation ensures that no asset in the pool goes default.

5) Suppose x is a continuous observable variable, Y* is a binary observable variable, and Y is a latent variable. The following relations hold:
Y = b x + e, e ~ N(0,1)
Y* = 1 (if Y >= 0) or 0 (if Y < 0)
Suppose we have a set of data (x, Y*). How can be calibrate the model (i.e. fit b)?

Ans:
This problem can be solved by MLE. Since e ~ N(0,1), we have Y ~ N(b x, 1). The probability of Y* = 1 (or equivalently Y >= 0) is just the cumulative normal probability density. For each of the data point (x_i, Y*_i) we have such an F(Y). Thus the likelihood function is
Product(F_i(Y))
and we fit b by maximizing this function.

6) A, B and C are playing a game with gemstones. Each of them starts with 5 stones with different colors (blue, red, green, yellow, white). There are 3 rounds in the game. In the first round, A pick one stone randomly from B and one from C; in the second round B pick one stone randomly from C and one from A; in the third round C pick one stone randomly from A and one from B. What is the probability that at the end of the game each person would have 5 stones with different colors?

Ans:
0.015873 (MC verification)
Edit: Thanks to M Millar, the right answer should be 0.0413. The tree looks like
                                                                                                  -- C gets the right stones (1/9)
                                            -- B takes original from A (3/7) --
                                           |                                                      -- C fails (dead)
   -- A draws same color (1/5) --
  |                                         -- B fails to take original from A (dead)
--
  |                                        -- B takes original from A (2/7) -- C gets the right stones (1/9)
  |                                       |
  |                                       |                                                         -- B takes the right color from C (1/4) -- C gets the right stones (1/9)
   -- A draws diff colors (4/5)  ---- B takes the other duplicated color from A (2/7) --
                                          |                                                         -- B takes the wrong color from C (dead)
                                           -- B removes one of the three lone colors (dead)


See here for more interview questions/brainteasers

4 comments:

  1. For 6), I believe it can be calculated using conditional probability.
    For A, it can either choose two different color stones from B and C with probability 4/5 or the same color stones with probability 1/5.
    a) A chooses the same color stones, B has to get back its own stone from A, so B chooses one from A and C with probability 3/7. For C, it has no choice but choosing the one it needs from A and B with probability 2/6*2/6= 1/9. So in this case the probability is 1/5*3/7*1/9
    b) A chooses different color stones from B and C with probability 4/5. B again has to get back its own stone with probability 4/7. For C, it is the same as case a). So in this case, the probability is 4/5*4/7*1/9.
    The total probability is thus 19/(35*9)=0.0603.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. I got something slightly different for 6 as well. Agree it is conditional probability and agree with Loy up through a) but disagree a bit with b).
    For b) I have that B chooses its own stone back from A with probability 2/7, and then can choose any stone from C. Or B can choose the stone A took from C,(with probability 2/7) in which case B then needs to take from C the stone that A took from B (with probability 1/4). In either case then C has to get its stones back from B and C with probability (1/3*1/3) or 1/9.

    So I get 1/5*3/7*1/3*1/3+4/5*2/7*1/3*1/3+4/5*2/7*1/4*1/3*1/3 = 0.04127

    ReplyDelete
    Replies
    1. Hi M Millar,

      Sorry for the late reply. Indeed you're right, I got ~0.041 from simulation. Good job!

      Delete