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 GNU LGPL 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 version\n' );
  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
