Serving the Quantitative Finance Community

 
User avatar
hoare
Topic Author
Posts: 0
Joined: December 7th, 2004, 7:00 pm

Matlab blsimpv

May 4th, 2005, 8:56 pm

Anyone have use matlab blsimplv routine (financial toolbox) for compute implied volatility?I have a lot of problem with this routine: e.g. blsimpv(28368,28500,.09145,8/365,38) return -1.340780792994260e+154 that' s impossible as value. Anyone has experienced such problem?Anyway, who can suggest me where i can find a routine (C or matlab) to compute implied BS volatility?
 
User avatar
quantie
Posts: 20
Joined: October 18th, 2001, 8:47 am

Matlab blsimpv

May 5th, 2005, 12:48 pm

QuoteOriginally posted by: hoareAnyone have use matlab blsimplv routine (financial toolbox) for compute implied volatility?I have a lot of problem with this routine: e.g. blsimpv(28368,28500,.09145,8/365,38) return -1.340780792994260e+154 that' s impossible as value. Anyone has experienced such problem?Anyway, who can suggest me where i can find a routine (C or matlab) to compute implied BS volatility?matlab/octave/scilab lets you see under the hood.So you can type the name of the function and see what they are doing This you may already know!>> type blsimpv and you will see all the magic So it is a simple newton-root finder you can perhaps enhance it by using more informationfor BS we know the delta in closed form so you can use that and write something that is more robust.Or just look for matlab help files for BFGS or simillar.Also you can set breakpoints inside the rootfinder with >>DBSTOP IN blsimpvHope this helps.
 
User avatar
AVt
Posts: 90
Joined: December 29th, 2001, 8:23 pm

Matlab blsimpv

May 5th, 2005, 7:50 pm

This might say you, that the routine fails and as it was alraedy statedby quantie: try to check and understand the source code.Additionally it might say: you are working on a 32 bit platform and thisis ~ sqrt( smallest number) and Matlab is working with vol^2*time (?).http://www.mathworks.com/access/helpdes ... .htmlgives me some impression (i have no Matlab).I checked the figures there: blsimpv(100, 95, 0.075, 0.25, 10) is said togive 0.3130. It should be .31296491779355023016 - may be they do use adifferent discounting and one has to adapt rates (check the manual ...).With the usual discounting exp(-rates*time) your input results in a volof 4.1187076845829217374 % using Maple (high exactness cut to 20 digits).
 
User avatar
majhzh
Posts: 0
Joined: November 2nd, 2003, 2:19 pm

Matlab blsimpv

May 12th, 2005, 2:00 pm

it is ok when i run in matlab7!>> blsimpv(28368,28500,.09145,8/365,38)ans = 0.0412