function walker_verify_test ( )

%*****************************************************************************80
%
%% WALKER_VERIFY_TEST tests WALKER_VERIFY.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    21 February 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'WALKER_VERIFY_TEST\n' );
  fprintf ( 1, '  WALKER_VERIFY verifies the Walker sampler data\n' );
  fprintf ( 1, '  vectors Y and A,for a given probability vector X.\n' );

  n = 9;
  x = zeros ( n + 2, 1 );

  for i = 1 : n
    x(i+1) = log ( 1.0 + 1.0 / i ) / log ( n + 1 );
  end

  r8vec_print ( n + 2, x, '  Benford PDF (ignore first and last entries):' );

  [ y, a ] = walker_build ( n, x );

  fprintf ( 1, '\n' );
  fprintf ( 1, '   I    A(I)    Y(i) (ignore first and last entries)\n' );
  fprintf ( 1, '\n' );
  for i = 0 : n + 1
    fprintf ( 1, '  %2d  %2d  %14.6g\n', i, a(i+1), y(i+1) );
  end

  v = walker_verify ( n, x, y, a );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The verification sum = %g\n', v );
  fprintf ( 1, '  It should be very close to zero.\n' );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'WALKER_VERIFY_TEST\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

