How to find implied volatility using "solve"?

조회 수: 13 (최근 30일)
Tiancong
Tiancong 2014년 1월 21일
댓글: Tiancong 2014년 1월 21일
my Black-Scholes Function:
-----------------
function C = bs ( Interest, Volatility, Stock, StrikePrice, TimeToMaturity )
d1 = (log(Stock ./ StrikePrice) + (Interest + (Volatility .^ 2) ./ 2) .* TimeToMaturity) ./ (Volatility .* sqrt(TimeToMaturity));
d2 = (log(Stock ./ StrikePrice) + (Interest - (Volatility .^ 2) ./ 2) .* TimeToMaturity) ./ (Volatility .* sqrt(TimeToMaturity));
C = normcdf(d1) .* Stock - normcdf(d2) .* StrikePrice .* exp(-Interest .* TimeToMaturity);
end
------------------
Now given that
bs ( 0.05, Volatility, 1033.56, 775, 1/52) = 261
How do we use "solve" function to find out what the Volatility is?

채택된 답변

Amit
Amit 2014년 1월 21일
You create a new function:
function F = myfunc(vol,C,Interest, Stock, StrikePrice, TimeToMaturity)
F = C - bs(Interest,vol,Stock,StrikePrice,TimeToMaturity);
and then solve it using fsolve
iniGuess = 10;
volatility = fsolve(@(x) myfunc(x,261,0.05,1033.56, 775, 1/52),iniGuess);
  댓글 수: 1
Tiancong
Tiancong 2014년 1월 21일
Thank you very much! However, the I still can't get the right result, could you help me again please! Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Financial Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by