Message Boards Message Boards

4
|
16401 Views
|
4 Replies
|
7 Total Likes
View groups...
Share
Share this post:

Valuation of Credit Default Options

Posted 10 years ago
Attachments:
POSTED BY: Igor Hlivka
4 Replies

Igor

Thank you very much for your fascinating series on the application of Mathematica to finance, but is it possible to get the notebook behind this and the other PDF files?

Regards Michael

POSTED BY: Michael Kelly

Hi Igor, thanks for the explanation. I understand now what's going on. Regards, Ruben

Hi Igor, great post again. I've been trying to replicate your results but I have run into difficulties with the last example of valuation under a Gamma process with non-deterministic volatility. The result I get is a complex number. This is the code:

pm1 = ParameterMixtureDistribution[GammaDistribution[a, b], 
   b \[Distributed] ExponentialDistribution[\[Lambda]]];
sol3 = Solve[{Mean[pm1] == x0 + \[Mu]*t, 
   StandardDeviation[pm1] == \[Sigma] Sqrt[t]}, {a, \[Lambda]}]
sol3vals = {a /. sol3[[1]], \[Lambda] /. sol3[[1]]};
evpm1 = Subscript[A, 0]
    Expectation[If[x > k, x - k, 0], x \[Distributed] pm1, 
    Assumptions -> k > 0 && t > 0] // Simplify
evpmcal = evpm1 /. {a -> sol3vals[[1]], \[Lambda] -> sol3vals[[2]]};
evpmcal /. {t -> 3, x0 -> 0.014, 
  k -> 0.014, \[Sigma] -> 0.004, \[Mu] -> 0, Subscript[A, 0] -> 45.598}

0.133831 - 0.116303 I

May I know what I'm doing wrong? Many thanks in advance, Ruben

Hello Ruben The problem with Gamma mixture resides in the parameter definition. For Gamma process, both parameters have to be positive. This is ensured when sigma (in the context of other parameters defined in this example) is at least 80 bp

In[79]:= pm1 = 
  ParameterMixtureDistribution[GammaDistribution[a, b], 
   b \[Distributed] ExponentialDistribution[\[Lambda]]];

In[80]:= sl5 = 
  Solve[{Mean[pm1] == x0 + \[Mu]*t, 
    StandardDeviation[pm1] == \[Sigma] Sqrt[t]}, {a, \[Lambda]}];

In[81]:= sl5vals = {a /. sl5[[1]], \[Lambda] /. sl5[[1]]};

In[82]:= evpm1 = 
 Subscript[A, 0]
    Expectation[If[x > k, x - k, 0], x \[Distributed] pm1, 
    Assumptions -> k > 0 && t > 0] // Simplify

   In[69]:= evpmcal = 
  evpm1 /. {a -> sl5vals[[1]], \[Lambda] -> sl5vals[[2]]};

In[78]:= evpmcal /. {t -> 5, x0 -> 0.014, 
  k -> 0.014, \[Sigma] -> 0.008, \[Mu] -> 0, Subscript[A, 0] -> rann}

Out[78]= 0.0269472

Hope this answers your question. If not, please let me know. Kind regards Igor

POSTED BY: Igor Hlivka
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract