Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
generatordefaulttermstructure.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 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 generatordefaulttermstructure.hpp
20 \brief Default curve implied from a single generator matrix
21 \ingroup termstructures
22*/
23
24#pragma once
25
26#include <ql/math/matrix.hpp>
27#include <ql/termstructures/credit/survivalprobabilitystructure.hpp>
28#include <ql/time/calendars/nullcalendar.hpp>
29#include <ql/time/daycounters/actual365fixed.hpp>
30
31namespace QuantExt {
32using namespace QuantLib;
33
34//! Default probability term structure implied from a transition matrix
35/*!
36 This class uses a transition or generator matrix to imply cumulative survival probabilities depending on initial
37 state.
38
39 \ingroup termstructures
40*/
42public:
44 //! Constructor using a single (annual!) transition matrix or a generator matrix
45 GeneratorDefaultProbabilityTermStructure(MatrixType matrixType, Matrix matrix, Size initialState,
46 const Date& referenceDate, const Calendar& cal = NullCalendar(),
47 const DayCounter& dc = Actual365Fixed());
48 Date maxDate() const override { return QuantLib::Date::maxDate(); }
49
50 //! return the underlying annualised transition matrix
51 const Matrix& transitionMatrix() const { return transitionMatrix_; }
52 const Matrix& generator() const { return generator_; }
53
54protected:
55 Probability survivalProbabilityImpl(Time) const override;
56
57private:
60 Matrix generator_;
61};
62
63} // namespace QuantExt
Default probability term structure implied from a transition matrix.
const Matrix & transitionMatrix() const
return the underlying annualised transition matrix