QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
liborforwardmodel.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2005, 2006 Klaus Spanderen
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
25#ifndef quantlib_libor_forward_model_hpp
26#define quantlib_libor_forward_model_hpp
27
28#include <ql/legacy/libormarketmodels/lfmprocess.hpp>
29#include <ql/termstructures/volatility/swaption/swaptionvolmatrix.hpp>
30#include <ql/termstructures/volatility/optionlet/capletvariancecurve.hpp>
31#include <ql/models/model.hpp>
32#include <ql/legacy/libormarketmodels/lfmcovarproxy.hpp>
33
34namespace QuantLib {
35
37
52 public:
54 const ext::shared_ptr<LiborForwardModelProcess> & process,
55 const ext::shared_ptr<LmVolatilityModel> & volaModel,
56 const ext::shared_ptr<LmCorrelationModel> & corrModel);
57
58 Rate S_0(Size alpha, Size beta) const;
59 // approx. swaption matrix using Rebonato's approx.
60 // fix and floating leg have the same frequency
61 virtual ext::shared_ptr<SwaptionVolatilityMatrix>
63
64 DiscountFactor discount(Time t) const override;
65 Real discountBond(Time now, Time maturity, Array factors) const override;
67 Real strike,
68 Time maturity,
69 Time bondMaturity) const override;
70
71 void setParams(const Array& params) override;
72
73 protected:
74 Array w_0(Size alpha, Size beta) const;
75
76 std::vector<Real> f_;
77 std::vector<Time> accrualPeriod_;
78
79 const ext::shared_ptr<LfmCovarianceProxy> covarProxy_;
80 const ext::shared_ptr<LiborForwardModelProcess> process_;
81
82 mutable ext::shared_ptr<SwaptionVolatilityMatrix> swaptionVola;
83 };
84
85}
86
87
88#endif
89
Affine model class.
Definition: model.hpp:45
1-D array used in linear algebra.
Definition: array.hpp:52
Calibrated model class.
Definition: model.hpp:86
Array params() const
Returns array of arguments on which calibration is done.
Definition: model.cpp:126
Real discountBond(Time now, Time maturity, Array factors) const override
const ext::shared_ptr< LfmCovarianceProxy > covarProxy_
void setParams(const Array &params) override
Rate S_0(Size alpha, Size beta) const
Array w_0(Size alpha, Size beta) const
std::vector< Time > accrualPeriod_
Real discountBondOption(Option::Type type, Real strike, Time maturity, Time bondMaturity) const override
DiscountFactor discount(Time t) const override
Implied discount curve.
virtual ext::shared_ptr< SwaptionVolatilityMatrix > getSwaptionVolatilityMatrix() const
const ext::shared_ptr< LiborForwardModelProcess > process_
ext::shared_ptr< SwaptionVolatilityMatrix > swaptionVola
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Real DiscountFactor
discount factor between dates
Definition: types.hpp:66
Real Rate
interest rates
Definition: types.hpp:70
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35