Multivariate Analysis Package
0.3
A multivariate distributions analysis package
|
Distributions base class. More...
#include <AbstractDistribution.h>
Public Member Functions | |
virtual Eigen::RowVectorXd | ExtractSample () const |
Generates a single simulation from the distribution. More... | |
virtual Eigen::RowVectorXd | ExtractSampleCDF () const |
Generates a single simulation from the distribution and returns its marginal CDF. More... | |
virtual std::vector< double > | ExtractSampleCDFVect () const |
Generates a single simulation from the distribution and returns its marginal CDF. More... | |
virtual Eigen::MatrixXd | ExtractSamples (unsigned int NumSamples) const =0 |
Generates multiple simulations from the distribution. More... | |
virtual Eigen::MatrixXd | ExtractSamplesCDF (unsigned int NumSamples) const =0 |
Extracts samples from the distribution and returns their marginal CDF. More... | |
virtual std::map< unsigned int, std::vector< double > > | ExtractSamplesCDFMap (unsigned int NumSamples) const |
Extracts samples from the distribution and returns their marginal CDF. More... | |
virtual std::map< unsigned int, std::vector< double > > | ExtractSamplesMap (unsigned int NumSamples) const |
Generates multiple simulations from the distribution. More... | |
virtual std::vector< double > | ExtractSampleVector () const |
Generates a single simulation from the distribution. More... | |
virtual double | GetCumulativeDesity (const Eigen::VectorXd &Coordinates) const =0 |
Computes the cumulative density function of the distribution in correspondence of the supplied coordinates. More... | |
virtual double | GetCumulativeDesity (const std::vector< double > &Coordinates) const |
Computes the cumulative density function of the distribution 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 distribution in correspondence of the supplied coordinates. More... | |
virtual double | GetDensity (const std::vector< double > &Coordinates) const |
Computes the probability density function of the distribution in correspondence of the supplied coordinates. More... | |
unsigned int | GetDimension () const |
Get the dimensionality of the distribution. More... | |
virtual Eigen::VectorXd | GetQuantile (double Prob) const =0 |
Computes the inverse cumulative density function of the distribution in correspondence of the supplied probability. More... | |
virtual std::vector< double > | GetQuantileVector (double Prob) const |
Computes the inverse cumulative density function of the distribution in correspondence of the supplied probability. More... | |
bool | IsValid () const |
Check if the distribution is valid. More... | |
virtual bool | SetDimension (unsigned int Dimension)=0 |
Set the dimensionality of the distribution. 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 | |
virtual double * | GetQuantileArray (double Prob) |
Computes the inverse cumulative density function of the distribution in correspondence of the supplied probability. More... | |
virtual double | GetCumulativeDesity (double *Coordinates) const |
Computes the cumulative density function of the distribution in correspondence of the supplied coordinates. More... | |
virtual double | GetDensity (double *Coordinates) const |
Computes the probability density function of the distribution in correspondence of the supplied coordinates. More... | |
virtual double * | ExtractSampleArray () const |
Generates a single simulation from the distribution. More... | |
virtual double ** | ExtractSamplesMatix (unsigned int NumSamples) const |
Generates a single simulation from the distribution. More... | |
virtual double * | ExtractSampleCDFArray () const |
Generates a single simulation from the distribution and returns its marginal CDF. More... | |
virtual double ** | ExtractSamplesCDFMatix (unsigned int NumSamples) const |
Generates a single simulation from the distribution and returns its marginal CDF. More... | |
Distributions base class.
Class that works as an interface to distributions
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);
|
inlinevirtual |
Generates a single simulation from the distribution.
This is equal to calling ExtractSamples(1U)
|
virtual |
Generates a single simulation from the distribution.
This is equivalent to ExtractSample() but returns an array intead of an Eigen::RowVectorXd. If it can't be calculated, NULL is returned
|
inlinevirtual |
Generates a single simulation from the distribution and returns its marginal CDF.
This is equal to calling ExtractSamplesCDF(1U)
|
virtual |
Generates a single simulation from the distribution and returns its marginal CDF.
This is equivalent to ExtractSampleCDF() but returns an array intead of an Eigen::RowVectorXd. If it can't be calculated, NULL is returned
|
virtual |
Generates a single simulation from the distribution and returns its marginal CDF.
This is equivalent to ExtractSampleCDF() but returns an std::vector intead of an Eigen::RowVectorXd
|
pure virtual |
Generates multiple simulations from the distribution.
NumSamples | The number of simulation to run |
This is a pure virtual function. Refer to child documentation for specific implementation details
Implemented in Multivariate::NormalDistribution, Multivariate::tDistribution, and Multivariate::UniformDistribution.
|
pure virtual |
Extracts samples from the distribution and returns their marginal CDF.
NumSamples | The number of simulation to run |
This is a pure virtual function. Refer to child documentation for specific implementation details
Implemented in Multivariate::NormalDistribution, Multivariate::tDistribution, and Multivariate::UniformDistribution.
|
virtual |
Extracts samples from the distribution and returns their marginal CDF.
NumSamples | The number of simulation to run |
This function generates NumSamples simulation from the current distribution, computes the marginal cumulative density function for each of them and returns them in a map form.
This function can be seen as simulation extractions from a copula
If NumSamples is 0 or the distribution is invalid, a null matrix is returned
|
virtual |
Generates a single simulation from the distribution and returns its marginal CDF.
NumSamples | The number of simulation to run |
This is equivalent to ExtractSamplesCDF() but returns a matrix intead of an Eigen::MatrixXd. If it can't be calculated, NULL is returned
|
virtual |
Generates multiple simulations from the distribution.
NumSamples | The number of simulation to run |
This function generates NumSamples simulation from the current distribution and returns them in a map form.
If NumSamples is 0 or the distribution is invalid, an empty map is returned
|
virtual |
Generates a single simulation from the distribution.
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
|
virtual |
Generates a single simulation from the distribution.
This is equivalent to ExtractSample() but returns an std::vector intead of an Eigen::RowVectorXd
|
pure virtual |
Computes the cumulative density function of the distribution 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::NormalDistribution, Multivariate::tDistribution, and Multivariate::UniformDistribution.
|
virtual |
Computes the cumulative density function of the distribution 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
|
virtual |
Computes the cumulative density function of the distribution 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 distribution 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::NormalDistribution, Multivariate::tDistribution, and Multivariate::UniformDistribution.
|
virtual |
Computes the probability density function of the distribution 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
Reimplemented in Multivariate::UniformDistribution.
|
virtual |
Computes the probability density function of the distribution 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 distribution.
|
pure virtual |
Computes the inverse cumulative density function of the distribution 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::NormalDistribution, Multivariate::tDistribution, and Multivariate::UniformDistribution.
|
virtual |
Computes the inverse cumulative density function of the distribution 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
|
virtual |
Computes the inverse cumulative density function of the distribution 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 distribution is valid.
If this function returns false the structure of the distribution is meaningless and no result will be produced until the invalid parameters are cured.
|
pure virtual |
Set the dimensionality of the distribution.
Dimension | the new dimensionality of the distribution |
This is a pure virtual function. Refer to child documentation for specific implementation details
Implemented in Multivariate::NormalDistribution, Multivariate::tDistribution, and Multivariate::UniformDistribution.
void AbstarctDistribution::SetRandomSeed | ( | unsigned int | NewSeed | ) |
Set the random number generator seed.
NewSeed | the new random seed |