function clayton_test01 ( )

%*****************************************************************************80
%
%% CLAYTON_TEST01 plots a correlation function for several values of RH00.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    22 March 2012
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'CLAYTON_TEST01\n' );
  fprintf ( 1, '  Make plots of correlation functions.\n' );
  fprintf ( 1, '\n' );
%
%  besselj
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_besselj ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Bessel J, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [-2.0, 2.0, -1.0, +1.0] )
  hold off
  print -dpng 'clayton_besselj_plots.png'
  fprintf ( 1, '  Created "clayton_besselj_plots.png".\n' );
%
%  besselk
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_besselk ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Bessel K, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [-2.0, 2.0, 0.0, +1.0] )
  hold off
  print -dpng 'clayton_besselk_plots.png'
  fprintf ( 1, '  Created "clayton_besselk_plots.png".\n' );
%
%  circular
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_circular ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0 ], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Circular correlation, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [-2.0, 2.0, 0.0, +1.0] )
  hold off
  print -dpng 'clayton_circular_plots.png'
  fprintf ( 1, '  Created "clayton_circular_plots.png".\n' );
%
%  constant
%  Pointless to make multiple plots for this one.
%
  clf
  hold on
  n = 101;
  rho0 = 1.0;
  rho = linspace ( -2.0, 2.0, n );
  c = correlation_constant ( n, rho, rho0 );
  plot ( rho, c, 'Linewidth', 4 );
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Constant correlation, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [ -2.0, 2.0, 0.0, +1.0] )
  hold off
  print -dpng 'clayton_constant_plots.png'
  fprintf ( 1, '  Created "clayton_constant_plots.png".\n' );
%
%  cubic
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_cubic ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Cubic correlation, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [ -2.0, 2.0, 0.0, +1.0] )
  hold off
  print -dpng 'clayton_cubic_plots.png'
  fprintf ( 1, '  Created "clayton_cubic_plots.png".\n' );
%
%  damped_cosine
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_damped_cosine ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Damped cosine correlation, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [ -2.0, 2.0, -1.0, +1.0] )
  hold off
  print -dpng 'clayton_damped_cosine_plots.png'
  fprintf ( 1, '  Created "clayton_damped_cosine_plots.png".\n' );
%
%  damped_sine
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_damped_sine ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Damped sine correlation, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [ -2.0, 2.0, -1.0, +1.0] )
  hold off
  print -dpng 'clayton_damped_sine_plots.png'
  fprintf ( 1, '  Created "clayton_damped_sine_plots.png".\n' );
%
%  exponential
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_exponential ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Exponential correlation, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [ -2.0, 2.0, 0.0, +1.0] )
  hold off
  print -dpng 'clayton_exponential_plots.png'
  fprintf ( 1, '  Created "clayton_exponential_plots.png".\n' );
%
%  gaussian
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_gaussian ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Gaussian correlation, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [-2.0, 2.0, 0.0, +1.0] )
  hold off
  print -dpng 'clayton_gaussian_plots.png'
  fprintf ( 1, '  Created "clayton_gaussian_plots.png".\n' );
%
%  Linear
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_linear ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Linear correlation, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [-2.0, 2.0, 0.0, +1.0] )
  hold off
  print -dpng 'clayton_linear_plots.png'
  fprintf ( 1, '  Created "clayton_linear_plots.png".\n' );
%
%  pentaspherical
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_pentaspherical ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Pentaspherical correlation, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [ -2.0, 2.0, 0.0, +1.0] )
  hold off
  print -dpng 'clayton_pentaspherical_plots.png'
  fprintf ( 1, '  Created "clayton_pentaspherical_plots.png".\n' );
%
%  rational quadratic
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_rational_quadratic ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Rational quadratic correlation, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [ -2.0, 2.0, 0.0, +1.0] )
  hold off
  print -dpng 'clayton_rational_quadratic_plots.png'
  fprintf ( 1, '  Created "clayton_rational_quadratic_plots.png".\n' );
%
%  spherical
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_spherical ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'Spherical correlation, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [ -2.0, 2.0, 0.0, +1.0] )
  hold off
  print -dpng 'clayton_spherical_plots.png'
  fprintf ( 1, '  Created "clayton_spherical_plots.png".\n' );
%
%  white_noise
%
  clf
  hold on
  n = 101;
  rho0 = [ 0.25, 1.0 ];
  rho = linspace ( -2.0, 2.0, n );
  for i = 1 : length ( rho0 )
    c = correlation_white_noise ( n, rho, rho0(i) );
    if ( rho0(i) == 1.0 )
      plot ( rho, c, 'Linewidth', 3, 'Color', 'r' );
    else
      plot ( rho, c, 'Linewidth', 3, 'Color', 'b' );
    end
  end
  plot ( [ -2.0, 2.0], [0.0, 0.0], 'Linewidth', 3, 'Color', 'k' );
  grid on
  ylabel ( '<-- Correlation Strength -->' )
  xlabel ( '<-- Distance -->' )
  title ( 'White noise correlation, Correlation length = 1 (red), 1/4 (blue)' )
  axis ( [-2.0, 2.0, 0.0, +1.0] )
  hold off
  print -dpng 'clayton_white_noise_plots.png'
  fprintf ( 1, '  Created "clayton_white_noise_plots.png".\n' );

  close

  return
end



