Message Boards Message Boards

Is there a way to be able to compute these integrals efficiently?

Posted 6 months ago

Hi everybody.

In my code, I need to compute [CapitalSigma], q2 and q43. But my integrals are complicated. Here is my code (I attached the code as well):

        ClearAll["`*"]
    \[Kappa] = 1995/10000;
    mu = 2.4287;
    \[Gamma]0 = 6961/10000;
    \[Sigma]0 = 2.984;
    \[Theta] = \[Kappa]*mu;
    \[Rho] = -(373/1000);
    H = 1282/10000;
    K = 2820;
    Subscript[S, 0] = 3545.53;
    r = 13/10000;
    T = 60/252;

    F0[t_] := Subscript[S, 0]*E^(r*t);

    Ktilde[t_] := 1 - K/F0[t];

    E1[t_] = E^(\[Kappa]*t);

    Ebar[t_] = E^(-\[Kappa]*t);

    L0[t_] := \[Sigma]0*Ebar[t] + ((1 - Ebar[t])*\[Theta])/\[Kappa];

    f0[t_] = 1/100*E^(L0[t]);

    Subscript[\[Lambda], 1][t_, s_] := (t - s)^(H - 1/2)/Gamma[H + 1/2];

    Subscript[\[Lambda], 2][t_, 
      s_] = \[Gamma]0*(Subscript[\[Lambda], 1][t, 
         s] - \[Kappa]^(1/2 - H) *E1[s]*Ebar[t]*
         Integrate [x^(H - 1/2) E^x, {x, 0, (t - s) \[Kappa]}, 
          Assumptions -> (t - s) \[Kappa] > 0])

Vbar[s_] = 
 f0[s] + \[Rho]*f0[s]*
   Integrate[f0[u]*Subscript[\[Lambda], 2][s, u], {u, 0, s}, 
    Assumptions -> s > 0] + 
  1/2*f0[s]*
   Integrate[(Subscript[\[Lambda], 2][s, u])^2, {u, 0, s}, 
    Assumptions -> s > 0]

    \[CapitalSigma][T] = NIntegrate[(Vbar[s])^2, {s, 0, T}]

    Subscript[q, 2] = 
     NIntegrate[
       f0[s] Vbar[s]*f0[u] Vbar[u]*f0[l] Vbar[l], {s, 0, T}, {u, 0, 
        s}, {l, 0, u}] + \[Rho]*
       NIntegrate[
        f0[s] Vbar[s]*Vbar[u]*Subscript[\[Lambda], 2][u, l] Vbar[l], {s, 
         0, T}, {u, 0, s}, {l, 0, u}] + \[Rho]*
       NIntegrate[
        Vbar[s]*f0[u] Vbar[u]*Subscript[\[Lambda], 2][s, l] Vbar[l], {s, 
         0, T}, {u, 0, s}, {l, 0, u}] + \[Rho]*
       NIntegrate[
        Vbar[s]*Subscript[\[Lambda], 2][s, u] Vbar[u]*f0[l] Vbar[l], {s, 
         0, T}, {u, 0, s}, {l, 0, u}]

    Subscript[q, 43] = 
     2*\[Rho]*
       NIntegrate[
        f0[s] Vbar[s]*Vbar[u]*Subscript[\[Lambda], 2][u, l] f0[l], {s, 0, 
         T}, {u, 0, s}, {l, 0, u}] + 
      2*\[Rho]*
       NIntegrate[
        Vbar[s]*f0[u] Vbar[u]*Subscript[\[Lambda], 2][s, l] f0[l], {s, 0, 
         T}, {u, 0, s}, {l, 0, u}] + 
      2*\[Rho]*
       NIntegrate[
        f0[s] Vbar[s]*f0[u]*Subscript[\[Lambda], 2][u, l] Vbar[l], {s, 0, 
         T}, {u, 0, s}, {l, 0, u}] + 
      2*\[Rho]*
       NIntegrate[
        Vbar[s]*f0[u] Subscript[\[Lambda], 2][s, u]*f0[l] Vbar[l], {s, 0, 
         T}, {u, 0, s}, {l, 0, u}] + 
      2*\[Rho]*
       NIntegrate[
        f0[s]*f0[u] Vbar[u] Subscript[\[Lambda], 2][s, v] Vbar[v], {s, 0, 
         T}, {u, 0, s}, {v, 0, s}]

Is there a way to be able to compute these integrals efficiently?

thanks for your help in advance.

Attachments:
POSTED BY: M M
5 Replies
Posted 6 months ago

I suppose so. I am not an expert.

POSTED BY: Updating Name

You don't define Vbar.

POSTED BY: Gianluca Gorni
Posted 6 months ago

Yes, I forgot it. I edited my code and my question and added Vbar definition.

POSTED BY: M M

The integrals that appear in Vbar cannot be done in closed form by Mathematica, apparently.

POSTED BY: Gianluca Gorni
Posted 6 months ago

thanks. how can I get an answer for q2 and q43. the only way is to be computed Vbar numerically?

POSTED BY: M M
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