How to find implied volatility using "solve"?
14 views (last 30 days)
Show older comments
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?
0 Comments
Accepted Answer
Amit
on 21 Jan 2014
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);
More Answers (0)
See Also
Categories
Find more on Financial Data 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!