Student's T-distribution. A cache of the Probability Density Function and cumulative density function is created using the analytical PDF.
More...
#include <statistics.h>
|
| StudentsT (int dof=2, double dt=0.1, double tmax=20) |
| Defualt constructor takes the degrees of freedom (Nu), step size for numerical CDF computation and Maximum T to sum to for numerical CDF. More...
|
|
void | setDOF (double dof) |
| Change the degress of freedom, update cache. More...
|
|
void | setStepT (double dt) |
| Step in t to use for computing the CDF, smaller means more precision although in reality the distribution is quite smooth, and linear interpolation should be very good. More...
|
|
void | setMaxT (double tmax) |
| Set the maximum t for numerical integration, and recompute the cdf/pdf caches. More...
|
|
double | cumulative (double t) const |
| Get the cumulative probability at some t value. More...
|
|
double | cdf (double t) const |
| Get the cumulative probability at some t value. More...
|
|
double | density (double t) const |
| Get the probability density at some t value. More...
|
|
double | pdf (double t) const |
| Get the probability density at some t value. More...
|
|
double | icdf (double t) const |
| Get the T-score that corresponds to a particular p-value. Alias for tthresh. More...
|
|
double | tthresh (double p) const |
| Get the T-score that corresponds to a particular p-value. Alias for icdf. More...
|
|
Student's T-distribution. A cache of the Probability Density Function and cumulative density function is created using the analytical PDF.
Definition at line 244 of file statistics.h.
npl::StudentsT::StudentsT |
( |
int |
dof = 2 , |
|
|
double |
dt = 0.1 , |
|
|
double |
tmax = 20 |
|
) |
| |
Defualt constructor takes the degrees of freedom (Nu), step size for numerical CDF computation and Maximum T to sum to for numerical CDF.
- Parameters
-
dof | Degrees of freedom (shape parameter) |
dt | step size in x or t to take |
tmax | Maximum t to consider |
double npl::StudentsT::cdf |
( |
double |
t | ) |
const |
|
inline |
Get the cumulative probability at some t value.
- Parameters
-
t | T (or x, distance from center) value to query |
- Returns
- Cumulative probability (probability value of value < t)
Definition at line 300 of file statistics.h.
double npl::StudentsT::cumulative |
( |
double |
t | ) |
const |
Get the cumulative probability at some t value.
- Parameters
-
t | T (or x, distance from center) value to query |
- Returns
- Cumulative probability (probability value of value < t)
double npl::StudentsT::density |
( |
double |
t | ) |
const |
Get the probability density at some t value.
- Parameters
-
- Returns
- Probability density at t.
double npl::StudentsT::icdf |
( |
double |
t | ) |
const |
Get the T-score that corresponds to a particular p-value. Alias for tthresh.
- Parameters
-
t | t value to get the inverse CDF (area under the curve) for |
- Returns
- T value that matches p.
double npl::StudentsT::pdf |
( |
double |
t | ) |
const |
|
inline |
Get the probability density at some t value.
- Parameters
-
- Returns
- Probability density at t.
Definition at line 318 of file statistics.h.
void npl::StudentsT::setDOF |
( |
double |
dof | ) |
|
Change the degress of freedom, update cache.
- Parameters
-
dof | Shape parameter, higher values make the distribution more gaussian |
void npl::StudentsT::setMaxT |
( |
double |
tmax | ) |
|
Set the maximum t for numerical integration, and recompute the cdf/pdf caches.
- Parameters
-
tmax | CDF and PDF are stored as arrays, this is the maximum acceptable t value. Its RARE (like 10^-10 rare) to have a value higher than 20. |
void npl::StudentsT::setStepT |
( |
double |
dt | ) |
|
Step in t to use for computing the CDF, smaller means more precision although in reality the distribution is quite smooth, and linear interpolation should be very good.
- Parameters
-
dt | Step size for numerical integration |
double npl::StudentsT::tthresh |
( |
double |
p | ) |
const |
|
inline |
Get the T-score that corresponds to a particular p-value. Alias for icdf.
- Parameters
-
p | probability value is less than this |
- Returns
- T value that matches p.
Definition at line 338 of file statistics.h.
The documentation for this class was generated from the following file: