Integral Heston Model Finance
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Any idea why the integral is not being solved ?
This is my code:
Theta= log(2)/(Vols_L)^2; % Mean Reversion
Omega= (Vols_L - (Vols_L)^2); % Long Term Variance
Psi= Theta * Omega; % Ornstein Uhlenbeck (1')
Eta= (Vols_L)^4; % Vol of Vol
Correlation= 0.5; % Correlation with Risky Asset
% ~ Variables ~
Spot= log(Spot_L);
Psi= Theta * (Omega);
A= Theta * Omega;
B1= Theta + Psi - (Correlation * Eta);
B2= Theta + Psi;
U1= 1/2;
U2= -1/2;
Element= 0;
% ~ Components ~
d1= sqrt((i * Element * Correlation * Eta - B1)^2 - (Eta)^2 * ((2 * i * Element * U1) - (Vols_L)^2));
d2= sqrt((i * Element * Correlation * Eta - B2)^2 - (Eta)^2 * ((2 * i * Element * U2) - (Vols_L)^2));
G1= (B1 - (i * Element * Correlation * Eta) + d1) / (B1 - (i * Element * Correlation * Eta) - d1);
G2= (B2 - (i * Element * Correlation * Eta) + d2) / (B2 - (i * Element * Correlation * Eta) - d2);
D1= ((B1 - (i * Element * Correlation * Eta) + d1)/ (Eta)^2) * ((1 - exp(d1 * Calendar_L)) / (1 - (G1 * exp(d1 * Calendar_L))));
D2= ((B2 - (i * Element * Correlation * Eta) + d2)/ (Eta)^2) * ((1 - exp(d2 * Calendar_L)) / (1 - (G2 * exp(d2 * Calendar_L))));
C1= (i * Element * (R_L - Q_L) * Calendar_L) + (A/(Eta)^2) * ((B1 - ((i * Element * Correlation * Eta) + d1) * Calendar_L) - 2 * log((1 - (G1 * exp(d1 * Calendar_L))) / (1 - G1)));
C2= (i * Element * (R_L - Q_L) * Calendar_L) + (A/(Eta)^2) * ((B2 - ((i * Element * Correlation * Eta) + d1) * Calendar_L) - 2 * log((1 - (G2 * exp(d1 * Calendar_L))) / (1 - G2)));
F1= exp(C1 + (D1 * (Vols_L)^2) + ((i * Vols_L) * Spot));
F2= exp(C2 + (D2 * (Vols_L)^2) + ((i * Vols_L) * Spot));
% ~ PDE's ~
int1= (exp(-i * Element * log(Strikes_L)) * F1) / (i * Element); % Function I
int2= (exp(-i * Element * log(Strikes_L)) * F2) / (i * Element); % Function II
int1= real(integral(int1, Element, inf)); % Real part of the Integral Solution
int2= real(integral(int2, Element, inf)); % Real part of the Integral Solution
Func1= (1/2) + (1/pi) * int1 * d1 * Element;
Func2= (1/2) + (1/pi) * int2 * d2 * Element;
Heston_Price= (Spot_L * Func1) - (Strike_L * exp((- R_L - Q_L) * Calendar_L) * Func2);
Thanks, Cheers.
2 commentaires
John D'Errico
le 16 Juin 2019
Modifié(e) : John D'Errico
le 16 Juin 2019
Because not all integrals that you can pose have an analytical solution? Or perhaps I should write that differently. MOST arbitrary integrals that you might decide to pose lack an analytical solution.
Réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!