STK++ 0.9.13
STK::Law Namespace Reference

This is the namespace enclosing the classes handling the usual probabilities Laws. More...

Classes

class  Bernoulli
 Bernoulli probability law. More...
 
class  Beta
 Beta distribution law. More...
 
class  Binomial
 Binomial probability law. More...
 
class  Categorical
 Categorical probability law. More...
 
class  Cauchy
 Cauchy distribution law. More...
 
struct  CdfcOp
 , More...
 
struct  CdfOp
 , More...
 
class  ChiSquared
 ChiSquared distribution law. More...
 
class  Empirical
 Empirical distribution law. More...
 
class  Exponential
 Exponential distribution law. More...
 
class  FisherSnedecor
 FisherSnedecor distribution law. More...
 
class  Gamma
 Gamma distribution law. More...
 
class  Geometric
 Geometric probability law. More...
 
class  HyperGeometric
 HyperGeometric probability law. More...
 
struct  IcdfOp
 , More...
 
class  ILawBase
 Interface base class for all the (univariate/multivariate) probabilities laws. More...
 
class  IUnivLaw
 Interface base class for all the univariate distributions. More...
 
struct  LogCdfcOp
 , More...
 
struct  LogCdfOp
 , More...
 
class  Logistic
 Logistic distribution law. More...
 
class  LogNormal
 LogNormal distribution law. More...
 
struct  LogPdfOp
 , More...
 
class  NegativeBinomial
 NegativeBinomial probability law. More...
 
class  Normal
 Normal distribution law. More...
 
struct  PdfOp
 , More...
 
class  Poisson
 Poisson distribution law. More...
 
class  Student
 Student distribution law. More...
 
class  Uniform
 class for the Uniform law distribution. More...
 
class  UniformDiscrete
 class for the Uniform law distribution. More...
 
class  Weibull
 Weibull distribution law. More...
 

Typedefs

typedef Normal Gaussian
 A synonymous for the normal law.
 

Enumerations

enum  UnivariateDistribution {
  bernoulli_ , beta_ , binomial_ , categorical_ ,
  cauchy_ , chisquared_ , exponential_ , fisher_snedecor_ ,
  gamma_ , geometric_ , hypergeometric_ , logistic_ ,
  lognormal_ , negative_binomial_ , normal_ , poisson_ ,
  student_ , uniform_ , uniform_discrete_ , weibull_ ,
  unknown_univ_distribution_
}
 list of the univariate distribution laws More...
 

Functions

UnivariateDistribution stringToUnivariateDistribution (std::string const &dist)
 Convert a String to a UnivariateDistribution.
 
std::string univariateDistributionToString (UnivariateDistribution const &type)
 convert a UnivariateDistribution to a String.
 

Detailed Description

This is the namespace enclosing the classes handling the usual probabilities Laws.

Typedef Documentation

◆ Gaussian

A synonymous for the normal law.

Definition at line 47 of file STK_Law_Normal.h.

Enumeration Type Documentation

◆ UnivariateDistribution

list of the univariate distribution laws

Enumerator
bernoulli_ 
beta_ 
binomial_ 
categorical_ 
cauchy_ 
chisquared_ 
exponential_ 
fisher_snedecor_ 
gamma_ 
geometric_ 
hypergeometric_ 
logistic_ 
lognormal_ 
negative_binomial_ 
normal_ 
poisson_ 
student_ 
uniform_ 
uniform_discrete_ 
weibull_ 
unknown_univ_distribution_ 

Definition at line 54 of file STK_Law_Util.h.

55{
57 beta_,
60 cauchy_,
62 exponential_,
64 gamma_,
70 normal_,
77};
@ uniform_discrete_
@ negative_binomial_
@ unknown_univ_distribution_
@ fisher_snedecor_
@ hypergeometric_

Function Documentation

◆ stringToUnivariateDistribution()

UnivariateDistribution STK::Law::stringToUnivariateDistribution ( std::string const dist)
inline

Convert a String to a UnivariateDistribution.

The recognized strings are

Distribution
"beta"
"binomial"
"categorical"
"cauchy"
"chi squared"
"exponential"
"fisher snedecor"
"gamma"
"geometric"
"hypergeometric"
"logistic"
"lognormal"
"negative binomial"
"normal"
"poisson"
"student"
"uniform"
"uniform discrete"
"weibull"
Parameters
distthe String we want to convert
Returns
the Mixture represented by the String type. if the string does not match any known name, the unknown_mixture_ type is returned.

Definition at line 108 of file STK_Law_Util.h.

109{
110 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("beta"))) return beta_;
111 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("binomial"))) return binomial_;
112 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("categorical"))) return categorical_;
113 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("cauchy"))) return cauchy_;
114 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("chisquared"))) return chisquared_;
115 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("exponential"))) return exponential_;
116 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("fishersnedecor"))) return fisher_snedecor_;
117 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("gamma"))) return gamma_;
118 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("geometric"))) return geometric_;
119 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("hypergeometric"))) return hypergeometric_;
120 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("logistic"))) return logistic_;
121 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("lognormal"))) return lognormal_;
122 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("negativebinomial"))) return negative_binomial_;
123 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("normal"))) return normal_;
124 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("poisson"))) return poisson_;
125 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("student"))) return student_;
126 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("uniform"))) return uniform_;
127 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("uniformdiscrete"))) return uniform_discrete_;
128 if (toUpperString(removeWhiteSpaces(dist)) == toUpperString(_T("weibull"))) return weibull_;
129#ifdef STK_STATISTIK_DEBUG
130 stk_cout << _T("In stringToUnivariateDistribution, dist ") << dist << _T(" not found.\n");
131#endif
133}
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
Real dist(ExprBase< Container1D1 > const &x, ExprBase< Container1D2 > const &y)
Compute the distance between two vectors.
String const & toUpperString(String &s)
convert the characters of the String to upper case
Definition STK_String.h:134
String removeWhiteSpaces(String const &s)
convert the characters of the String to upper case
Definition STK_String.h:165

References _T, beta_, binomial_, categorical_, cauchy_, chisquared_, STK::dist(), exponential_, fisher_snedecor_, gamma_, geometric_, hypergeometric_, logistic_, lognormal_, negative_binomial_, normal_, poisson_, STK::removeWhiteSpaces(), stk_cout, student_, STK::toUpperString(), uniform_, uniform_discrete_, unknown_univ_distribution_, and weibull_.

◆ univariateDistributionToString()

std::string STK::Law::univariateDistributionToString ( UnivariateDistribution const type)
inline

convert a UnivariateDistribution to a String.

Parameters
typethe type of UnivariateDistribution we want to convert
Returns
the string associated to this type.
See also
stringToUnivariateDistribution

Definition at line 141 of file STK_Law_Util.h.

142{
143 if (type == beta_) return String(_T("beta"));
144 if (type == binomial_) return String(_T("binomial"));
145 if (type == categorical_) return String(_T("categorical"));
146 if (type == chisquared_) return String(_T("chi squared"));
147 if (type == cauchy_) return String(_T("cauchy"));
148 if (type == exponential_) return String(_T("exponential"));
149 if (type == fisher_snedecor_) return String(_T("fisher snedecor"));
150 if (type == gamma_) return String(_T("gamma"));
151 if (type == geometric_) return String(_T("geometric"));
152 if (type == hypergeometric_) return String(_T("hypergeometric"));
153 if (type == logistic_) return String(_T("logistic"));
154 if (type == lognormal_) return String(_T("lognormal"));
155 if (type == negative_binomial_) return String(_T("negative binomial"));
156 if (type == normal_) return String(_T("normal"));
157 if (type == poisson_) return String(_T("poisson"));
158 if (type == student_) return String(_T("student"));
159 if (type == uniform_) return String(_T("uniform"));
160 if (type == uniform_discrete_) return String(_T("uniform discrete"));
161 if (type == weibull_) return String(_T("weibull"));
162 return String(_T("unknown"));
163}
std::basic_string< Char > String
STK fundamental type of a String.

References _T, beta_, binomial_, categorical_, cauchy_, chisquared_, exponential_, fisher_snedecor_, gamma_, geometric_, hypergeometric_, logistic_, lognormal_, negative_binomial_, normal_, poisson_, student_, uniform_, uniform_discrete_, and weibull_.