Re: calibration G2++ with defferential evolution
Posted by
Ralph Schreyer-3 on
URL: http://quantlib.414.s1.nabble.com/calibration-G2-with-defferential-evolution-tp14969p14972.html
Hi Andre, Peter,
I think the current implementation is buggy. You would do something like
Array lower(5);
lower[0] = 0.0;
lower[1] = 0.0;
lower[2] = 0.0;
lower[3] = -1.0;
lower[4] = 0.0;
Array upper(5);
upper[0] = 10.0;
upper[1] = 50.0;
upper[2] = 10.0;
upper[3] = 1.0;
upper[4] = 10.0;
model->calibrate(options, deOptimizer, EndCriteria(400, 40, 1.0e-8, 1.0e-8, Null<Real>()),
NonhomogeneousBoundaryConstraint(lower, upper));
Then, in model.cpp, line 88 ff, the CompositeConstraint is built from the PrivateConstraint of the model and the NonhomogeneousBoundaryConstraint. When you look at the implementation of e.g. upperBound(...) in constraint.hpp, line 156 ff., you find
for (Size iter = 0; iter < c1ub.size(); iter++) {
rtrnArray.at(iter) = std::min(c1ub.at(iter), c2ub.at(iter));
}
Because c1ub is the upperBound of the PrivateConstraint and c1ub.size() = 0, the DifferentialEvolution does not get its bounds and therefore e.g. DifferentialEvolution::fillInitialPopulation(...) fails.
Maybe one can change the CompositeConstraint upperBound and lowerBound implementations? Or is there a better place? Or isn't there a bug at all??
Best
Ralph
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users