How to correct my fault?

3 views (last 30 days)
Li mengru
Li mengru on 6 Jan 2016
Commented: Li mengru on 8 Jan 2016
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

Accepted Answer

Walter Roberson
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
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 .^
Li mengru
Li mengru on 8 Jan 2016
Error:Matrix dimensions must agree.
i try many times,but can not solve it

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!