QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CalibratedModel Class Reference

Calibrated model class. More...

#include <model.hpp>

+ Inheritance diagram for CalibratedModel:
+ Collaboration diagram for CalibratedModel:

Classes

class  PrivateConstraint
 

Public Member Functions

 CalibratedModel (Size nArguments)
 
void update () override
 
virtual void calibrate (const std::vector< ext::shared_ptr< CalibrationHelper > > &, OptimizationMethod &method, const EndCriteria &endCriteria, const Constraint &constraint=Constraint(), const std::vector< Real > &weights=std::vector< Real >(), const std::vector< bool > &fixParameters=std::vector< bool >())
 Calibrate to a set of market instruments (usually caps/swaptions) More...
 
Real value (const Array &params, const std::vector< ext::shared_ptr< CalibrationHelper > > &)
 
const ext::shared_ptr< Constraint > & constraint () const
 
EndCriteria::Type endCriteria () const
 Returns end criteria result. More...
 
const ArrayproblemValues () const
 Returns the problem values. More...
 
Array params () const
 Returns array of arguments on which calibration is done. More...
 
virtual void setParams (const Array &params)
 
Integer functionEvaluation () const
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 

Protected Member Functions

virtual void generateArguments ()
 

Protected Attributes

std::vector< Parameterarguments_
 
ext::shared_ptr< Constraintconstraint_
 
EndCriteria::Type shortRateEndCriteria_ = EndCriteria::None
 
Array problemValues_
 
Integer functionEvaluation_
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 

Detailed Description

Calibrated model class.

Definition at line 86 of file model.hpp.

Constructor & Destructor Documentation

◆ CalibratedModel()

CalibratedModel ( Size  nArguments)

Definition at line 32 of file model.cpp.

Member Function Documentation

◆ update()

void update ( )
overridevirtual

This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.

Implements Observer.

Reimplemented in Gsr, MarkovFunctional, and GridModelLocalVolSurface.

Definition at line 90 of file model.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calibrate()

void calibrate ( const std::vector< ext::shared_ptr< CalibrationHelper > > &  instruments,
OptimizationMethod method,
const EndCriteria endCriteria,
const Constraint constraint = Constraint(),
const std::vector< Real > &  weights = std::vector<Real>(),
const std::vector< bool > &  fixParameters = std::vector<bool>() 
)
virtual

Calibrate to a set of market instruments (usually caps/swaptions)

An additional constraint can be passed which must be satisfied in addition to the constraints of the model.

Reimplemented in MarkovFunctional.

Definition at line 75 of file model.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ value()

Real value ( const Array params,
const std::vector< ext::shared_ptr< CalibrationHelper > > &  instruments 
)

Definition at line 117 of file model.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ constraint()

const ext::shared_ptr< Constraint > & constraint ( ) const

Definition at line 160 of file model.hpp.

+ Here is the caller graph for this function:

◆ endCriteria()

EndCriteria::Type endCriteria ( ) const

Returns end criteria result.

Definition at line 113 of file model.hpp.

+ Here is the caller graph for this function:

◆ problemValues()

const Array & problemValues ( ) const

Returns the problem values.

Definition at line 116 of file model.hpp.

◆ params()

Array params ( ) const

Returns array of arguments on which calibration is done.

Definition at line 126 of file model.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setParams()

void setParams ( const Array params)
virtual

Reimplemented in LiborForwardModel.

Definition at line 138 of file model.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ functionEvaluation()

Integer functionEvaluation ( ) const

Definition at line 122 of file model.hpp.

◆ generateArguments()

virtual void generateArguments ( )
protectedvirtual

Reimplemented in GeneralizedHullWhite, VarianceGammaModel, BatesModel, GJRGARCHModel, HestonModel, ExtendedCoxIngersollRoss, Gsr, HullWhite, MarkovFunctional, G2, and GridModelLocalVolSurface.

Definition at line 125 of file model.hpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ arguments_

std::vector<Parameter> arguments_
protected

Definition at line 126 of file model.hpp.

◆ constraint_

ext::shared_ptr<Constraint> constraint_
protected

Definition at line 127 of file model.hpp.

◆ shortRateEndCriteria_

EndCriteria::Type shortRateEndCriteria_ = EndCriteria::None
protected

Definition at line 128 of file model.hpp.

◆ problemValues_

Array problemValues_
protected

Definition at line 129 of file model.hpp.

◆ functionEvaluation_

Integer functionEvaluation_
protected

Definition at line 130 of file model.hpp.