#include <qle/models/commodityschwartzmodel.hpp>
Public Types | |
enum class | Discretization { Euler , Exact } |
Public Member Functions | |
CommoditySchwartzModel (const QuantLib::ext::shared_ptr< CommoditySchwartzParametrization > ¶metrization, const Discretization discretization=Discretization::Euler) | |
const QuantLib::ext::shared_ptr< Parametrization > | parametrizationBase () const override |
Handle< PriceTermStructure > | termStructure () const override |
const Currency & | currency () const override |
Size | n () const override |
Size | m () const override |
QuantLib::ext::shared_ptr< StochasticProcess > | stateProcess () const override |
QuantLib::Real | forwardPrice (const QuantLib::Time t, const QuantLib::Time T, const QuantLib::Array &x, const QuantLib::Handle< QuantExt::PriceTermStructure > &priceCurve=QuantLib::Handle< QuantExt::PriceTermStructure >()) const override |
const QuantLib::ext::shared_ptr< CommoditySchwartzParametrization > | parametrization () const |
Schwartz model specific methods. More... | |
void | update () override |
observer and linked calibrated model interface More... | |
void | generateArguments () override |
virtual const QuantLib::ext::shared_ptr< Parametrization > | parametrizationBase () const =0 |
virtual Handle< PriceTermStructure > | termStructure () const =0 |
virtual const Currency & | currency () const =0 |
virtual Size | n () const =0 |
virtual Size | m () const =0 |
virtual QuantLib::ext::shared_ptr< StochasticProcess > | stateProcess () const =0 |
virtual QuantLib::Real | forwardPrice (const QuantLib::Time t, const QuantLib::Time T, const QuantLib::Array &x, const QuantLib::Handle< QuantExt::PriceTermStructure > &priceCurve=QuantLib::Handle< QuantExt::PriceTermStructure >()) const =0 |
Public Member Functions inherited from LinkableCalibratedModel | |
LinkableCalibratedModel () | |
void | update () override |
virtual void | calibrate (const std::vector< QuantLib::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... | |
virtual void | calibrate (const std::vector< QuantLib::ext::shared_ptr< BlackCalibrationHelper > > &, 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 >()) |
for backward compatibility More... | |
Real | value (const Array ¶ms, const std::vector< QuantLib::ext::shared_ptr< CalibrationHelper > > &) |
Real | value (const Array ¶ms, const std::vector< QuantLib::ext::shared_ptr< BlackCalibrationHelper > > &) |
for backward compatibility More... | |
const QuantLib::ext::shared_ptr< Constraint > & | constraint () const |
EndCriteria::Type | endCriteria () const |
Returns end criteria result. More... | |
const Array & | problemValues () const |
Returns the problem values. More... | |
Array | params () const |
Returns array of arguments on which calibration is done. More... | |
virtual void | setParams (const Array ¶ms) |
virtual void | setParam (Size idx, const Real value) |
Private Attributes | |
QuantLib::ext::shared_ptr< CommoditySchwartzParametrization > | parametrization_ |
Discretization | discretization_ |
QuantLib::ext::shared_ptr< StochasticProcess > | stateProcess_ |
Additional Inherited Members | |
virtual void | generateArguments () |
Protected Attributes inherited from LinkableCalibratedModel | |
std::vector< QuantLib::ext::shared_ptr< Parameter > > | arguments_ |
QuantLib::ext::shared_ptr< Constraint > | constraint_ |
EndCriteria::Type | endCriteria_ |
Array | problemValues_ |
Schwartz (1997) one-factor model of the commodity price termstructure with two constant parameters, sigma and kappa
Price curve dynamics (Martingale) dF(t,T) / F(t,T) = sigma * exp(-kappa * (T-t)) * dW
Model-implied price curve: F(t,T) = F(0,T) * exp{ X(t) * exp(-kappa*(T-t))) - 1/2 * (V(0,T)-V(t,T)) }, with
V(t,T) = sigma^2 * (1 - exp(-2*kappa*(T-t))) / (2*kappa), and dX(t) = -kappa * X(t) * dt + sigma * dW(t), X(0) = 0
In terms of drift-free state variable Y(t) = exp(kappa*t) * X(t): F(t,T) = F(0,T) * exp{ Y(t) * exp(-kappa*T)) - 1/2 * (V(0,T)-V(t,T)) }, dY(t) = sigma * exp(kappa * t) dW(t), Y(0) = 0
Definition at line 52 of file commodityschwartzmodel.hpp.
|
strong |
Enumerator | |
---|---|
Euler | |
Exact |
Definition at line 54 of file commodityschwartzmodel.hpp.
CommoditySchwartzModel | ( | const QuantLib::ext::shared_ptr< CommoditySchwartzParametrization > & | parametrization, |
const Discretization | discretization = Discretization::Euler |
||
) |
Definition at line 24 of file commodityschwartzmodel.cpp.
|
overridevirtual |
parametrization (as base class)
Implements CommodityModel.
Definition at line 61 of file commodityschwartzmodel.hpp.
|
overridevirtual |
price term structure to which the model is (initially) calibrated
Implements CommodityModel.
Definition at line 63 of file commodityschwartzmodel.hpp.
|
overridevirtual |
currency of the commodity
Implements CommodityModel.
Definition at line 65 of file commodityschwartzmodel.hpp.
|
overridevirtual |
dimension of model state
Implements CommodityModel.
Definition at line 67 of file commodityschwartzmodel.hpp.
|
overridevirtual |
number of Brownians to evolve the state
Implements CommodityModel.
Definition at line 68 of file commodityschwartzmodel.hpp.
|
overridevirtual |
stochastic process, this has dimension n() and m() Brownian drivers
Implements CommodityModel.
Definition at line 70 of file commodityschwartzmodel.hpp.
|
overridevirtual |
stochastic forward price curve F(t,T) at future time t depending on state (of dimension n())
Implements CommodityModel.
Definition at line 34 of file commodityschwartzmodel.cpp.
const QuantLib::ext::shared_ptr< CommoditySchwartzParametrization > parametrization | ( | ) | const |
|
override |
observer and linked calibrated model interface
Definition at line 47 of file commodityschwartzmodel.cpp.
|
overridevirtual |
Reimplemented from LinkableCalibratedModel.
Definition at line 52 of file commodityschwartzmodel.cpp.
|
private |
Definition at line 84 of file commodityschwartzmodel.hpp.
|
private |
Definition at line 85 of file commodityschwartzmodel.hpp.
|
private |
Definition at line 86 of file commodityschwartzmodel.hpp.