lognormal_cdf
Evaluates the lognormal cumulative distribution function (CDF).
Synopsis
#include<imsls.h>
floatimsls_f_lognormal_cdf(float x, float amu, float sigma)
The type double function is imsls_d_lognormal_cdf.
Required Arguments
floatx (Input)
Argument for which the lognormal CDF is to be evaluated. x must be non-negative.
floatamu (Input)
Location parameter of the lognormal CDF.
floatsigma (Input)
Shape parameter of the lognormal CDF. sigma must be positive.
Return Value
The probability that a lognormal random variable takes a value less than or equal to x. A value of NaN is returned if an input value is in error.
Description
The function imsls_f_lognormal_cdf evaluates the lognormal cumulative distribution function (CDF), defined as
where
is the standard normal CDF.
Example
In this example, we evaluate the CDF at x = 0.7137, amu = 0.0,
sigma = 0.5.
#include <imsls.h>
#include <stdio.h>
int main()
{
float x = 0.7137;
float amu = 0.0;
float sigma = 0.5;
float p;
p = imsls_f_lognormal_cdf(x,amu,sigma);
printf("The probability that lognormal random ");
printf("variable X\n");
printf("with location parameter amu = %3.1f ", amu);
printf("and shape parameter\nsigma = %3.1f ", sigma);
printf("is less than or equal to ");
printf("%6.4f is %6.4f\n\n", x, p);
}
Output
The probability that lognormal random varisable X
with location parameter amu = 0.0 and shape parameter
sigma = 0.5 is less than or equal to 0.7137 is 0.2500