function [ n_data, alpha, beta, x, fx ] = inverse_gamma_pdf_values ( n_data )

%*****************************************************************************80
%
%% inverse_gamma_pdf_values() returns values of the inverse gamma PDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    04 August 2015
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N_DATA.  The user sets N_DATA to 0 before the first call.  
%    Thereafter, it should simply be the value returned by the previous call.
%
%  Output:
%
%    integer N_DATA.  On each call, the routine increments N_DATA by 1, and
%    returns the corresponding data; when there is no more data, the
%    output value of N_DATA will be 0 again.
%
%    real ALPHA, BETA, the parameters.
%
%    real X, the argument of the function.
%
%    Output real FX, the value of the function.
%
  n_max = 12;

  alpha_vec = [ ...
    1.00, ...
    1.00, ...
    1.00, ...
    1.00, ...
    1.00, ...
    1.00, ...
    1.00, ...
    1.00, ...
    2.00, ...
    3.00, ...
    4.00, ...
    5.00 ];
  beta_vec = [ ...
    0.50, ...
    0.50, ...
    0.50, ...
    0.50, ...
    2.00, ...
    3.00, ...
    4.00, ...
    5.00, ...
    2.00, ...
    2.00, ...
    2.00, ...
    2.00 ];
  fx_vec = [ ...
    0.3032653298563167, ...
    0.09735009788392561, ...
    0.04702676249392300, ...
    0.02757802820576861, ...
    0.1839397205857212, ...
    0.1673476201113224, ...
    0.1353352832366127, ...
    0.1026062482798735, ...
    0.07606179541223586, ...
    0.02535393180407862, ...
    0.005634207067573026, ...
    0.0009390345112621711 ];
  x_vec = [ ...
    1.00, ...
    2.00, ...
    3.00, ...
    4.00, ...
    2.00, ...
    2.00, ...
    2.00, ...
    2.00, ...
    3.00, ...
    3.00, ...
    3.00, ...
    3.00 ];

  if ( n_data < 0 )
    n_data = 0;
  end

  n_data = n_data + 1;

  if ( n_max < n_data )
    n_data = 0;
    alpha = 0.0;
    beta = 0.0;
    x = 0.0;
    fx = 0.0;
  else
    alpha = alpha_vec(n_data);
    beta = beta_vec(n_data);
    x = x_vec(n_data);
    fx = fx_vec(n_data);
  end

  return
end
