- Function LogNormal(Shape, Lowerbound, Scale)
LogNormal
The function LogNormal
draws a random value from a lognormal
distribution.
LogNormal(
Shape, ! (input) numerical expression
Lowerbound, ! (optional) numerical expression
Scale ! (optional) numerical expression
)
Arguments
- Shape
A scalar numerical expression \(> 0\).
- Lowerbound
A scalar numerical expression.
- Scale
A scalar numerical expression \(> 0\).
Return Value
The function
LogNormal
returns a random value drawn from a lognormal distribution with shape Shape, lower bound Lowerbound and scale Scale.
Note
The prototype of this function has changed with the introduction of
AIMMS 3.4. In order to run models that still use the original prototype,
the option Distribution_compatibility
should be set to
Aimms_3_0
. The original function LogNormal
(m, sd) returns
a random value drawn from a lognormal distribution with mean \(m>0\)
and standard deviation \(sd>0\). The same result should now be
obtained by setting \(Shape = sd/m\), \(Lowerbound=0\) and
\(Scale = m\).
Graph
A graph with:
a histogram for 1.000.000 experiments of drawing from distribution
LogNormal(4,0,100)
, andthe
DistributionDensity
forLogNormal(4,0,100)
Example
The code:
option seed := 1234 ;
_p_draw := LogNormal( 4, 0, 1 ) ;
_p_pointDensity := DistributionDensity( LogNormal( 4, 0, 1 ), 3 );
block where listing_number_precision := 6 ;
display _p_draw, _p_pointDensity ;
endblock ;
will produce
_p_draw := 0.042849 ;
_p_pointDensity := 0.025869 ;
in the listing file.
References
The
LogNormal
distribution is discussed in full detail in Continuous Distributions of the Language Reference.