QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
defaultprobabilitykey.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2009 StatPro Italia srl
5 Copyright (C) 2009 Jose Aparicio
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
21/*! \file defaultprobabilitykey.hpp
22 \brief Classes for default-event description.
23*/
24
25#ifndef quantlib_default_probability_key_hpp
26#define quantlib_default_probability_key_hpp
27
29#include <ql/currency.hpp>
30#include <vector>
31
32namespace QuantLib {
33
34 /*! Used to index market implied credit curve probabilities. It is
35 a proxy to the defaultable bond or class of bonds which
36 determines the credit contract conditions. It aggregates the
37 atomic default types in a group defining the contract
38 conditions and which serves to index the probability curves
39 calibrated to the market.
40 */
42 protected:
43 //! aggregation of event types for which the contract is sensitive.
44 std::vector<ext::shared_ptr<DefaultType> > eventTypes_;
45 //! Currency of the bond and protection leg payment.
47 //! Reference bonds seniority.
49
50 public:
52
53 DefaultProbKey(std::vector<ext::shared_ptr<DefaultType> > eventTypes,
54 Currency cur,
55 Seniority sen);
56
57 const Currency& currency() const {return obligationCurrency_;}
58 Seniority seniority() const {return seniority_;}
59 const std::vector<ext::shared_ptr<DefaultType> >&
60 eventTypes() const {
61 return eventTypes_;
62 }
63 Size size() const {return eventTypes_.size();}
64 };
65
66 bool operator==(const DefaultProbKey& lhs, const DefaultProbKey& rhs);
67
68
69 //! ISDA standard default contractual key for corporate US debt.
70 // Restructuring here can be set to NoRestructuring.
72 public:
73 // with only one restructuring type
75 Seniority sen,
76 Period graceFailureToPay =
77 Period(30, Days),
78 Real amountFailure = 1.e6,
79 Restructuring::Type resType =
81 };
82
83}
84
85#endif
Currency specification
Definition: currency.hpp:36
Currency obligationCurrency_
Currency of the bond and protection leg payment.
const Currency & currency() const
const std::vector< ext::shared_ptr< DefaultType > > & eventTypes() const
std::vector< ext::shared_ptr< DefaultType > > eventTypes_
aggregation of event types for which the contract is sensitive.
Seniority seniority_
Reference bonds seniority.
ISDA standard default contractual key for corporate US debt.
Currency specification.
Classes for default-event description.
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
bool operator==(const Currency &c1, const Currency &c2)
Definition: currency.hpp:231
Seniority
Seniority of a bond.
Definition: defaulttype.hpp:37