/src/quantlib/ql/experimental/variancegamma/variancegammamodel.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | |
3 | | /* |
4 | | Copyright (C) 2010 Adrian O' Neill |
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 | | #include <ql/experimental/variancegamma/variancegammamodel.hpp> |
21 | | #include <ql/quotes/simplequote.hpp> |
22 | | #include <ql/shared_ptr.hpp> |
23 | | |
24 | | namespace QuantLib { |
25 | | |
26 | | VarianceGammaModel::VarianceGammaModel( |
27 | | const ext::shared_ptr<VarianceGammaProcess> & process) |
28 | 0 | : CalibratedModel(3), process_(process) { |
29 | 0 | arguments_[0] = ConstantParameter(process->sigma(), |
30 | 0 | PositiveConstraint()); |
31 | 0 | arguments_[1] = ConstantParameter(process->nu(), |
32 | 0 | PositiveConstraint()); |
33 | 0 | arguments_[2] = ConstantParameter(process->theta(), |
34 | 0 | NoConstraint()); |
35 | |
|
36 | 0 | VarianceGammaModel::generateArguments(); |
37 | |
|
38 | 0 | registerWith(process_->riskFreeRate()); |
39 | 0 | registerWith(process_->dividendYield()); |
40 | 0 | registerWith(process_->s0()); |
41 | 0 | } Unexecuted instantiation: QuantLib::VarianceGammaModel::VarianceGammaModel(boost::shared_ptr<QuantLib::VarianceGammaProcess> const&) Unexecuted instantiation: QuantLib::VarianceGammaModel::VarianceGammaModel(boost::shared_ptr<QuantLib::VarianceGammaProcess> const&) |
42 | | |
43 | 0 | void VarianceGammaModel::generateArguments() { |
44 | 0 | process_ = ext::make_shared<VarianceGammaProcess>(process_->s0(), |
45 | 0 | process_->dividendYield(), |
46 | 0 | process_->riskFreeRate(), |
47 | 0 | sigma(), nu(), theta()); |
48 | 0 | } |
49 | | |
50 | | } |
51 | | |