Multivariate Analysis Package
0.3
A multivariate distributions analysis package
|
Independence Copula Distribution. More...
#include <IndependenceCopula.h>
Public Member Functions | |
IndependenceCopula (unsigned int Dimension=2U) | |
Constructs an Independence copula. More... | |
Eigen::MatrixXd | ExtractSamples (unsigned int NumSamples) const |
Generates multiple simulations from the copula. More... | |
double | GetCumulativeDesity (const Eigen::VectorXd &Coordinates) const |
Computes the copula function in correspondence of the supplied coordinates. More... | |
double | GetDensity (const Eigen::VectorXd &Coordinates) const |
Computes the copula density function in correspondence of the supplied coordinates. More... | |
Eigen::VectorXd | GetQuantile (double Prob) const |
Computes the inverse copula function in correspondence of the supplied probability. More... | |
Public Member Functions inherited from Multivariate::AbstarctCopula | |
Eigen::RowVectorXd | ExtractSample () const |
Generates a single simulation from the copula. More... | |
std::map< unsigned int, std::vector< double > > | ExtractSamplesMap (unsigned int NumSamples) const |
Generates multiple simulations from the copula. More... | |
std::vector< double > | ExtractSampleVector () const |
Generates a single simulation from the copula. More... | |
double | GetCumulativeDesity (const std::vector< double > &Coordinates) const |
Computes the copula function in correspondence of the supplied coordinates. More... | |
unsigned int | GetCurrentSeed () const |
Get the random number generator seed. More... | |
double | GetDensity (const std::vector< double > &Coordinates) const |
Computes the probability density function of the copula in correspondence of the supplied coordinates. More... | |
unsigned int | GetDimension () const |
Get the dimensionality of the copula. More... | |
std::vector< double > | GetQuantileVector (double Prob) const |
Computes the inverse copula function in correspondence of the supplied probability. More... | |
bool | IsValid () const |
Check if the copula is valid. More... | |
bool | SetDimension (unsigned int Dimension) |
Set the dimensionality of the copula. More... | |
void | SetRandomSeed (unsigned int NewSeed) |
Set the random number generator seed. More... | |
double * | GetQuantileArray (double Prob) |
Computes the inverse copula function in correspondence of the supplied probability. More... | |
double | GetCumulativeDesity (double *Coordinates) const |
Computes the copula function in correspondence of the supplied coordinates. More... | |
double | GetDensity (double *Coordinates) const |
Computes the probability density function of the copula in correspondence of the supplied coordinates. More... | |
double * | ExtractSampleArray () const |
Generates a single simulation from the copula. More... | |
double ** | ExtractSamplesMatix (unsigned int NumSamples) const |
Generates a single simulation from the copula. More... | |
Independence Copula Distribution.
This class provides the functionality of calculating the probability density value, cumulative probability density value, inverse cumulative probability density and generate random samples from an Independence copula.
Defining:
The independence copula distribution funtion is defined as: \( C(\textbf{x})= \prod_{n=1}^k x_n \) for \( \textbf{x} \in \textbf{(0,1)} \)
This is quite a trivial copula but is supplied for completeness
If you construct multiple instances of this class, to avoid the generated samples to be the same, you should supply a different seed. To do so, for example, you can call MyDistribution.SetRandomSeed(MyDistribution.GetCurrentSeed()+1U);
Please refer to the Examples page for usage examples.
|
inline |
Constructs an Independence copula.
Dimension | The dimensionality of the copula |
Construct an Independence copula.
In case The Dimension less than 2 the class will be considered invalid (it can be checked using IsValid()
) and won't produce any result until the problem is fixed.
If dimension is unspecified, a bivariate copula is constructed
|
inlinevirtual |
Generates multiple simulations from the copula.
NumSamples | The number of simulation to run |
This function generates NumSamples simulation from the current copula and returns them in matrix form.
If NumSamples is 0 or the copula is invalid, a null matrix is returned
Implements Multivariate::AbstarctCopula.
|
inlinevirtual |
Computes the copula function in correspondence of the supplied coordinates.
Coordinates | A vector containing the coordinates of the point for which the pdf should be computed |
This function computes the probability density function of the current copula associated with the given coordinates.
The coordinates must all be between 0 and 1
If the number of elements in Coordinates is different from the dimensionality of the distribution or the distribution is invalid, -1 is returned
Implements Multivariate::AbstarctCopula.
|
inlinevirtual |
Computes the copula density function in correspondence of the supplied coordinates.
Coordinates | A vector containing the coordinates of the point for which the pdf should be computed |
This function computes the probability density function of the current copula associated with the given coordinates.
The coordinates must all be between 0 and 1
If the number of elements in Coordinates is different from the dimensionality of the distribution or the distribution is invalid, -1 is returned
Implements Multivariate::AbstarctCopula.
|
inlinevirtual |
Computes the inverse copula function in correspondence of the supplied probability.
Prob | The probability for which the corresponding quantile must be found |
This function computes the inverse cumulative density function of the current distribution associated with the given probability.
The solution is unique only in the univariate case.
Generally the system of equations \( F^{-1}(Coordinates_1 \cdots Coordinates_k)=Prob \) has k-1 degrees of freedom, where k is the dimensionality of the distribution.
The additional restriction imposed to get to an unique solution is that each coordinate has equal distance from it's mean.
If the probability supplied is greater than 1, less than 0 or the distribution is invalid, an empty vector is returned.
Implements Multivariate::AbstarctCopula.