A Matlab loop problem. Getting 1 solution instead of 54. Anyone knows why?
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
hi there,
I programmed a little script that uses a function to calculate a call price in the heston model. Now I built in a for loop that should calculate the Call price for each day in my excel sheet. There are 54 days, so I consider to get 54 solutions. But I only receive 1 solution. Anyone knows why?
Here is my code:
daten=xlsread('CallPreise.xlsx','Jan','B2:K55'); %Januar
phi = 1;
S=daten(:,1);
K=daten(:,2);
T=daten(:,3);
rd=daten(:,4);
rf=daten(:,5);
kappa=daten(:,6);
theta=daten(:,7);
sigma=daten(:,8);
rho=daten(:,9);
v0=daten(:,10);
alpha=0.75;
method=1;
s0 = log(S);
k = log(K);
ende = length(S);
Call = zeros(ende,1);
for count = 1:ende
Call = HestonFFTVanilla(phi,S(count),K(count),T(count),rd(count),rf(count),kappa(count),...
theta(count),sigma(count),rho(count),v0(count),alpha,method);
end
Regards boulala
댓글 수: 0
답변 (1개)
Torsten
2015년 3월 31일
Call(count)=HestonFFTVanilla(phi,S(count),K(count),T(count),rd(count),rf(count),kappa(count),...
theta(count),sigma(count),rho(count),v0(count),alpha,method);
Best wishes
Torsten.
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!