Login  Register

QuantLib Solver

Posted by Nigel Sperinck on May 11, 2015; 10:20pm
URL: http://quantlib.414.s1.nabble.com/QuantLib-Solver-tp16561.html

QuantLib Developers,

 

Reference

http://quantlib.org/slides/dima-ql-intro-2.pdf, page 23

 

In Dimitri Reiswich's QuantLib Solver example, he sets up a boost function and binds this to his function impliedVolProblem() which returns the calculation of the Black Scholes Option Price - price.

 

Are the following two steps required, or is there a way to refactor and simplify the code and use a function pointer directly in the QuantLib Solver.solve method without having to use the boost::function and boost::bind?

 

// Step 1 - Setup a boost function

boost::function < Real(Volatility) > VolatilityFunc ;

 

// Step 2 - Bind the boost function to all market parameters, keep volatility as variant

VolatilityFunc = boost::bind(&impliedVolatilityProblem, spot, strikeprice, rd, rf, _1, tau, phi, price);

 

Real res1 = bisectionSolver.solve(VolatilityFunc, accuracy, guess, min, max);

 

Very best regards

Nigel Sperinck


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev