Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
lgmimpliedyieldtermstructure.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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
20
21namespace QuantExt {
22
23LgmImpliedYieldTermStructure::LgmImpliedYieldTermStructure(const QuantLib::ext::shared_ptr<LinearGaussMarkovModel>& model,
24 const DayCounter& dc, const bool purelyTimeBased,
25 const bool cacheValues)
26 : YieldTermStructure(dc == DayCounter() ? model->parametrization()->termStructure()->dayCounter() : dc),
27 cacheValues_(cacheValues), model_(model), purelyTimeBased_(purelyTimeBased),
28 referenceDate_(purelyTimeBased ? Null<Date>() : model_->parametrization()->termStructure()->referenceDate()),
29 state_(0.0) {
30 registerWith(model_);
31 update();
32}
33
34LgmImpliedYtsFwdFwdCorrected::LgmImpliedYtsFwdFwdCorrected(const QuantLib::ext::shared_ptr<LinearGaussMarkovModel>& model,
35 const Handle<YieldTermStructure> targetCurve,
36 const DayCounter& dc, const bool purelyTimeBased,
37 const bool cacheValues)
38 : LgmImpliedYieldTermStructure(model, dc, purelyTimeBased, cacheValues), targetCurve_(targetCurve) {
39
40 if (cacheValues_) {
41 dt_ = targetCurve_->discount(relativeTime_);
42 zeta_ = model_->parametrization()->zeta(relativeTime_);
43 Ht_ = model_->parametrization()->H(relativeTime_);
44 }
45 registerWith(targetCurve_);
46}
47
48LgmImpliedYtsSpotCorrected::LgmImpliedYtsSpotCorrected(const QuantLib::ext::shared_ptr<LinearGaussMarkovModel>& model,
49 const Handle<YieldTermStructure> targetCurve,
50 const DayCounter& dc, const bool purelyTimeBased,
51 const bool cacheValues)
52 : LgmImpliedYieldTermStructure(model, dc, purelyTimeBased, cacheValues), targetCurve_(targetCurve) {
53 registerWith(targetCurve_);
54}
55
56} // namespace QuantExt
LgmImpliedYieldTermStructure(const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &model, const DayCounter &dc=DayCounter(), const bool purelyTimeBased=false, const bool cacheValues=false)
const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > model_
LgmImpliedYtsFwdFwdCorrected(const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &model, const Handle< YieldTermStructure > targetCurve, const DayCounter &dc=DayCounter(), const bool purelyTimeBased=false, const bool cacheValues=false)
const Handle< YieldTermStructure > targetCurve_
const Handle< YieldTermStructure > targetCurve_
LgmImpliedYtsSpotCorrected(const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &model, const Handle< YieldTermStructure > targetCurve, const DayCounter &dc, const bool purelyTimeBased, const bool cacheValues=false)
yield term structure implied by a LGM model