Dear all, I use python swig to calibrate Heston model. And when I come to the calibrate function, the program gives me the following error. Could you give me some suggestions? Traceback (most recent call last): File "D:\QL_HestonModel_test.py", line 86, in <module> model.calibrate(options, method, EndCriteria(1000, 250, 1e-7, 1e-7, 1e-7)) File "D:\Progs\Python27\lib\site-packages\QuantLib\QuantLib.py", line 5431, in calibrate def calibrate(self, *args): return _QuantLib.CalibratedModel_calibrate(self, *args) NotImplementedError: Wrong number or type of arguments for overloaded function 'CalibratedModel_calibrate'. Possible C/C++ prototypes are: CalibratedModel::calibrate(std::vector< boost::shared_ptr< CalibrationHelper >,std::allocator< boost::shared_ptr< CalibrationHelper > > > const &,OptimizationMethod &,EndCriteria const &,Constraint const &,std::vector< Real,std::allocator< Real > > const &) CalibratedModel::calibrate(std::vector< boost::shared_ptr< CalibrationHelper >,std::allocator< boost::shared_ptr< CalibrationHelper > > > const &,OptimizationMethod &,EndCriteria const &,Constraint const &) CalibratedModel::calibrate(std::vector< boost::shared_ptr< CalibrationHelper >,std::allocator< boost::shared_ptr< CalibrationHelper > > > const &,OptimizationMethod &,EndCriteria const &) Code: options=[] .............. options.append(HestonModelHelper(maturity,calendar,s0.value(),strike[s], vol,riskFreeTS,dividendYield, CalibrationHelper.ImpliedVolError)) v0=0.1 kappa=1.0 theta=0.1 sigma=0.5 rho=-0.5 process=HestonProcess(riskFreeTS,dividendYield,s0,v0, kappa, theta, sigma, rho) model=HestonModel(process) engine=AnalyticHestonEngine(model,64) for option in options: option.setPricingEngine(engine) om=LevenbergMarquardt(1e-8, 1e-8, 1e-8); model.calibrate(options, om, EndCriteria(400, 40, 1.0e-8, 1.0e-8, 1.0e-8)) Zach Email: [hidden email] ------------------------------------------------------------------------------ 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-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi Zax, On my side, your codes works fine…. Could I know what is your QL version? Regards, Cheng 发件人: Seric Chen [mailto:[hidden email]] Dear all, I use python swig to calibrate Heston model. And when I come to the calibrate function, the program gives me the following error. Could you give me some suggestions? Traceback (most recent call last): File "D:\QL_HestonModel_test.py", line 86, in <module> model.calibrate(options, method, EndCriteria(1000, 250, 1e-7, 1e-7, 1e-7)) File "D:\Progs\Python27\lib\site-packages\QuantLib\QuantLib.py", line 5431, in calibrate def calibrate(self, *args): return _QuantLib.CalibratedModel_calibrate(self, *args) NotImplementedError: Wrong number or type of arguments for overloaded function 'CalibratedModel_calibrate'. Possible C/C++ prototypes are: CalibratedModel::calibrate(std::vector< boost::shared_ptr< CalibrationHelper >,std::allocator< boost::shared_ptr< CalibrationHelper > > > const &,OptimizationMethod &,EndCriteria const &,Constraint const &,std::vector< Real,std::allocator< Real > > const &) CalibratedModel::calibrate(std::vector< boost::shared_ptr< CalibrationHelper >,std::allocator< boost::shared_ptr< CalibrationHelper > > > const &,OptimizationMethod &,EndCriteria const &,Constraint const &) CalibratedModel::calibrate(std::vector< boost::shared_ptr< CalibrationHelper >,std::allocator< boost::shared_ptr< CalibrationHelper > > > const &,OptimizationMethod &,EndCriteria const &) Code: options=[] .............. options.append(HestonModelHelper(maturity,calendar,s0.value(),strike[s], vol,riskFreeTS,dividendYield, CalibrationHelper.ImpliedVolError)) v0=0.1 kappa=1.0 theta=0.1 sigma=0.5 rho=-0.5 process=HestonProcess(riskFreeTS,dividendYield,s0,v0, kappa, theta, sigma, rho) model=HestonModel(process) engine=AnalyticHestonEngine(model,64) for option in options: option.setPricingEngine(engine) om=LevenbergMarquardt(1e-8, 1e-8, 1e-8); model.calibrate(options, om, EndCriteria(400, 40, 1.0e-8, 1.0e-8, 1.0e-8)) -- ------------------------------------------------------------------------------ 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-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |