26 : parametrization_(parametrization), discretization_(discretization) {
27 QL_REQUIRE(
parametrization_ !=
nullptr,
"CommoditySchwartzModel: parametrization is null");
35 const QuantLib::Handle<QuantExt::PriceTermStructure>& priceCurve)
const {
36 QL_REQUIRE(T >= t && t >= 0.0,
"T(" << T <<
") >= t(" << t <<
") >= 0 required in CommoditySchwartzModel::forwardPrice");
37 Real f0T = priceCurve.empty() ?
parametrization_->priceCurve()->price(T) : priceCurve->price(T);
42 return f0T * std::exp(-state[0] * std::exp(-k*T) - 0.5 * (V0T - VtT));
44 return f0T * std::exp(-state[0] * std::exp(-k*(T-t)) - 0.5 * (V0T - VtT));
QuantLib::ext::shared_ptr< CommoditySchwartzParametrization > parametrization_
void update() override
observer and linked calibrated model interface
QuantLib::ext::shared_ptr< StochasticProcess > stateProcess_
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
void generateArguments() override
CommoditySchwartzModel(const QuantLib::ext::shared_ptr< CommoditySchwartzParametrization > ¶metrization, const Discretization discretization=Discretization::Euler)
Discretization discretization_
std::vector< QuantLib::ext::shared_ptr< Parameter > > arguments_
Schwartz (1997) one-factor model of the commodity price termstructure.
COM state process for the one-factor Schwartz model.