3
* @file InverseNatafEllipticalCopulaFunction.cxx
4
* @brief Class for the InverseNataf transformation evaluation for elliptical
6
* (C) Copyright 2005-2007 EDF-EADS-Phimeca
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License.
13
* This library is distributed in the hope that it will be useful
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
* @author: $LastChangedBy: dutka $
23
* @date: $LastChangedDate: 2008-06-26 13:50:17 +0200 (jeu, 26 jun 2008) $
24
* Id: $Id: InverseNatafEllipticalCopulaFunction.cxx 862 2008-06-26 11:50:17Z dutka $
26
#include "InverseNatafEllipticalCopulaFunction.hxx"
30
namespace Uncertainty {
35
* @class InverseNatafEllipticalCopulaFunction
37
* This class offers an interface for the InverseNataf function for elliptical copula
40
CLASSNAMEINIT(InverseNatafEllipticalCopulaFunction);
42
/* Parameter constructor */
43
InverseNatafEllipticalCopulaFunction::InverseNatafEllipticalCopulaFunction(const Distribution & standardDistribution,
44
const SquareMatrix & cholesky,
46
NumericalMathEvaluationImplementation(name),
47
standardDistribution_(standardDistribution),
50
Description description;
51
for (UnsignedLong i = 0; i < cholesky_.getNbColumns(); ++i)
57
for (UnsignedLong i = 0; i < cholesky_.getNbRows(); ++i)
63
setDescription(description);
66
/* Virtual constructor */
67
InverseNatafEllipticalCopulaFunction * InverseNatafEllipticalCopulaFunction::clone() const
69
return new InverseNatafEllipticalCopulaFunction(*this);
72
/* String converter */
73
String InverseNatafEllipticalCopulaFunction::str() const
76
oss << "class=" << InverseNatafEllipticalCopulaFunction::GetClassName()
77
<< " description=" << getDescription()
78
<< " standardDistribution=" << standardDistribution_
79
<< " cholesky=" << cholesky_;
86
* This function transforms a standard elliptical distribution into an elliptical copula of the same kind with a correlation matrix R:
87
* Z(u) = L.u, where L is the Cholesky factor of R: L.L^t = R, L is lower triangular
88
* Si(u) = F(Zi), where F is the CDF of the standard elliptical distribution
90
InverseNatafEllipticalCopulaFunction::NumericalPoint InverseNatafEllipticalCopulaFunction::operator () (const NumericalPoint & in) const
91
throw (InvalidArgumentException, InternalException)
93
UnsignedLong dimension(getInputNumericalPointDimension());
94
// First, correlate the components
95
NumericalPoint result(cholesky_ * in);
96
Distribution standardMarginal(standardDistribution_.getMarginal(0));
97
// Second, apply the commmon marginal distribution
98
for (UnsignedLong i = 0; i < dimension; ++i)
100
result[i] = standardMarginal.computeCDF(NumericalPoint(1, result[i]));
105
/* Gradient according to the marginal parameters. Currently, the dependence parameter are not taken into account. */
107
InverseNatafEllipticalCopulaFunction::Matrix InverseNatafEllipticalCopulaFunction::parametersGradient(const NumericalPoint & in) const
109
return Matrix(0, getInputNumericalPointDimension());
112
/* Accessor for input point dimension */
113
UnsignedLong InverseNatafEllipticalCopulaFunction::getInputNumericalPointDimension() const
114
throw(InternalException)
116
return cholesky_.getNbColumns();
119
/* Accessor for output point dimension */
120
UnsignedLong InverseNatafEllipticalCopulaFunction::getOutputNumericalPointDimension() const
121
throw(InternalException)
123
return cholesky_.getNbRows();
126
} /* namespace Algorithm */
127
} /* namespace Uncertainty */
128
} /* namespace OpenTURNS */