Categories &

Functions List

Function Reference: invgpdf

statistics: y = invgpdf (x, mu, lambda)

Inverse Gaussian probability density function (PDF).

For each element of x, compute the probability density function (PDF) of the inverse Gaussian distribution with scale parameter mu and shape parameter lambda. The size of y is the common size of x, mu, and lambda. A scalar input functions as a constant matrix of the same size as the other inputs.

The inverse Gaussian CDF is only defined for mu > 0 and lambda > 0.

Further information about the inverse Gaussian distribution can be found at https://en.wikipedia.org/wiki/Inverse_Gaussian_distribution

Input arguments must be double or single; integer, logical, and character arrays are rejected. MATLAB accepts a character array and evaluates it at the character codes, which Octave deliberately does not, since a character array is an integer type and integers are refused too.

See also: invgcdf, invginv, invgrnd, invgfit, invglike, invgstat

Source Code: invgpdf

Plot various PDFs from the inverse Gaussian distribution

 x = 0:0.001:3;
 y1 = invgpdf (x, 1, 0.2);
 y2 = invgpdf (x, 1, 1);
 y3 = invgpdf (x, 1, 3);
 y4 = invgpdf (x, 3, 0.2);
 y5 = invgpdf (x, 3, 1);
 plot (x, y1, '-b', x, y2, '-g', x, y3, '-r', x, y4, '-c', x, y5, '-y')
 grid on
 xlim ([0, 3])
 ylim ([0, 3])
 legend ({'μ = 1, σ = 0.2', 'μ = 1, σ = 1', 'μ = 1, σ = 3', ...
          'μ = 3, σ = 0.2', 'μ = 3, σ = 1'}, 'location', 'northeast')
 title ('Inverse Gaussian PDF')
 xlabel ('values in x')
 ylabel ('density')
plotted figure