lognormal_pdf

Evaluates the lognormal probability density function (PDF).

Synopsis

#include<imsls.h>

floatimsls_f_lognormal_pdf(float x, float amu, float sigma)

The type double function is imsls_d_lognormal_pdf.

Required Arguments

floatx (Input)
Argument for which the lognormal PDF is to be evaluated. x must be non-negative.

floatamu (Input)
Location parameter of the lognormal PDF.

floatsigma (Input)
Shape parameter of the lognormal PDF.  sigma must be positive.

Return Value

The probability density of a lognormally distributed random variable with value x, location parameter amu, and shape parameter sigma. A value of NaN is returned if an input value is in error.

Description

The function imsls_f_lognormal_pdf evaluates the lognormal probability density function (PDF), defined as

 

Example

In this example, we evaluate the PDF at x = 1.0, amu = 0.0, sigma = 0.5.

 

#include <imsls.h>

#include <stdio.h>

 

int main()

{

float x = 1.0;

float amu = 0.0;

float sigma = 0.5;

float pdfv;

 

pdfv = imsls_f_lognormal_pdf(x, amu, sigma);

printf("The probability density of lognormal random ");

printf("variable X\n");

printf("with location parameter amu = %3.1f, ", amu);

printf("shape parameter\nsigma = %3.1f, ", sigma);

printf("and value x = %3.1f is %6.4f\n\n", x, pdfv);

}

Output

The probability density of lognormal random variable X

with location parameter amu = 0.0, shape parameter

sigma = 0.5, and value x = 1.0 is 0.7979