QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
correlationstructure.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) 2014 Jose Aparicio
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20#ifndef quantlib_correl_term_structure_hpp
21#define quantlib_correl_term_structure_hpp
22
23#include <ql/termstructure.hpp>
24
25namespace QuantLib {
26
27 // pretty much like the volatility TS, here the correlation range is
28 // obviously known in advance and theres no reference to a strike.
29
30 /*! Abstract interface, derived correlations TS might have elements with
31 arbitrary dimensions.\par
32 In principle there might be several extrapolation dimensions, at this
33 level we do not know how many or the nature of those dimensions (time,
34 strike...)
35 Equally we ignore at this level if the correlation is a number,
36 matrix. Rather than including an arbitrary size matrix this data
37 structure is deferred in the hierarchy to enable potential optimizations
38 on the data nature.
39 */
41 public:
42 /*! \name Constructors
43 See the TermStructure documentation for issues regarding
44 constructors.
45 */
46 //@{
47 //! default constructor
48 /*! \warning term structures initialized by means of this
49 constructor must manage their own reference date
50 by overriding the referenceDate() method.
51 */
54 const DayCounter& dc = DayCounter());
55 //! initialize with a fixed reference date
57 const Calendar& cal,
59 const DayCounter& dc = DayCounter());
60 //! calculate the reference date based on the global evaluation date
62 const Calendar& cal,
64 const DayCounter& dc = DayCounter());
65 //@}
67 //! period/date conversion
68 Date dateFromTenor(const Period&) const;
69 //! The size of the squared correlation.
70 virtual Size correlationSize() const = 0;
71 private:
73 };
74
75 // inline definitions
78 return bdc_;
79 }
80
81 inline Date
83 // swaption style, still holds here.
85 p,
87 }
88}
89
90#endif
calendar class
Definition: calendar.hpp:61
Date advance(const Date &, Integer n, TimeUnit unit, BusinessDayConvention convention=Following, bool endOfMonth=false) const
Definition: calendar.cpp:130
CorrelationTermStructure(const Date &referenceDate, const Calendar &cal, BusinessDayConvention bdc, const DayCounter &dc=DayCounter())
initialize with a fixed reference date
Date dateFromTenor(const Period &) const
period/date conversion
virtual Size correlationSize() const =0
The size of the squared correlation.
BusinessDayConvention businessDayConvention() const
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Basic term-structure functionality.
virtual Natural settlementDays() const
the settlementDays used for reference date calculation
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
virtual Calendar calendar() const
the calendar used for reference and/or option date calculation
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
base class for term structures