|
| | LognormalDistribution () |
| | Default constructor. Creates Lognormal(0, 1) distribution.
|
| |
| | LognormalDistribution (RealType m, RealType s=RealType(1)) |
| | Constructs a lognormal distribution with specified parameters.
|
| |
| | LognormalDistribution (const param_type ¶m) |
| | Constructs from a parameter set.
|
| |
| void | reset () |
| | Resets the distribution state.
|
| |
| RealType | m () const |
| | Gets the mean parameter of underlying normal distribution.
|
| |
| RealType | s () const |
| | Gets the standard deviation parameter of underlying normal distribution.
|
| |
| 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 minimum value that can be generated (approaches 0).
|
| |
| 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 &p) |
| | Generates the next random value using provided parameters.
|
| |
template<typename RealType = double>
class Infinity::Engine::LognormalDistribution< RealType >
Platform-independent lognormal distribution.
Produces values according to a lognormal distribution, where the logarithm of the values follows a normal distribution. Useful for modeling multiplicative processes and values that are naturally positive and right-skewed.
If X ~ Lognormal(m, s), then log(X) ~ Normal(m, s). This makes the lognormal distribution ideal for modeling quantities that result from multiplicative random effects, such as particle sizes, income distributions, species abundance, or compound growth processes.
- Template Parameters
-
| RealType | Floating point type (float or double) |
Example usage:
for (int i = 0; i < 100; ++i) {
float size = sizes(rng);
}
double multiplier = growth_factor(rng);
Platform-independent lognormal distribution.
Definition PRNGDistribution.hpp:744
Pseudo-random number generator for procedural generation.
Definition PRNG.hpp:48
- Note
- All generated values are strictly positive (> 0).
-
The distribution is right-skewed with a long tail toward larger values.
-
For Lognormal(m, s): median = exp(m), mode = exp(m - s²)