Hi,
I have this function here:
function HestonCallPriceFx0 = [1.1768 0.082259 0.83746 -0.54589]; %parameters: psi m xi rho
PC = 1; F = 100; K = 100; T = 0.2; r = 0.04; V0 = 0.02; CallPriceF(PC, F, K, T, r, V0, x0)%Delta
epsD = abs(F)*eps^(1/6);Delta=(CallPriceF(PC, F+epsD, K, T, r, V0, x0)-CallPriceF(PC, F-epsD, K, T, r, V0, x0))/(2*epsD)%Vega
epsV = abs(V0)*eps^(1/6);Vega=(CallPriceF(PC, F, K, T, r, V0+epsV, x0)-CallPriceF(PC, F-epsD, K, T, r, V0-epsV, x0))/(2*epsV)
Which is working fine for those inputs:
PC = 1; F = 100; K = 100; T = 0.2; r = 0.04; V0 = 0.02;
Which I have used above. Indest of having this inputs, I would like the function to compute me the delta and vega for each row of a matrix and therefore I tried to replace those iputs:
PC = 1; F = 100; K = 100; T = 0.2; r = 0.04; V0 = 0.02;
with this here:
PC=data9(1,3); F=data9(1,1); K=data9(1,2); T=data9(1,5); r=data9(1,7); V0=(data9(1,8)/100)^2;
For some reason this is not working.
I would like to store the deltas and vegas in two additional vectors which I then add to the existing matrix called data9
is there a way to do this or where is the mistake I am making?
Best Answer