26#ifndef quantlib_interest_rate_model_hpp
27#define quantlib_interest_rate_model_hpp
38 class OptimizationMethod;
52 Array factors)
const = 0;
57 Time bondMaturity)
const = 0;
63 Time bondMaturity)
const;
100 const std::vector<ext::shared_ptr<CalibrationHelper> >&,
104 const std::vector<Real>& weights = std::vector<Real>(),
105 const std::vector<bool>& fixParameters = std::vector<bool>());
108 const std::vector<ext::shared_ptr<CalibrationHelper> >&);
110 const ext::shared_ptr<Constraint>&
constraint()
const;
136 class CalibrationFunction;
155 Time bondMaturity)
const {
159 inline const ext::shared_ptr<Constraint>&
168 explicit Impl(
const std::vector<Parameter>& arguments)
174 Size size = argument.size();
175 Array testParams(size);
176 for (
Size j=0; j<size; j++, k++)
177 testParams[j] =
params[k];
178 if (!argument.testParams(testParams))
188 totalSize += argument.
size();
190 Array result(totalSize);
192 Size size = argument.size();
193 Array partialParams(size);
194 for (
Size j = 0; j < size; j++, k++)
195 partialParams[j] =
params[k];
196 Array tmpBound = argument.constraint().upperBound(partialParams);
197 for (
Size j = 0; j < size; j++, k2++)
198 result[k2] = tmpBound[j];
207 totalSize += argument.
size();
209 Array result(totalSize);
211 Size size = argument.size();
212 Array partialParams(size);
213 for (
Size j = 0; j < size; j++, k++)
214 partialParams[j] =
params[k];
215 Array tmpBound = argument.constraint().lowerBound(partialParams);
216 for (
Size j = 0; j < size; j++, k2++)
217 result[k2] = tmpBound[j];
Calibration helper class.
virtual Real discountBondOption(Option::Type type, Real strike, Time maturity, Time bondMaturity) const =0
virtual DiscountFactor discount(Time t) const =0
Implied discount curve.
virtual Real discountBond(Time now, Time maturity, Array factors) const =0
1-D array used in linear algebra.
Size size() const
dimension of the array
bool test(const Array ¶ms) const override
Tests if params satisfy the constraint.
Array lowerBound(const Array ¶ms) const override
Returns lower bound for given parameters.
Array upperBound(const Array ¶ms) const override
Returns upper bound for given parameters.
Impl(const std::vector< Parameter > &arguments)
const std::vector< Parameter > & arguments_
PrivateConstraint(const std::vector< Parameter > &arguments)
const Array & problemValues() const
Returns the problem values.
virtual void generateArguments()
Array params() const
Returns array of arguments on which calibration is done.
EndCriteria::Type endCriteria() const
Returns end criteria result.
Real value(const Array ¶ms, const std::vector< ext::shared_ptr< CalibrationHelper > > &)
Integer functionEvaluation_
Integer functionEvaluation() const
EndCriteria::Type shortRateEndCriteria_
ext::shared_ptr< Constraint > constraint_
std::vector< Parameter > arguments_
const ext::shared_ptr< Constraint > & constraint() const
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)
virtual void setParams(const Array ¶ms)
Base class for constraint implementations.
Criteria to end optimization process:
Shared handle to an observable.
Object that notifies its changes to a set of observers.
Object that gets notified when a given observable changes.
Abstract class for constrained optimization method.
Abstract short-rate model class.
virtual ext::shared_ptr< Lattice > tree(const TimeGrid &) const =0
Term-structure consistent model class.
TermStructureConsistentModel(Handle< YieldTermStructure > termStructure)
const Handle< YieldTermStructure > & termStructure() const
Handle< YieldTermStructure > termStructure_
Optimization criteria class.
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
QL_INTEGER Integer
integer number
std::size_t Size
size of a container
Tree-based lattice-method class.