[問題]用fsolve解BS選擇權公式的某個參數

看板MATLAB作者 (lucow)時間10年前 (2014/03/29 10:24), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
請問有人知道怎麼解嗎 % 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 麻煩知道的人救我 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 27.105.16.219 ※ 文章網址: http://www.ptt.cc/bbs/MATLAB/M.1396059854.A.F94.html

03/29 23:37, , 1F
這樣不能解 因為分佈是含有S
03/29 23:37, 1F
文章代碼(AID): #1JDYxE-K (MATLAB)