How to correct my fault?
3 views (last 30 days)
Show older comments
We assume that Vt=100;D=80;the riskless interest rate is 5%;the asset volatility=0.3 β(beta)=0.8;0≦β(beta)≦1;T=1 year;t=0.5year;ke=50;normcdf(.) is cumulate standard normal distribution
Ask:1.when X=0:0.1:1year Et=??
clear all
clc
Vt=100;D=80;T=1;t=0.5;r=0.05;sigma=0.3;beta=0.8;K=5;
% x=st;
x=0:0.1:1;
E=Vt*normcdf*(log(Vt/D)+(r+0.5*sigma^2)*(T-t)+(sigma*beta+0.5*beta^2)*(T-t))/(sqrt*sigma^2*(T-t)+beta^2*(T-x)+2*sigma*beta*min(T-t,T-x))-K^-r*(T-t)*normcdf*(log(Vt/D)+(r+0.5*sigma^2)*(T-t)+(sigma*beta+0.5*beta^2)*(T-t))/(sqrt*sigma^2*(T-t)+beta^2*(T-x)+2*sigma*beta*max(T-t,T-x))
plot(r,c0,'-*',r,p0,'-^')
xlabel('volatility')
ylabel('option price')
Could any master help me?? Thank you
0 Comments
Accepted Answer
Walter Roberson
on 6 Jan 2016
normcdf is a function. Why are you calling the function with no arguments and multiplying the result by something?
normcdf*(log(Vt/D)+(r+0.5*sigma^2)*(T-t)+(sigma*beta+0.5*beta^2)*(T-t))
is the same as
normcdf()*(log(Vt/D)+(r+0.5*sigma^2)*(T-t)+(sigma*beta+0.5*beta^2)*(T-t))
3 Comments
Walter Roberson
on 6 Jan 2016
Edited: Walter Roberson
on 6 Jan 2016
Change all of your / to ./, and all of your * to .* and all of your ^ to .^
More Answers (0)
See Also
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!