Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
commoditymodel.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2022 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file commoditymodel.hpp
20 \brief Commodity model base class
21 \ingroup models
22*/
23
24#pragma once
25
26#include <ql/math/array.hpp>
27#include <ql/stochasticprocess.hpp>
31
32namespace QuantExt {
33
35public:
36 /*! parametrization (as base class) */
37 virtual const QuantLib::ext::shared_ptr<Parametrization> parametrizationBase() const = 0;
38
39 /*! price term structure to which the model is (initially) calibrated */
40 virtual Handle<PriceTermStructure> termStructure() const = 0;
41
42 /*! currency of the commodity */
43 virtual const Currency& currency() const = 0;
44
45 /*! dimension of model state */
46 virtual Size n() const = 0;
47
48 /*! number of Brownians to evolve the state */
49 virtual Size m() const = 0;
50
51 /*! stochastic process, this has dimension n() and m() Brownian drivers */
52 virtual QuantLib::ext::shared_ptr<StochasticProcess> stateProcess() const = 0;
53
54 /*! stochastic forward price curve F(t,T) at future time t depending on state (of dimension n()) */
55 virtual QuantLib::Real forwardPrice(
56 const QuantLib::Time t, const QuantLib::Time T, const QuantLib::Array& x,
57 const QuantLib::Handle<QuantExt::PriceTermStructure>& priceCurve
58 = QuantLib::Handle<QuantExt::PriceTermStructure>()) const = 0;
59};
60
61} // namespace QuantExt
virtual Size n() 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
virtual Handle< PriceTermStructure > termStructure() const =0
virtual const Currency & currency() const =0
virtual Size m() const =0
virtual QuantLib::ext::shared_ptr< StochasticProcess > stateProcess() const =0
virtual const QuantLib::ext::shared_ptr< Parametrization > parametrizationBase() const =0
Calibrated model class with linkable parameters.
calibrated model class with linkable parameters
base class for model parametrizations
Term structure of prices.