Message Boards Message Boards

0
|
9866 Views
|
7 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Avoid problems with a triple integration? (Pricing of exotic options)

Posted 7 years ago
Attachments:
POSTED BY: Nicolas BADUEL
7 Replies
Posted 7 years ago

Thanks a lot Emerson, it works just fine !

POSTED BY: Nicolas BADUEL

Hi

You can consider your integral to be the discounted expectation of your final payoff under a Multivariate log-normal distribution. Your option is worth $226. I obtained this by using NIntegrate and setting the working precision to 100. Simulation confirms this. Your integral is difficult because of the very small values of the likelihood and the fact that the payoff function is zero in some places. One thought is that you may need to re scale your problem to make the integral behave. It is easy to transform to the Multivariate Normal. Then you could standardize which is pretty much what is done in the derivation of the uni-variate Black-Scholes Formula.

Actually, if you defined your own custom standardized multivariate cumulative distribution you could write a formula similar to Black-Scholes for your problem.

Attachments:
POSTED BY: Emerson Willard
Posted 7 years ago

I double checked the formula, doesn't seem the problem come from it. This could be due to the function NIntegrate? Problem is if I use Integrate, the calculation lasts forever...

POSTED BY: Nicolas BADUEL

As best I can tell this reduces to the computation below.

NIntegrate[(671.1784345137916*E^(-2.*(0.00183562 + Log[0.00128038*x2])*
      (-162.12*(-0.00198044 + Log[0.000588107*x1]) + 
       82.7225*(0.00183562 + Log[0.00128038*x2]) - 
       37.947*(0.000608031 + Log[0.000161702*x3])) + 
     (-0.00198044 + Log[0.000588107*x1])*
      (808.576*(-0.00198044 + Log[0.000588107*x1]) - 
       162.12*(0.00183562 + Log[0.00128038*x2]) + 
       0.752924*(0.000608031 + Log[0.000161702*x3])) + 
     (0.000608031 + Log[0.000161702*x3])*
      (0.752924*(-0.00198044 + Log[0.000588107*x1]) - 
       37.947*(0.00183562 + Log[0.00128038*x2]) + 
       71.447*(0.000608031 + Log[0.000161702*x3])))*Max[0, -8665.59 + x1 + x2 + x3])/
  (x1*x2*x3), {x1, 0, Infinity}, {x2, 0, Infinity}, {x3, 0, Infinity}]

Creating a table of values in the ranges of 0 to 10000 in steps of 2000 for each variable will show that the result is not implausible. So either there are bad evaluations e.g. from cancellation error in machine arithmetic, or else the underlying integral is not what was wanted. Changing the values from machine numbers to exact nearby rationals, and evaluating at high precision, I get results consistent with the machine precision results. This makes me suspect numeric error is not the issue.

POSTED BY: Daniel Lichtblau
Posted 7 years ago

Hi, sorry about the rules, here is my code (i hope the format is okay now). Please find also attached the two excel files I used in the code (Omega and InvOmegaTOmega)

Rf = 0.0092

0.0092

dt = 0.25

0.25

n = 3

3

w1 = 1/3

1/3

w2 = 1/3

1/3

w3 = 1/3

1/3

S1 = 5101.11

5101.11

S2 = 2343.06

2343.06

S3 = 18552.61

18552.6

Sigma1 = 5.05615635/100

0.0505616

Sigma2 = 18.18926835/100

0.181893

Sigma3 = 15.25262228/100

0.152526

s1 = Import[
  "/Users/nicolasbaduel/Documents/Wolfram Mathematica/Omega.xlsx"]

{{{0.0506, 0.130786, 0.06893}, {0., 0.126422, 0.0671455}, {0., 0., 
   0.118306}}}

s1 = Import[
  "/Users/nicolasbaduel/Documents/Wolfram Mathematica/Omega.xlsx", \
{"Data", 1, {1, 2, 3}}]

{{0.0506, 0.130786, 0.06893}, {0., 0.126422, 0.0671455}, {0., 0., 
  0.118306}}

s2 = Import[
  "/Users/nicolasbaduel/Documents/Wolfram \
Mathematica/InvOmegaTOmega.xlsx", {"Data", 1, {1, 2, 3}}]

{{808.576, -162.12, 0.752924}, {-162.12, 
  82.7225, -37.947}, {0.752924, -37.947, 71.447}}

Omega = s1

{{0.0506, 0.130786, 0.06893}, {0., 0.126422, 0.0671455}, {0., 0., 
  0.118306}}

InvOmegaTOmega = s2


{{808.576, -162.12, 0.752924}, {-162.12, 
  82.7225, -37.947}, {0.752924, -37.947, 71.447}}

Omega

{{0.0506, 0.130786, 0.06893}, {0., 0.126422, 0.0671455}, {0., 0., 
  0.118306}}

Zeta1 = Log[x1/(w1*S1)] - (Rf - ((Sigma1)^2)/2)*dt

-0.00198044 + Log[0.000588107 x1]

Zeta2 = Log[x2/(w2*S2)] - (Rf - ((Sigma2)^2)/2)*dt

0.00183562 + Log[0.00128038 x2]

Zeta3 = Log[x3/(w3*S3)] - (Rf - ((Sigma3)^2)/2)*dt

0.000608031 + Log[0.000161702 x3]

VectZeta = {{Zeta1}, {Zeta2}, {Zeta3}};

K = 8665.59

8665.59



Transpose[VectZeta].InvOmegaTOmega.VectZeta

{{(0.00183562 + 
      Log[0.00128038 x2]) (-162.12 (-0.00198044 + 
         Log[0.000588107 x1]) + 
      82.7225 (0.00183562 + Log[0.00128038 x2]) - 
      37.947 (0.000608031 + Log[0.000161702 x3])) + (-0.00198044 + 
      Log[0.000588107 x1]) (808.576 (-0.00198044 + 
         Log[0.000588107 x1]) - 
      162.12 (0.00183562 + Log[0.00128038 x2]) + 
      0.752924 (0.000608031 + Log[0.000161702 x3])) + (0.000608031 + 
      Log[
       0.000161702 x3]) (0.752924 (-0.00198044 + 
         Log[0.000588107 x1]) - 
      37.947 (0.00183562 + Log[0.00128038 x2]) + 
      71.447 (0.000608031 + Log[0.000161702 x3]))}}



g := Function[{x1, x2, x3}, 
  Max[x1 + x2 + x3 - K, 
    0]*((Exp[(-0.5/dt)*(0.00183562 + 
           Log[0.00128038 x2]) (-162.12 (-0.00198044 + 
              Log[0.000588107 x1]) + 
           82.7225 (0.00183562 + Log[0.00128038 x2]) - 
           37.947 (0.000608031 + 
              Log[0.000161702 x3])) + (-0.00198044 + 
           Log[0.000588107 x1]) (808.576 (-0.00198044 + 
              Log[0.000588107 x1]) - 
           162.12 (0.00183562 + Log[0.00128038 x2]) + 
           0.752924 (0.000608031 + 
              Log[0.000161702 x3])) + (0.000608031 + 
           Log[0.000161702 x3]) (0.752924 (-0.00198044 + 
              Log[0.000588107 x1]) - 
           37.947 (0.00183562 + Log[0.00128038 x2]) + 
           71.447 (0.000608031 + Log[0.000161702 x3]))])/(Omega[[1, 
        1]] Omega[[2, 2]] Omega[[3, 3]]*x1*x2*x3*((2*Pi*dt)^(n/2))))]

NIntegrate[
 g[x1, x2, x3], {x1, 0, Infinity}, {x2, 0, Infinity}, {x3, 0, 
  Infinity}]

3.570889416597262*10^300946
Attachments:
POSTED BY: Nicolas BADUEL

@Nicolas BADUEL please follow the forum rules http://wolfr.am/READ-1ST edit your post and attach all files necessary to run your code.

POSTED BY: Moderation Team

I'm not able to run that notebook (n access to the xlsx files).

POSTED BY: Daniel Lichtblau
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