|
Infinity Engine v0.6.20
C++ API Documentation
|
Platform-independent Student's t-distribution. More...
#include <PRNGDistribution.hpp>
Classes | |
| struct | param_type |
| Parameter set for the distribution. More... | |
Public Types | |
| using | result_type = RealType |
| The type of values produced by the distribution. | |
Public Member Functions | |
| StudentTDistribution () | |
| Default constructor. Creates t(1) distribution (Cauchy). | |
| StudentTDistribution (RealType n) | |
| Constructs a t-distribution with specified degrees of freedom. | |
| StudentTDistribution (const param_type ¶m) | |
| Constructs from a parameter set. | |
| void | reset () |
| Resets the distribution state. | |
| RealType | n () const |
| Gets the degrees of freedom. | |
| param_type | param () const |
| Gets the current parameter set. | |
| void | param (const param_type ¶m) |
| Sets new parameters for the distribution. | |
| result_type | min () const |
| Gets the theoretical minimum value (negative infinity). | |
| result_type | max () const |
| Gets the theoretical maximum value (positive infinity). | |
| template<typename Generator > | |
| result_type | operator() (Generator &g) |
| Generates the next random value using stored parameters. | |
| template<typename Generator > | |
| result_type | operator() (Generator &g, const param_type ¶m) |
| Generates the next random value using provided parameters. | |
Friends | |
| bool | operator== (const StudentTDistribution &lhs, const StudentTDistribution &rhs) |
| bool | operator!= (const StudentTDistribution &lhs, const StudentTDistribution &rhs) |
Platform-independent Student's t-distribution.
Produces values according to Student's t-distribution with n degrees of freedom. Similar to the normal distribution but with heavier tails, approaching normal as n increases. Essential for statistical inference with small sample sizes.
The t-distribution arises when estimating the mean of a normally distributed population with unknown variance from small samples. It's widely used in confidence intervals and hypothesis tests when the sample size is small.
| RealType | Floating point type (float or double) |
Example usage:
| using Infinity::Engine::StudentTDistribution< RealType >::result_type = RealType |
The type of values produced by the distribution.
|
inline |
Default constructor. Creates t(1) distribution (Cauchy).
|
inlineexplicit |
Constructs a t-distribution with specified degrees of freedom.
| n | Degrees of freedom |
|
inlineexplicit |
Constructs from a parameter set.
| param | The distribution parameters |
|
inline |
Gets the theoretical maximum value (positive infinity).
|
inline |
Gets the theoretical minimum value (negative infinity).
|
inline |
Gets the degrees of freedom.
|
inline |
Generates the next random value using stored parameters.
Uses the relationship: If Z ~ N(0,1) and V ~ ChiSquared(n), then T = Z / sqrt(V/n) ~ t(n)
| Generator | The random number generator type (e.g., PRNG) |
| g | The random number generator |
|
inline |
Generates the next random value using provided parameters.
| Generator | The random number generator type (e.g., PRNG) |
| g | The random number generator |
| param | The distribution parameters to use for this generation |
|
inline |
Gets the current parameter set.
|
inline |
Sets new parameters for the distribution.
Recreates the underlying gamma distribution with the new degrees of freedom.
| param | The new distribution parameters |
|
inline |
Resets the distribution state.
Resets both the normal and gamma distributions.
|
friend |
|
friend |