Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
irmodel.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 irmodel.hpp
20 \brief ir model base class
21 \ingroup models
22*/
23
24#pragma once
25
26#include <ql/math/array.hpp>
27#include <ql/stochasticprocess.hpp>
30
31namespace QuantExt {
32
34public:
35 enum class Measure { LGM, BA };
36
37 /*! measure under which the model is operated */
38 virtual Measure measure() const = 0;
39
40 /*! parametrization (as base class) */
41 virtual const QuantLib::ext::shared_ptr<Parametrization> parametrizationBase() const = 0;
42
43 /*! yield term structure to which the IrModel is (initially) calibrated */
44 virtual Handle<YieldTermStructure> termStructure() const = 0;
45
46 /*! dimension of model state, excluding auxilliary states */
47 virtual Size n() const = 0;
48
49 /*! number of Brownians to evolve the state */
50 virtual Size m() const = 0;
51
52 /*! (effective) dimension of auxilliary state, typically to evaluate the numeraire in the BA-measure */
53 virtual Size n_aux() const = 0;
54
55 /*! (effective) number of Brownians required to evolve the auxilliary state, typcially for exact discretization
56 * schemes */
57 virtual Size m_aux() const = 0;
58
59 /*! stochastic process, this has dimension n() + n_aux() and m() + m_aux() Brownian drivers */
60 virtual QuantLib::ext::shared_ptr<StochasticProcess> stateProcess() const = 0;
61
62 /*! discount bond depending on state (of dimension n()) */
63 virtual QuantLib::Real discountBond(
64 const QuantLib::Time t, const QuantLib::Time T, const QuantLib::Array& x,
65 const QuantLib::Handle<QuantLib::YieldTermStructure>& discountCurve = Handle<YieldTermStructure>()) const = 0;
66
67 /*! numeraire depending on state and aux state (of dimensions n(), n_aux() */
68 virtual QuantLib::Real
69 numeraire(const QuantLib::Time t, const QuantLib::Array& x,
70 const QuantLib::Handle<QuantLib::YieldTermStructure>& discountCurve = Handle<YieldTermStructure>(),
71 const QuantLib::Array& aux = Array()) const = 0;
72
73 /*! short rate at t */
74 virtual QuantLib::Real shortRate(
75 const QuantLib::Time t, const QuantLib::Array& x,
76 const QuantLib::Handle<QuantLib::YieldTermStructure>& discountCurve = Handle<YieldTermStructure>()) const = 0;
77};
78
79} // namespace QuantExt
virtual QuantLib::Real discountBond(const QuantLib::Time t, const QuantLib::Time T, const QuantLib::Array &x, const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve=Handle< YieldTermStructure >()) const =0
virtual Size n() const =0
virtual Measure measure() const =0
virtual Size m_aux() const =0
virtual Size m() const =0
virtual Handle< YieldTermStructure > termStructure() const =0
virtual QuantLib::Real numeraire(const QuantLib::Time t, const QuantLib::Array &x, const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const QuantLib::Array &aux=Array()) const =0
virtual Size n_aux() const =0
virtual QuantLib::ext::shared_ptr< StochasticProcess > stateProcess() const =0
virtual const QuantLib::ext::shared_ptr< Parametrization > parametrizationBase() const =0
virtual QuantLib::Real shortRate(const QuantLib::Time t, const QuantLib::Array &x, const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve=Handle< YieldTermStructure >()) const =0
Calibrated model class with linkable parameters.
calibrated model class with linkable parameters
base class for model parametrizations