1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2003 Ferdinando Ametrano
5 Copyright (C) 2001, 2002, 2003 Sadruddin Rejeb
6 Copyright (C) 2004, 2005 StatPro Italia srl
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
22#include <ql/processes/merton76process.hpp>
23#include <utility>
24
25namespace QuantLib {
26
27 Merton76Process::Merton76Process(const Handle<Quote>& stateVariable,
28 const Handle<YieldTermStructure>& dividendTS,
29 const Handle<YieldTermStructure>& riskFreeTS,
30 const Handle<BlackVolTermStructure>& blackVolTS,
31 Handle<Quote> jumpInt,
32 Handle<Quote> logJMean,
33 Handle<Quote> logJVol,
34 const ext::shared_ptr<discretization>& disc)
35 : StochasticProcess1D(disc), blackProcess_(
36 new BlackScholesMertonProcess(stateVariable, dividendTS, riskFreeTS, blackVolTS, disc)),
37 jumpIntensity_(std::move(jumpInt)), logMeanJump_(std::move(logJMean)),
38 logJumpVolatility_(std::move(logJVol)) {
39 registerWith(h: blackProcess_);
40 registerWith(h: jumpIntensity_);
41 registerWith(h: logMeanJump_);
42 registerWith(h: logJumpVolatility_);
43 }
44
45 Real Merton76Process::x0() const {
46 return blackProcess_->x0();
47 }
48
49 Time Merton76Process::time(const Date& d) const {
50 return blackProcess_->time(d);
51 }
52
53 const Handle<Quote>& Merton76Process::stateVariable() const {
54 return blackProcess_->stateVariable();
55 }
56
57 const Handle<YieldTermStructure>& Merton76Process::dividendYield() const {
58 return blackProcess_->dividendYield();
59 }
60
61 const Handle<YieldTermStructure>& Merton76Process::riskFreeRate() const {
62 return blackProcess_->riskFreeRate();
63 }
64
65 const Handle<BlackVolTermStructure>&
66 Merton76Process::blackVolatility() const {
67 return blackProcess_->blackVolatility();
68 }
69
70 const Handle<Quote>& Merton76Process::jumpIntensity() const {
71 return jumpIntensity_;
72 }
73
74 const Handle<Quote>& Merton76Process::logMeanJump() const {
75 return logMeanJump_;
76 }
77
78 const Handle<Quote>& Merton76Process::logJumpVolatility() const {
79 return logJumpVolatility_;
80 }
81
82}
83

source code of quantlib/ql/processes/merton76process.cpp

Morty Proxy This is a proxified and sanitized view of the page, visit original site.