STK++ 0.9.13

Student distribution law. More...

#include <STK_Law_Student.h>

Inheritance diagram for STK::Law::Student:
Inheritance graph

Public Types

typedef IUnivLaw< RealBase
 

Public Member Functions

 Student (int df=1.)
 Default constructor.
 
virtual ~Student ()
 destructor
 
int df () const
 
void setDf (int df)
 
virtual Real rand () const
 
virtual Real pdf (Real const &x) const
 
virtual Real lpdf (Real const &x) const
 
virtual Real cdf (Real const &t) const
 
virtual Real icdf (Real const &p) const
 
- Public Member Functions inherited from STK::Law::IUnivLaw< Real >
virtual ~IUnivLaw ()
 Virtual destructor.
 
virtual Real lcdf (Real const &t) const
 compute the lower tail log-cumulative distribution function Give the log-probability that a random variate is less or equal to t.
 
virtual Real cdfc (Real const &t) const
 calculate the complement of cumulative distribution function, called in statistics the survival function.
 
virtual Real lcdfc (Real const &t) const
 calculate the log-complement of cumulative distribution function Give the log-probability that a random variate is greater than t.
 
- Public Member Functions inherited from STK::Law::ILawBase
String constname () const
 

Static Public Member Functions

static Real rand (int df)
 
static Real pdf (Real const &x, int df)
 
static Real lpdf (Real const &x, int df)
 
static Real cdf (Real const &t, int df)
 
static Real icdf (Real const &p, int df)
 

Protected Attributes

int df_
 degree of freedom
 
- Protected Attributes inherited from STK::Law::ILawBase
String name_
 Name of the Law.
 

Additional Inherited Members

- Protected Member Functions inherited from STK::Law::IUnivLaw< Real >
 IUnivLaw (String const &name)
 Constructor.
 
 IUnivLaw (IUnivLaw const &law)
 copy Constructor.
 
- Protected Member Functions inherited from STK::Law::ILawBase
 ILawBase (String const &name)
 Constructor.
 
 ~ILawBase ()
 destructor.
 

Detailed Description

Student distribution law.

In probability and statistics, Student's t-distribution (or simply the t-distribution) is any member of a family of continuous probability distributions that arises when estimating the mean of a normally distributed population in situations where the sample size is small and population standard deviation is unknown. Whereas a normal distribution describes a full population, t-distributions describe samples drawn from a full population; accordingly, the t-distribution for each sample size is different, and the larger the sample, the more the distribution resembles a normal distribution.

The t-distribution plays a role in a number of widely used statistical analyses, including the Student's t-test for assessing the statistical significance of the difference between two sample means, the construction of confidence intervals for the difference between two population means, and in linear regression analysis. The Student's t-distribution also arises in the Bayesian analysis of data from a normal family

Student's t-distribution has the probability density function given by

\[
f(t) = \frac{\Gamma(\frac{\nu+1}{2})}{\sqrt{\nu\pi}\,\Gamma(\frac{\nu}{2})}
\left(1+\frac{t^2}{\nu} \right)^{-\frac{\nu+1}{2}},\!
\]

where $ \nu $ is the number of degrees of freedom.

Definition at line 72 of file STK_Law_Student.h.

Member Typedef Documentation

◆ Base

Constructor & Destructor Documentation

◆ Student()

STK::Law::Student::Student ( int  df = 1.)
inline

Default constructor.

Parameters
dfdegree of freedom parameter

Definition at line 79 of file STK_Law_Student.h.

79: Base(_T("Student")), df_(df) {}
#define _T(x)
Let x unmodified.
IUnivLaw< Real > Base
int df_
degree of freedom

◆ ~Student()

virtual STK::Law::Student::~Student ( )
inlinevirtual

destructor

Definition at line 81 of file STK_Law_Student.h.

81{}

Member Function Documentation

◆ cdf() [1/2]

Real STK::Law::Student::cdf ( Real const t) const
virtual
Returns
the cumulative distribution function
Parameters
ta positive real value

Implements STK::Law::IUnivLaw< Real >.

Definition at line 69 of file STK_Law_Student.cpp.

70{
71 return 0;
72}

◆ cdf() [2/2]

Real STK::Law::Student::cdf ( Real const t,
int  df 
)
static
Returns
the cumulative distribution function
Parameters
ta positive real value
dfdegree of freedom parameter

Definition at line 108 of file STK_Law_Student.cpp.

109{
110 return 0;
111}

◆ df()

int STK::Law::Student::df ( ) const
inline
Returns
the number of degree of freedom

Definition at line 83 of file STK_Law_Student.h.

83{ return df_;}

References df_.

Referenced by setDf().

◆ icdf() [1/2]

Real STK::Law::Student::icdf ( Real const p) const
virtual
Returns
the inverse cumulative distribution function
Parameters
pa probability number

Implements STK::Law::IUnivLaw< Real >.

Definition at line 76 of file STK_Law_Student.cpp.

77{
78 return 0;
79}

◆ icdf() [2/2]

Real STK::Law::Student::icdf ( Real const p,
int  df 
)
static
Returns
the inverse cumulative distribution function
Parameters
pa probability number
dfdegree of freedom parameter

Definition at line 116 of file STK_Law_Student.cpp.

117{
118 return 0;
119}

◆ lpdf() [1/2]

Real STK::Law::Student::lpdf ( Real const x) const
virtual
Returns
the value of the log-pdf
Parameters
xa positive real value

Reimplemented from STK::Law::IUnivLaw< Real >.

Definition at line 62 of file STK_Law_Student.cpp.

63{
64 return 0;
65}

◆ lpdf() [2/2]

Real STK::Law::Student::lpdf ( Real const x,
int  df 
)
static
Returns
the value of the log-pdf
Parameters
xa positive real value
dfdegree of freedom parameter

Definition at line 100 of file STK_Law_Student.cpp.

101{
102 return 0;
103}

◆ pdf() [1/2]

Real STK::Law::Student::pdf ( Real const x) const
virtual
Returns
the value of the pdf
Parameters
xa positive real value

Implements STK::Law::IUnivLaw< Real >.

Definition at line 55 of file STK_Law_Student.cpp.

56{
57 return 0;
58}

◆ pdf() [2/2]

Real STK::Law::Student::pdf ( Real const x,
int  df 
)
static
Returns
the value of the pdf
Parameters
xa positive real value
dfdegree of freedom parameter

Definition at line 92 of file STK_Law_Student.cpp.

93{
94 return 0;
95}

◆ rand() [1/2]

Real STK::Law::Student::rand ( ) const
virtual
Returns
a pseudo Student random variate.

Implements STK::Law::IUnivLaw< Real >.

Definition at line 48 of file STK_Law_Student.cpp.

49{
50 return 0;
51}

◆ rand() [2/2]

Real STK::Law::Student::rand ( int  df)
static
Returns
a pseudo Student random variate with the specified parameters.
Parameters
dfdegree of freedom parameter

Definition at line 84 of file STK_Law_Student.cpp.

85{
86 return 0;
87}

◆ setDf()

void STK::Law::Student::setDf ( int  df)
inline
Parameters
dfdegree of freedom parameter

Definition at line 85 of file STK_Law_Student.h.

86 {
87 if (df<=0) STKDOMAIN_ERROR_1ARG(Student::setShape,df,shape must be > 0);
88 df_ = df;
89 }
#define STKDOMAIN_ERROR_1ARG(Where, Arg, Error)
Definition STK_Macros.h:165

References df(), df_, and STKDOMAIN_ERROR_1ARG.

Member Data Documentation

◆ df_

int STK::Law::Student::df_
protected

degree of freedom

Definition at line 145 of file STK_Law_Student.h.

Referenced by df(), and setDf().


The documentation for this class was generated from the following files: