30.01.2015 Views

Investigating the Cloud Computing Business Framework (CCBF ...

Investigating the Cloud Computing Business Framework (CCBF ...

Investigating the Cloud Computing Business Framework (CCBF ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix: An example in Black Scholes Model (BSM)<br />

%----------- Enter input Parameters -----------------------<br />

S=100; %Spot price<br />

K=100; %Strike<br />

UB=115; %upper boundary<br />

r=0.15; %risk free rate<br />

T=.5; %maturity<br />

sigma=0.2; %volatility<br />

D=0.05; %dividend yield<br />

assetsteps=150; %Explicit scheme time steps<br />

%----------------------------------------------------<br />

dt=1/(sigma*assetsteps)^2;<br />

timesteps=ceil(T/dt)+1;<br />

Su=UB;<br />

ds=Su/assetsteps;<br />

dt=T/timesteps;<br />

for k=1:timesteps,<br />

V(2:assetsteps,k+1)=Ai.*V(1:assetsteps-<br />

1,k)+(1+Bi).*V(2:assetsteps,k)+Ci.*V(3:assetsteps<br />

+1,k);<br />

%Apply lower boundary condition<br />

V(1,k+1)=0;<br />

%apply upper boundary condition<br />

V(assetsteps+1,k+1)=0;<br />

end<br />

V2=fliplr(V);<br />

OptionPriceVec=V2(:,1);<br />

option_price=interp1(Svec,OptionPriceVec,S)<br />

V=zeros(assetsteps+1,timesteps+1);<br />

Svec=0:ds:Su;<br />

Svec=Svec';<br />

V(:,1)=max((Svec-K).*(Svec

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!