- Function Uniform(Minimum, Maximum)
Uniform
The function Uniform
draws a random value from a uniform
distribution.
Uniform(
Minimum, ! (optional) numerical expression
Maximum ! (optional) numerical expression
)
Arguments
- Minimum
A scalar numerical expression.
- Maximum
A scalar numerical expression.
Return Value
The function
Uniform
returns a random value drawn from a uniform distribution with lower bound Minimum and upper bound Maximum.
Note
The arguments must satisfy the relation \(Minimum < Maximum\).
Graph
A graph with:
a histogram for 100 experiments of drawing from distribution
Uniform(0,25)
, andthe
DistributionDensity
forUniform(0,25)
Example
The code:
option seed := 1234 ;
_p_draw := Uniform( 0, 100 ) ;
_p_pointDensity := DistributionDensity( Uniform( 0, 100 ), 45 );
block where listing_number_precision := 6 ;
display _p_draw, _p_pointDensity ;
endblock ;
will produce
_p_draw := 69.551654 ;
_p_pointDensity := 0.010000 ;
in the listing file.
References
The
Uniform
distribution is discussed in full detail in Continuous Distributions of the Language Reference.