Multivariate Analysis Package
0.3
A multivariate distributions analysis package
|
Copulas base class. More...
#include <AbsaractCopula.h>
Public Member Functions | |
Eigen::RowVectorXd | ExtractSample () const |
Generates a single simulation from the copula. More... | |
virtual Eigen::MatrixXd | ExtractSamples (unsigned int NumSamples) const =0 |
Generates multiple simulations 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... | |
virtual double | GetCumulativeDesity (const Eigen::VectorXd &Coordinates) const =0 |
Computes the copula function in correspondence of the supplied coordinates. 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... | |
virtual double | GetDensity (const Eigen::VectorXd &Coordinates) const =0 |
Computes the probability density function of the copula in correspondence of the supplied coordinates. 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... | |
virtual Eigen::VectorXd | GetQuantile (double Prob) const =0 |
Computes the inverse copula function in correspondence of the supplied probability. 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... | |
Unsafe Methods | |
The methods in this group use unsafe memory access or return arrays allocated on the heap that must be manually deleted. These functions are normally not compiled for safety reasons. To use them, the mvPackageUnsafeMethods symbol must be defined at compile time | |
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... | |
Copulas base class.
Class that works as an interface to copulas
To generate samples a boost::random::mt19937 random number generator is used and seeded with std::time(NULL).
If you construct multiple instances of derived classes, 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);
|
inline |
Generates a single simulation from the copula.
This is equal to calling ExtractSamples(1U)
double * AbstarctCopula::ExtractSampleArray | ( | ) | const |
Generates a single simulation from the copula.
This is equivalent to ExtractSample() but returns an array intead of an Eigen::RowVectorXd. If it can't be calculated, NULL is returned
|
pure virtual |
Generates multiple simulations from the copula.
NumSamples | The number of simulation to run |
This is a pure virtual function. Refer to child documentation for specific implementation details
Implemented in Multivariate::GaussianCopula, Multivariate::tCopula, and Multivariate::IndependenceCopula.
std::map< unsigned int, std::vector< double > > AbstarctCopula::ExtractSamplesMap | ( | unsigned int | NumSamples | ) | const |
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 a map form.
If NumSamples is 0 or the distribution is invalid, an empty map is returned
double ** AbstarctCopula::ExtractSamplesMatix | ( | unsigned int | NumSamples | ) | const |
Generates a single simulation from the copula.
NumSamples | The number of simulation to run |
This is equivalent to ExtractSamples() but returns a matrix intead of an Eigen::MatrixXd. If it can't be calculated, NULL is returned
std::vector< double > AbstarctCopula::ExtractSampleVector | ( | ) | const |
Generates a single simulation from the copula.
This is equivalent to ExtractSample() but returns an std::vector intead of an Eigen::RowVectorXd
|
pure virtual |
Computes the copula function in correspondence of the supplied coordinates.
Coordinates | A vector containing the coordinates of the point for which the cdf should be computed |
This is a pure virtual function. Refer to child documentation for specific implementation details
Implemented in Multivariate::GaussianCopula, Multivariate::tCopula, and Multivariate::IndependenceCopula.
double AbstarctCopula::GetCumulativeDesity | ( | const std::vector< double > & | Coordinates | ) | const |
Computes the copula function in correspondence of the supplied coordinates.
Coordinates | A vector containing the coordinates of the point for which the cdf should be computed |
This is an overloaded version of GetCumulativeDesity(const Eigen::VectorXd&, bool, unsigned int)const
double AbstarctCopula::GetCumulativeDesity | ( | double * | Coordinates | ) | const |
Computes the copula function in correspondence of the supplied coordinates.
Coordinates | An array containing the coordinates of the point for which the cdf should be computed |
This is an overloaded version of GetCumulativeDesity(const Eigen::VectorXd& Coordinates, bool UseGenz, unsigned int NumSimul)
|
inline |
Get the random number generator seed.
This function return the seed that was used to initialize the random number generator.
|
pure virtual |
Computes the probability density function of the copula in correspondence of the supplied coordinates.
Coordinates | A vector containing the coordinates of the point for which the pdf should be computed |
This is a pure virtual function. Refer to child documentation for specific implementation details
Implemented in Multivariate::GaussianCopula, Multivariate::tCopula, and Multivariate::IndependenceCopula.
double AbstarctCopula::GetDensity | ( | const std::vector< double > & | Coordinates | ) | const |
Computes the probability density function of the copula in correspondence of the supplied coordinates.
Coordinates | A vector containing the coordinates of the point for which the pdf should be computed |
This is an overloaded version of GetDensity(const Eigen::VectorXd& Coordinates, bool GetLogDensity)const
double AbstarctCopula::GetDensity | ( | double * | Coordinates | ) | const |
Computes the probability density function of the copula in correspondence of the supplied coordinates.
Coordinates | An array containing the coordinates of the point for which the pdf should be computed |
This is an overloaded version of GetDensity(const Eigen::VectorXd&, bool)
|
inline |
Get the dimensionality of the copula.
|
pure virtual |
Computes the inverse copula function in correspondence of the supplied probability.
Prob | The probability for which the corresponding quantile must be found |
This is a pure virtual function. Refer to child documentation for specific implementation details
Implemented in Multivariate::GaussianCopula, Multivariate::tCopula, and Multivariate::IndependenceCopula.
double * AbstarctCopula::GetQuantileArray | ( | double | Prob | ) |
Computes the inverse copula function in correspondence of the supplied probability.
This is equivalent to GetQuantile() but returns an array intead of an Eigen::VectorXd. If it can't be calculated, NULL is returned
std::vector< double > AbstarctCopula::GetQuantileVector | ( | double | Prob | ) | const |
Computes the inverse copula function in correspondence of the supplied probability.
This is equivalent to GetQuantile() but returns an std::vector intead of an Eigen::VectorXd
|
inline |
Check if the copula is valid.
If this function returns false the structure of the copula is meaningless and no result will be produced until the invalid parameters are cured.
|
inline |
Set the dimensionality of the copula.
Dimension | the new dimensionality of the copula |
This function will try to change the dimensionality of the copula (e.g. 2 for bivariate, 3 for trivariate, etc.)
If the argument passed is less than 2 the dimensionality will not be changed and the function will return false
|
inline |
Set the random number generator seed.
NewSeed | the new random seed |