function histogram_data_2d_sample_test ( )

%*****************************************************************************80
%
%% histogram_data_2d_sample_test() tests histogram_data_2d_sample().
%
%  Discussion:
%
%    This program is an example of how discrete sample or density data
%    can be used to define a PDF (probability density function). 
%
%    In this function and the functions it calls, we assume that we have
%    data for an array of 20 by 20 square subcells of the unit square.
%    We wish to derive a PDF that will allow us to sample an arbitrary
%    number of points from this region.
%
%    In particular, we intend to use the discrete data to generate a PDF
%    which we will then use to generate sample points.
%
%    Roughly speaking, we have kept track of how many fish we caught in
%    each part of a lake, and now we want to simulate catching N fish
%    under the same conditions.
%
%    The statistics for each simulation should be governed by the discrete
%    PDF, but with random variation.  In other words, the actual number
%    of points taken from each subregion is random, and the actual location of
%    each point in a subregion is random, but over many simulations, the
%    statistics of the sample points should reproduce the statistics of
%    the original discrete sample that defined the PDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 January 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../histogram_data_2d_sample' )

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'histogram_data_2d_sample_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test histogram_data_2d_sample().\n' );

  n = 1000;
  histogram_data_2d_sample_test01 ( n );

  n = 1000;
  histogram_data_2d_sample_test02 ( n );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'histogram_data_2d_sample_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../histogram_data_2d_sample' )

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

