[问题]用fsolve解BS选择权公式的某个参数

楼主: lucow (lucow)   2014-03-29 10:24:12
请问有人知道怎么解吗
% close form pricing model option with Call-on-call option
function F = BS_cf(cp,S,K,r,q,vol,t,bv)
% Input
% cp: '1' is call option and '2' is put option.
% S: initial stock price.
% K: strike price.
% r: annual risk-free interest rate.
% q: annual dividend yield.
% vol: annual volatility of stock return rate.
% t: time to maturity (in year).
% Output
% premium: fair premium of European option under Black-Scholes model.
% computing parameters
d1 = (log(S/K)+(r-q+0.5*vol^2)*t)/(vol*t^0.5); d2 = d1 - vol*t^0.5;
Nd1 = normcdf(d1,0,1); Nd2 = normcdf(d2,0,1);
% choosing the call formula or put formula
if cp == 1
F = (S*exp(-1*q*t)*Nd1 - K*exp(-1*r*t)*Nd2)-bv;
elseif cp == 2
F = (K*exp(-1*r*t)*(1-Nd2) - S*exp(-1*q*t)*(1-Nd1))-bv;
else
end
end
我想要解选择权的价格=bv时候的S是多少
所以打了这个程式档,可是我用fsolve去跑的时候却Error
麻烦知道的人救我
作者: primeman (精华)   2014-03-29 23:37:00
这样不能解 因为分布是含有S

Links booklink

Contact Us: admin [ a t ] ucptt.com