Multivariate Analysis Package  0.3
A multivariate distributions analysis package
 All Classes Namespaces Functions Pages
tDist.h
1 #ifndef tDist_h__
2 #define tDist_h__
3 #include "NormalDist.h"
4 namespace Multivariate{
6 
42  private:
43  unsigned int DegreesOfFreedom;
44  tDistribution(const tDistribution& a);
45  tDistribution& operator=(const tDistribution& a);
46  Eigen::VectorXd LocatVect;
47  Eigen::MatrixXd ScaleMatrix;
48  bool CheckValidity();
49  double ProbToFind;
50  boost::math::tuple<double, double> operator()(double x);
51  bool UseGenz;
52  unsigned int NumSimul;
53  std::pair<double,double> ComputeThat(unsigned int N)const;
54  public:
56 
74  tDistribution(unsigned int Dimension,unsigned int DegFreedom,const Eigen::VectorXd& locVect,const Eigen::MatrixXd& ScaleMatr);
76 
85  tDistribution(unsigned int Dimension=1U,unsigned int DegFreedom=1U);
87 
97  bool SetLocationVector(const Eigen::VectorXd& mVect){if(mVect.rows()!=Dim) return false; LocatVect=mVect; CheckValidity(); return true;}
99 
103  bool SetLocationVector(const std::vector<double>& mVect);
105 
116  bool SetDimension(unsigned int Dimension);
118 
133  bool SetScaleMatrix(const Eigen::MatrixXd& SclMatr);
135 
153  bool SetScaleMatrix(const std::vector<double>& mVect, bool RowWise=true);
155 
164  bool SetDegreesOfFreedom(unsigned int a);
166 
170  const Eigen::VectorXd& GetLocationVector() const {return LocatVect;}
172 
176  const Eigen::MatrixXd& GetScaleMatrix() const {return ScaleMatrix;}
178 
182  unsigned int GetDegreesOfFreedom() const {return DegreesOfFreedom;}
184 
191  Eigen::MatrixXd ExtractSamples(unsigned int NumSamples) const;
193 
202  Eigen::MatrixXd ExtractSamplesCDF(unsigned int NumSamples) const;
204 
211  double GetDensity(const Eigen::VectorXd& Coordinates)const;
213 
220  double GetCumulativeDesity(const Eigen::VectorXd& Coordinates)const;
222 
238  Eigen::MatrixXd GetVarMatrix() const;
240 
251  Eigen::VectorXd GetQuantile(double Prob)const;
252 
255  template <class F, class T> friend T boost::math::tools::newton_raphson_iterate(F f, T guess, T min, T max, int digits);
256  template <class F, class T> friend T boost::math::tools::newton_raphson_iterate(F f, T guess, T min, T max, int digits, boost::uintmax_t& max_iter);
257  template <class F, class T> friend void boost::math::tools::detail::handle_zero_derivative(F f,T& last_f0,const T& f0,T& delta,T& result,T& guess,const T& min,const T& max);
258  };
259 }
260 #endif // tDist_h__
const Eigen::MatrixXd & GetScaleMatrix() const
Get the scale matrix of the distribution.
Definition: tDist.h:176
bool SetDegreesOfFreedom(unsigned int a)
Set the degrees of freedom of the distribution.
Definition: tDist.cpp:128
bool SetLocationVector(const Eigen::VectorXd &mVect)
Set the expected values vector.
Definition: tDist.h:97
unsigned int GetDegreesOfFreedom() const
Get the degrees of freedom of the distribution.
Definition: tDist.h:182
Distributions base class.
Definition: AbstractDistribution.h:28
Eigen::MatrixXd GetVarMatrix() const
Computes the variance matrix of the distribution.
Definition: tDist.cpp:147
const Eigen::VectorXd & GetLocationVector() const
Get the location vector of the distribution.
Definition: tDist.h:170
Eigen::MatrixXd ExtractSamplesCDF(unsigned int NumSamples) const
Extracts samples from the distribution and returns their marginal CDF.
Definition: tDist.cpp:136
bool SetScaleMatrix(const Eigen::MatrixXd &SclMatr)
Set the scale matrix of the distribution.
Definition: tDist.cpp:208
virtual double GetCumulativeDesity(const Eigen::VectorXd &Coordinates) const =0
Computes the cumulative density function of the distribution in correspondence of the supplied coordi...
virtual double GetDensity(const Eigen::VectorXd &Coordinates) const =0
Computes the probability density function of the distribution in correspondence of the supplied coord...
double GetCumulativeDesity(const Eigen::VectorXd &Coordinates) const
Computes the cumulative density function of the distribution in correspondence of the supplied coordi...
Definition: tDist.cpp:8
Eigen::VectorXd GetQuantile(double Prob) const
Computes the inverse cumulative density function of the distribution in correspondence of the supplie...
Definition: tDist.cpp:236
bool SetDimension(unsigned int Dimension)
Set the dimensionality of the distribution.
Definition: tDist.cpp:195
double GetDensity(const Eigen::VectorXd &Coordinates) const
Computes the probability density function of the distribution in correspondence of the supplied coord...
Definition: tDist.cpp:42
Multivariate Student&#39;s t Distribution
Definition: tDist.h:41
Eigen::MatrixXd ExtractSamples(unsigned int NumSamples) const
Generates multiple simulations from the distribution.
Definition: tDist.cpp:26