Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
irhwstateprocess.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 irhwstateprocess.hpp
20 \brief ir hw model state process
21 \ingroup processes
22*/
23
24#ifndef quantext_irhw_stateprocess_hpp
25#define quantext_irhw_stateprocess_hpp
26
28
29#include <ql/processes/eulerdiscretization.hpp>
30#include <ql/stochasticprocess.hpp>
31
32namespace QuantExt {
33using namespace QuantLib;
34
35//! Ir HW State Process
36/*! \ingroup processes
37 */
39public:
40 IrHwStateProcess(const QuantLib::ext::shared_ptr<IrHwParametrization>& parametrization, const IrModel::Measure measure,
42 const bool evaluateBankAccount = true)
43 : StochasticProcess(discretization == HwModel::Discretization::Euler ? QuantLib::ext::make_shared<EulerDiscretization>()
44 : nullptr),
45 parametrization_(parametrization), measure_(measure), discretization_(discretization),
46 evaluateBankAccount_(evaluateBankAccount) {
47 QL_REQUIRE(measure_ == IrModel::Measure::BA, "IrHwStateProcess only supports measure BA");
49 "IrHwStateProcess only supports dicsretization Euler");
50 }
51 Size size() const override {
52 return parametrization_->n() +
54 }
55 Size factors() const override {
58 ? parametrization_->m()
59 : 0);
60 }
61 Array initialValues() const override;
62 Array drift(Time t, const Array& s) const override;
63 Matrix diffusion(Time t, const Array& s) const override;
64
65private:
66 QuantLib::ext::shared_ptr<IrHwParametrization> parametrization_;
70};
71
72} // namespace QuantExt
73
74#endif
Matrix diffusion(Time t, const Array &s) const override
Size size() const override
Array drift(Time t, const Array &s) const override
HwModel::Discretization discretization_
Size factors() const override
QuantLib::ext::shared_ptr< IrHwParametrization > parametrization_
Array initialValues() const override
IrHwStateProcess(const QuantLib::ext::shared_ptr< IrHwParametrization > &parametrization, const IrModel::Measure measure, const HwModel::Discretization discretization=HwModel::Discretization::Euler, const bool evaluateBankAccount=true)
hull white n Factor model class