QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
onefactorgaussiancopula.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 Roland Lichters
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
24#ifndef quantlib_one_factor_gaussian_copula_hpp
25#define quantlib_one_factor_gaussian_copula_hpp
26
27#include <ql/experimental/credit/onefactorcopula.hpp>
28#include <ql/math/distributions/normaldistribution.hpp>
29
30namespace QuantLib {
31
33
41 public:
43 Real maximum = 5, Size integrationSteps = 50)
44 : OneFactorCopula (correlation, maximum, integrationSteps) {
46 }
47 Real density(Real m) const override;
48 Real cumulativeZ(Real z) const override;
50 Real cumulativeY(Real y) const override;
51 Real testCumulativeY (Real y) const;
53 Real inverseCumulativeY(Real p) const override;
54
55 private:
56 // nothing to be done when correlation changes
57 void performCalculations() const override {}
58
62 };
63
65 return density_(m);
66 }
67
69 return cumulative_(z);
70 }
71
73 return cumulative_(y);
74 }
75
77 return inverseCumulative_(p);
78 }
79
80}
81
82#endif
Cumulative normal distribution function.
Shared handle to an observable.
Definition: handle.hpp:41
Inverse cumulative normal distribution function.
Normal distribution function.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Definition: observable.hpp:228
Abstract base class for one-factor copula models.
Real correlation() const
Single correlation parameter.
CumulativeNormalDistribution cumulative_
Real cumulativeY(Real y) const override
OneFactorGaussianCopula(const Handle< Quote > &correlation, Real maximum=5, Size integrationSteps=50)
Real density(Real m) const override
Density function of M.
Real cumulativeZ(Real z) const override
Cumulative distribution of Z.
Real inverseCumulativeY(Real p) const override
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35