Serving the Quantitative Finance Community

 
User avatar
JoK78
Topic Author
Posts: 0
Joined: January 6th, 2010, 8:46 am

Quantlib credit spread simulation MC

November 24th, 2013, 6:41 pm

Hi Fellow Quants,Does anyone know if there is any Monte Carlo based credit spread simulation in Quantlib, easy to use and merge with some other MC simulations? Maybe some examples as well? I'd like to set up some homemade CVA simulation for experimentationThanks,JK
 
User avatar
pcaspers
Posts: 30
Joined: June 6th, 2005, 9:49 am
Location: Germany

Quantlib credit spread simulation MC

November 30th, 2013, 4:05 pm

you could e.g. start with a SquareRootProcess (with an EulerDiscretization) and plug this into the PathGenerator ?
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

Quantlib credit spread simulation MC

December 1st, 2013, 8:06 am

QuoteOriginally posted by: JoK78Hi Fellow Quants,Does anyone know if there is any Monte Carlo based credit spread simulation in Quantlib, easy to use and merge with some other MC simulations? Maybe some examples as well? I'd like to set up some homemade CVA simulation for experimentationThanks,JKAre you using some kind of (jump) diffusion model for the spread?
 
User avatar
JoK78
Topic Author
Posts: 0
Joined: January 6th, 2010, 8:46 am

Quantlib credit spread simulation MC

December 15th, 2013, 12:12 pm

Thanks for the advices. They are very useful. Plugging in the sqrtProcess into PathGenerator is a good starting point.Though, I don't understand why the sqrt process is a good model for credit spreads. I saw it in Brigo, though. Probably because it would represent the observation that credit spread volatilities don't grow to infinity!? But couldn't we use something simpler? I thought that a well parametrized lognormal process would suffice. But here is where my problems starts. How to set a log-normal model (or any other credit spread model like the sqrt process) up consistenly with the fact that the hazard rate represents the intensity of default probability? Here's my thinking:Let's assume a single factor credit spread model without any term structure. If - B is the price of a defaultable bond, - PS(T) is the survival probability between 0 and T - s0 is the credit spread observed/bootstrapped at time zero- s(t) is the simulated credit spread, - R is the, fixed, recovery rate,- p(s,t) is the probability density of s at time t (I will need this for expressing the jump to default process intuitively)- r is discount rate, but for the sake of simplicity, let's assume it is zero.We have: Prob_survival(0,T)=exp(-s0/(1-R) * T) (bootsrapped from the bond prices, B(s0;0,T))and a lognormal model ds(t) = mu*s(t)*dt + sigma*s(t)*dW(t). (I.) OLD CONDITIONSThe above equations also have to satisfy the conditions (C1) \int p(s,t) ds = PS(t) (the number of defaults is consistent with the bootstrapped survival probabilities observed at time zero). and (C2) 1/PS(T) * \int p(s,t)*s*ds = s(t=0) = s0 (the expected value of the simulated credit spread is consistent with the observed credit spread at time zero) (II.) NEW CONDITIONBut additionally, we have the condition (C3) p(s,t+dt) - p(s,t) = - p(s,t)*s/(1-R)dt + (usual diffusion and drift driven terms) Where p(s,t)*s/(1-R)*dt represent the process that, in each time step, the credit entity with spread s will default with rate s/(1-R)*dt. Note, that this term is not uniform in s. The larger s is, the more likely the path is removed from the simulation. (On a sidenote, I think that this process would suffice to make our, slightly modified, lognormal model to exhibit the same behaviour as the square-root pocess, i.e. to have finite volatility on the paths which didn't default.)(III.) CONSISTENCY PROBLEMS BETWEEN (I.) AND (II.)As a consequence, due to (C3), if we assumed mu=0 (C1) wouldn't hold any more since the removal of the paths is not uniform. The expected value of p(s,t) would decrease. Also, due to this non-uniform removal of paths, I'd expect that p(s,t) will not be log-normal any more, so calculating mu(t) might be not that trivial. (On a sidenote, I'd expect similar problems with any other, like the square-root, model as well. That the original solution of any model (CIR, HW, ...) would be not the solution of the CR simulation model due to condition (C3).) I think (C3) is a non-negligible effect/process. What do you think?(IV) QUESTIONHave you encountered this problem before? Am I overcomplicating something? Would you have any suggestions with setting up the parameters of my simulation (mu(t), path removal process, etc) so as (C1), (C2), and (C3) are satisfied? Wow, it was long! But, I don't know how to explain it simplerThx,JK