disp('Running MATLAB script file bwrfpht.m') ;
%
%    FOR DEVELOPMENT AND TESTING OF MATLAB FUNCTION bwrfph,
%    Sheather Jones Plug In bandwidth (binned)
%    Compares results to those from GAUSS program NMSJPI.TST

format compact ;

%  Read in test data:
load c:\gauss\steve\nmstuff\tests\nmsjpi.dat ;
          %  assumes this ascii file is in the current directory
          %  (usually lives in \gauss\steve\nmstuff)
data = nmsjpi ;
          %  recall this load uses the filename for the variable


%  Old values, copied from NMSJPI.OUT
orfpp = 2.1727287000453 ;
orfppp = 67.570436048408 ;

%  Get new values
bincts = gplbinr(data,[-4,4]) ;
h = .3 ;
nrfpp = bwrfph(bincts,[-4,4],h,2) ;
nrfppp = bwrfph(bincts,[-4,4],h,3) ;


%  Compare:
disp('Old rp''s were:') ;
orfpp 
orfppp

disp('New rp''s were:') ;
nrfpp 
nrfppp

