SVI model

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

SVI model

phoenix
Hi ql-fans,
did smb try to implement Gatheral's SVI model (arbitrage-free) to recreate implied vola surface with the help of QL? It seems that there is no direct implementation there.. Or i might have overseen :)
Thanks in advance!
Reply | Threaded
Open this post in threaded view
|

Re: SVI model

Peter Caspers-4
it's not part of the official library and not tested, but if you want
to have a look you're welcome

https://github.com/pcaspers/quantlib/blob/master/QuantLib/ql/experimental/models/svismilesection.hpp

kind regards
Peter



On 19 July 2014 13:03, phoenix <[hidden email]> wrote:

> Hi ql-fans,
> did smb try to implement Gatheral's SVI model (arbitrage-free) to recreate
> implied vola surface with the help of QL? It seems that there is no direct
> implementation there.. Or i might have overseen :)
> Thanks in advance!
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/SVI-model-tp15627.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: SVI model

phoenix
Thank you, Peter!
Will have a look. Is there any plans/deadlines to release it to standard lib soon?

Phx
Reply | Threaded
Open this post in threaded view
|

Re: SVI model

Peter Caspers-4
yes sure, this could be useful. I'll try to integrate it. In general,
what kind of models are of special interest for building rate
volatility surfaces currently ?

SABR (Hagan 2002)
No Arb SABR (Doust)
ZABR (Andreasen)
Kienitz Density Extrapolation
Gatheral SVI
Benim Kainth Dodgson Extrapolation
Kahale C1, C2 Extra- and Interpolation
Fengler Arbitrage Free Surface
Cubic Spline
Other geometric approaches
...


On 25 July 2014 15:00, phoenix <[hidden email]> wrote:

> Thank you, Peter!
> Will have a look. Is there any plans/deadlines to release it to standard lib
> soon?
>
> Phx
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/SVI-model-tp15627p15657.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: SVI model

fintamu
In reply to this post by Peter Caspers-4
Hi Peter,

I took a look at your code. I believe you've implemented a least squares optimization to estimate the SVI parameters. However, this method suffers from the multiplicity of local minima problem and is sensitive to the choice of initial parameters.

Have you looked at the white paper by Zeliade where they lay out a "quasi-explicit" calibration method? Their method leads to a stable parameter space regardless of the initial choice of parameters. I've been trying to follow their method in Matlab but I haven't worked it out completely.

Imran
Reply | Threaded
Open this post in threaded view
|

Re: SVI model

Peter Caspers-4
Hi Imran,

yes, the approach in my code is completely straightforward.

Thanks a lot for the reference to the paper, it looks interesting. If
I find some time I'll try it out and compare the results to the simple
method. Did you run in any particular difficulties reproducing the
paper (or are you just not done yet) ?

best regards
Peter



On 6 August 2014 21:31, fintamu <[hidden email]> wrote:

> Hi Peter,
>
> I took a look at your code. I believe you've implemented a least squares
> optimization to estimate the SVI parameters. However, this method suffers
> from the multiplicity of local minima problem and is sensitive to the choice
> of initial parameters.
>
> Have you looked at the white paper by Zeliade where they lay out a
> "quasi-explicit" calibration method? Their method leads to a stable
> parameter space regardless of the initial choice of parameters. I've been
> trying to follow their method in Matlab but I haven't worked it out
> completely.
>
> Imran
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/SVI-model-tp15627p15689.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: SVI model

fintamu
Hi Peter,

Thanks for your response. So, I've implemented the suggested algorithm in Matlab but I'm not able to reproduce the vol surface correctly because my estimated parameters are different than what others have found. I'm actually using a set of data on this Wilmott discussion and then comparing my results with that of the others who've successfully implemented the algorithm.

http://www.wilmott.com/messageview.cfm?catid=34&threadid=79106

To be honest, I'm a bit confused by the 3+2 algorithm. I've described it briefly below (you can find the expanded version in the paper):
1. Select some initial parameters values (a0, b0, rho0, m0, sigma0)
2. For the initial m0 and s0, do a constrained optimization - P(m0, sigma0)
3. Finally, using (a*, b*, rho*) from step (2), use simplex (Nelder-Mead) to estimate m* and sigma* by minimizing P.

So my concern is whether I need to run multiple iterations of the 3 steps or is one sufficient? So far, I've done multiple iterations. Basically, I use the (m*, sigma*) in step 3 as initial values (m0, sigma0) for the next set of iterations. But I'm not getting the correct estimates for the 5 parameters.  

Let me know if you want to see my code. I'll glad to share it with you.

Best regards,

Imran
Reply | Threaded
Open this post in threaded view
|

Re: SVI model

Peter Caspers-4
In reply to this post by Peter Caspers-4
I try to produce a problem case where I generate a sample volatility
smile from given SVI parameters, calibrate the SVI model to this data
(with a "standard" initial guess) and then see if the parameters are
identified, like in table 1 of the Zaliade paper (LS vs quasi explicit
method). No luck though, I get just as good results as in table 1 for
the quasi explicit method using a plain Levenberg Marquardt
optimization with standard parameters (see the code below). Not even
several random start points are needed to achieve this.

Here is the code

https://gist.github.com/pcaspers/c8344b6e64530e9d0d0c#file-svi_zeliade-cpp

Can you provide any other example where plain optimization does not
work, but the quasi explicit method does ?

Thanks
Peter


On 10 August 2014 17:41, Peter Caspers <[hidden email]> wrote:

> Hi Imran,
>
> yes, the approach in my code is completely straightforward.
>
> Thanks a lot for the reference to the paper, it looks interesting. If
> I find some time I'll try it out and compare the results to the simple
> method. Did you run in any particular difficulties reproducing the
> paper (or are you just not done yet) ?
>
> best regards
> Peter
>
>
>
> On 6 August 2014 21:31, fintamu <[hidden email]> wrote:
>> Hi Peter,
>>
>> I took a look at your code. I believe you've implemented a least squares
>> optimization to estimate the SVI parameters. However, this method suffers
>> from the multiplicity of local minima problem and is sensitive to the choice
>> of initial parameters.
>>
>> Have you looked at the white paper by Zeliade where they lay out a
>> "quasi-explicit" calibration method? Their method leads to a stable
>> parameter space regardless of the initial choice of parameters. I've been
>> trying to follow their method in Matlab but I haven't worked it out
>> completely.
>>
>> Imran
>>
>>
>>
>> --
>> View this message in context: http://quantlib.10058.n7.nabble.com/SVI-model-tp15627p15689.html
>> Sent from the quantlib-users mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: SVI model

fintamu
Hi Peter,

Thanks for your response. So, I've implemented the suggested algorithm in Matlab but I'm not able to reproduce the vol surface correctly because my estimated parameters are different than what others have found. I'm actually using a set of data on this Wilmott discussion and then comparing my results with that of the others who've successfully implemented the algorithm.

http://www.wilmott.com/messageview.cfm?catid=34&threadid=79106

To be honest, I'm a bit confused by the 3+2 algorithm. I've described it briefly below (you can find the expanded version in the paper):
1. Select some initial parameters values (a0, b0, rho0, m0, sigma0)
2. For the initial m0 and s0, do a constrained optimization - P(m0, sigma0)
3. Finally, using (a*, b*, rho*) from step (2), use simplex (Nelder-Mead) to estimate m* and sigma* by minimizing P.

So my concern is whether I need to run multiple iterations of the 3 steps or is one sufficient? So far, I've done multiple iterations. Basically, I use the (m*, sigma*) in step 3 as initial values (m0, sigma0) for the next set of iterations. But I'm not getting the correct estimates for the 5 parameters.  

Let me know if you want to see my code. I'll glad to share it with you.

Best regards,

Imran
Reply | Threaded
Open this post in threaded view
|

Re: SVI model

Peter Caspers-4
... this discussion is a bit outdated (we used a direct mail channel
due to the huge delays on the list), just to summarize a bit from my
point of view:

I did an intermediate implementaion of the "raw" approach with
"heuristic" butterfly - arbitrage constraint in the sense of [1]
http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2033323 here

https://github.com/pcaspers/quantlib/blob/master/QuantLib/ql/experimental/volatility/sviinterpolation.hpp

using naive start values and plain optimization in the 5 SVI
parameters. I am still looking for an example motivating a more
involved procedure for parameter estimation, since all cases we
discussed so far

- the parameter identification examples in the Zeliade paper
- the example on the willmott thread mentioned earlier
- Alex Vogt's example

work all well with the easy method, even without any additional random
start points needed to achieve the final result. Though I think there
must be something about the two stage approach, because it is also
cited in [1]. Any input / example data would be very welcome.

Peter


On 10 August 2014 20:48, fintamu <[hidden email]> wrote:

> Hi Peter,
>
> Thanks for your response. So, I've implemented the suggested algorithm in
> Matlab but I'm not able to reproduce the vol surface correctly because my
> estimated parameters are different than what others have found. I'm actually
> using a set of data on this Wilmott discussion and then comparing my results
> with that of the others who've successfully implemented the algorithm.
>
> http://www.wilmott.com/messageview.cfm?catid=34&threadid=79106
>
> To be honest, I'm a bit confused by the 3+2 algorithm. I've described it
> briefly below (you can find the expanded version in the paper):
> 1. Select some initial parameters values (a0, b0, rho0, m0, sigma0)
> 2. For the initial m0 and s0, do a constrained optimization - P(m0, sigma0)
> 3. Finally, using (a*, b*, rho*) from step (2), use simplex (Nelder-Mead) to
> estimate m* and sigma* by minimizing P.
>
> So my concern is whether I need to run multiple iterations of the 3 steps or
> is one sufficient? So far, I've done multiple iterations. Basically, I use
> the (m*, sigma*) in step 3 as initial values (m0, sigma0) for the next set
> of iterations. But I'm not getting the correct estimates for the 5
> parameters.
>
> Let me know if you want to see my code. I'll glad to share it with you.
>
> Best regards,
>
> Imran
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/SVI-model-tp15627p15740.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: SVI model

Jonathan.issan
This post was updated on .
Hi peter

Is that possible to provide the gatheral svi for QLNET?

Thank you very much

Jonathan
Reply | Threaded
Open this post in threaded view
|

Re: SVI model

Peter Caspers-4
Hi Jonathan,

I don't know qlnet, so it would be difficult for me to do it. In any
case I think first of all we should get it into QuantLib. Since it
depends on some changes in the noarb-sabr pull request, I'd like to
wait with the commit until this is merged.

best regards
Peter

On 31 August 2014 11:57, Jonathan.issan <[hidden email]> wrote:

> Hi peter
>
> Is that possible to provide the gatheral svi foc QLNET?
>
> Thank you very much
>
> Jonathan
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/SVI-model-tp15627p15823.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users