24#ifndef quantlib_gsr_hpp
25#define quantlib_gsr_hpp
39 std::vector<Date> volstepdates,
40 const std::vector<Real>& volatilities,
45 std::vector<Date> volstepdates,
46 const std::vector<Real>& volatilities,
47 const std::vector<Real>& reversions,
51 std::vector<Date> volstepdates,
57 std::vector<Date> volstepdates,
74 res.insert(res.end(), vol.begin(), vol.end());
82 res.insert(res.end(), vol.begin(), vol.end());
88 "volatility with index " << i <<
" does not exist (0..."
97 "reversion with index " << i <<
" does not exist (0..."
111 const std::vector<ext::shared_ptr<BlackCalibrationHelper> > &helpers,
114 const std::vector<Real> &weights = std::vector<Real>()) {
116 for (
Size i = 0; i < helpers.size(); i++) {
117 std::vector<ext::shared_ptr<CalibrationHelper> > h(1, helpers[i]);
127 const std::vector<ext::shared_ptr<BlackCalibrationHelper> > &helpers,
130 const std::vector<Real> &weights = std::vector<Real>()) {
132 for (
Size i = 0; i < helpers.size(); i++) {
133 std::vector<ext::shared_ptr<CalibrationHelper> > h(1, helpers[i]);
145 ext::static_pointer_cast<GsrProcess>(
stateProcess_)->flushCache();
191 ->getForwardMeasureTime();
196 ->setForwardMeasureTime(
T);
1-D array used in linear algebra.
EndCriteria::Type endCriteria() const
Returns end criteria result.
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)
Criteria to end optimization process:
void performCalculations() const override
ext::shared_ptr< StochasticProcess1D > stateProcess_
One factor gsr model, formulation is in forward measure.
std::vector< Date > volstepdates_
Real zerobondImpl(Time T, Time t, Real y, const Handle< YieldTermStructure > &yts) const override
void performCalculations() const override
ext::shared_ptr< ReversionObserver > reversionObserver_
std::vector< bool > MoveReversion(Size i)
void generateArguments() override
std::vector< Handle< Quote > > volatilities_
const Array & volatility() const
std::vector< Handle< Quote > > reversions_
Real numeraireTime() const
const Array & reversion() const
ext::shared_ptr< VolatilityObserver > volatilityObserver_
void calibrateVolatilitiesIterative(const std::vector< ext::shared_ptr< BlackCalibrationHelper > > &helpers, OptimizationMethod &method, const EndCriteria &endCriteria, const Constraint &constraint=Constraint(), const std::vector< Real > &weights=std::vector< Real >())
void calibrateReversionsIterative(const std::vector< ext::shared_ptr< BlackCalibrationHelper > > &helpers, OptimizationMethod &method, const EndCriteria &endCriteria, const Constraint &constraint=Constraint(), const std::vector< Real > &weights=std::vector< Real >())
std::vector< bool > MoveVolatility(Size i)
std::vector< bool > FixedReversions()
std::vector< Time > volsteptimes_
std::vector< bool > FixedVolatilities()
Real numeraireImpl(Time t, Real y, const Handle< YieldTermStructure > &yts) const override
Shared handle to an observable.
Object that gets notified when a given observable changes.
Abstract class for constrained optimization method.
Base class for model arguments.
const Array & params() const
const Handle< YieldTermStructure > & termStructure() const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
basic interface for one factor interest rate models
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
GSR model process with piecewise volatilities and mean reversions, the dynamic is expressed in some T...
ReversionObserver(Gsr *p)
VolatilityObserver(Gsr *p)