function asset_path_test ( )

%*****************************************************************************80
%
%% asset_path_test() tests asset_path().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 February 2012
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'asset_path_test():\n' );
  fprintf ( 1, '  asset_path() simulates an asset price path.\n' );

  s0 = 2.0;
  mu = 0.1;
  sigma = 0.3;
  n = 100;
  t0 = 0.0;
  t1 = 1.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The asset price at time 0,     S0    = %f\n', s0 );
  fprintf ( 1, '  The asset expected growth rate MU    = %f\n', mu );
  fprintf ( 1, '  The asset volatility           SIGMA = %f\n', sigma );
  fprintf ( 1, '  The expiry date                T1    = %f\n', t1 );
  fprintf ( 1, '  The number of time steps       N     = %d\n', n );

  s = asset_path ( s0, mu, sigma, t1, n );
%
%  Plot.
%
  figure ( 1 );
  clf ( );
  t = ( linspace ( t0, t1, n + 1 ) )';
  plot ( t, s, 'Linewidth', 3 );
  grid ( 'on' );
  xlabel ( '<-- Time -->' );
  ylabel ( '<-- Value --> ' );
  title ( 'Simulated asset path' );
  print ( '-dpng', 'asset_path_test.png' );
%
%  Print a little.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Partial results:\n' );
  disp ( s(1:10) );
  disp ( '...' );
  disp ( s(end) );
%
%  Write to a file.
%
  filename = 'asset_path.txt';
  save ( filename, 's', '-ascii' );
  fprintf ( 1, '  Data saved as "%s".\n', filename );

  return
end
