Hi,
I was trying to make the NonLeastSquare algorithm. The results were not performing well using ConjugateGradient, so I have decided to use LevenbergMarquardt instead. To make it work, you need to update the LeastSquareFunction values member function as follow: Disposable<Array> LeastSquareFunction::values(const Array& x) const { // size of target and function to fit vectors Array target(lsp_.size()), fct2fit(lsp_.size()); // compute its values lsp_.targetAndValue(x, target, fct2fit); // do the difference Array diff = (target - fct2fit)*(target - fct2fit); return diff; } Of course don't forget to remove the definition from the class declaration. After this, the results are very close from what I can get elsewhere. Cheers |
On Thu, 2007-11-01 at 01:44 -0700, Yomi wrote: > I was trying to make the NonLeastSquare algorithm. > The results were not performing well using ConjugateGradient, so I have > decided to use LevenbergMarquardt instead. > > To make it work, you need to update the LeastSquareFunction values member > function as follow: [...] Done, thanks. Luigi -- Just remember what ol' Jack Burton does when the earth quakes, the poison arrows fall from the sky, and the pillars of Heaven shake. Yeah, Jack Burton just looks that big old storm right in the eye and says, "Give me your best shot. I can take it." -- Jack Burton, "Big trouble in Little China" ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Hi all,
Over the last year the number of volatility cuves have certainly increased. I'm taking a look now in order to construct curves to represent... cap/floor volatilities swaption volatilities fx volatilities and equity volatilities Can somebody give a quick "idiots guide" to the concrete volatility classes and if there are multiple classes for a particular asset class (ie - swaption) what are the pros/cons? Finally, smilesection is seen heavily in the code, what is this? Thanks in advance, Toy out... The next generation of MSN Hotmail has arrived - Windows Live Hotmail ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
If anyone responds to this request, please post to the entire board as
there are several others of us who are equally idiots (with apologies to Toyin) w.r.t. the vol structures. Cheers Simon On Nov 14, 2007 2:30 AM, Toyin Akin <[hidden email]> wrote: > Hi all, > > Over the last year the number of volatility cuves have certainly increased. > > I'm taking a look now in order to construct curves to represent... > > cap/floor volatilities > swaption volatilities > fx volatilities and > equity volatilities > > Can somebody give a quick "idiots guide" to the concrete volatility classes > and if there are multiple classes for a particular asset class (ie - > swaption) what are the pros/cons? > > Finally, smilesection is seen heavily in the code, what is this? > > Thanks in advance, > Toy out... > > ________________________________ > The next generation of MSN Hotmail has arrived - Windows Live Hotmail > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > QuantLib-dev mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ QuantLib-dev mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-dev |
Free forum by Nabble | Edit this page |