function inverse_gaussian_cdf_test ( ) %*****************************************************************************80 % %% INVERSE_GAUSSIAN_CDF_TEST tests INVERSE_GAUSSIAN_CDF. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 07 April 2016 % % Author: % % John Burkardt % fprintf ( 1, '\n' ); fprintf ( 1, 'INVERSE_GAUSSIAN_CDF_TEST\n' ); fprintf ( 1, ' INVERSE_GAUSSIAN_CDF evaluates the Inverse Gaussian CDF.\n' ); fprintf ( 1, ' INVERSE_GAUSSIAN_PDF evaluates the Inverse Gaussian PDF.\n' ); a = 5.0; b = 2.0; if ( ~ inverse_gaussian_check ( a, b ) ) fprintf ( 1, '\n' ); fprintf ( 1, 'INVERSE_GAUSSIAN_CDF_TEST - Fatal error!\n' ); fprintf ( 1, ' The parameters are not legal.\n' ); return end fprintf ( 1, '\n' ); fprintf ( 1, ' PDF parameter A = %14g\n', a ); fprintf ( 1, ' PDF parameter B = %14g\n', b ); seed = 123456789; fprintf ( 1, '\n' ); fprintf ( 1, ' X PDF CDF\n' ); fprintf ( 1, '\n' ); for i = 1 : 10 [ x, seed ] = inverse_gaussian_sample ( a, b, seed ); pdf = inverse_gaussian_pdf ( x, a, b ); cdf = inverse_gaussian_cdf ( x, a, b ); fprintf ( 1, ' %14g %14g %14g\n', x, pdf, cdf ); end return end