disp('Running MATLAB script file nmdatat.f') ;
%
%    For developing and testing the MATLAB proc nmdata.m
%      which generates normal mixture densities
%
%    Reads in parameters from file nmpar.dat
% 


itest = 2 ;     %  1 - Simple test
                %  2 - More complicated test

if itest == 1 ;
  vmu = [-2; 2] ;
  vsig2 = [.25; .0001] ;
  vw = [.2; .8] ;

  out = nmdata(10,vmu,vsig2,vw) 

elseif itest == 2 ;   
  mparam = [[0; 1; 5], [.25; 1; .01], [.5; .4; .1]] ;

  vdat = nmdata(1000,mparam) ;

  gpkde(vdat) ;
    hold on ;
      vf = nmf((-2:.02:6)',mparam) ;
      plot((-2:.02:6)',vf,'r') ;
    hold off ;

end ;
