disp('Running MATLAB script file gpdeseat.m') ;
%
%    FOR DEVELOPMENT AND TESTING OF MATLAB FUNCTION gpdeseas,
%    General Puprpose Deseasonalization

itest = 5 ;     %   1,2,3,4,5

format compact ;

if itest == 1 ;    

  vdata = [1; 2; 3] ;
  vdata = [vdata; vdata; vdata; vdata] 

  [vdeseased, seascomp] = gpdeseas(vdata,3)


elseif itest == 2 ;

  vdata = [1; 2; 3] ;
  vdata = [vdata; vdata; vdata; vdata] ;
  vdata = [vdata; 1; 2] 

  [vdeseased, seascomp] = gpdeseas(vdata,3)



elseif itest == 3 ;

  vdata = (1:6)' 

  lag = 7 ;    % try 2,4,5,6,7

  [vdeseased, seascomp] = gpdeseas(vdata,lag)


elseif itest == 4 ;

  vdata = sin(2 * pi * (1:200) / 20)' ;
  vdata = vdata + .1 * randn(200,1) ;

  lag = 40 ;    %  try 10, 20, 40, 21

  [vdeseased, seascomp] = gpdeseas(vdata,lag) ;

    plot(1:200,[vdata, vdeseased, seascomp]) ;



elseif itest == 5 ;

  vdata = sin(2 * pi * (1:200) / 20.5)' ;
  vdata = vdata + .1 * randn(200,1) ;

  lag = 20.7 ;    %  try 20, 21, 20.5, 20.6, 20.7

  [vdeseased, seascomp] = gpdeseas(vdata,lag) ;

    plot(1:200,[vdata, vdeseased, seascomp]) ;



end ;



