function r8vec_rsquared_test ( )

%*****************************************************************************80
%
%% R8VEC_RSQUARED_TEST tests R8VEC_RSQUARED.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 January 2019
%
%  Author:
%
%    John Burkardt
%
  n = 11;

  y_model = [ ...
     0.00,  9.00, 16.00, 21.00, 24.00, ...
    25.00, 24.00, 21.00, 16.00,  9.00,  ...
     0.00 ];
  y_data = [ ...
     0.00,  9.58, 16.76, 21.52, 24.38, ...
    24.97, 22.90, 20.45, 12.40,  7.65, ...
    -3.82 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8VEC_RSQUARED_TEST\n' );
  fprintf ( 1, '  R8VEC_RSQUARED evaluates the R^2 goodness-of-fit statistic.\n' );

  r8vec2_print ( y_data, y_model, "  Data and model:" );

  rsquared = r8vec_rsquared ( n, y_data, y_model );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Computed R^2 is %g\n', rsquared );

  return
end
