
% lyngby_uis_baf2      - Script executed for Ardekani's nuisance F
%
%       See also LYNGBY, LYNGBY_BAF2_GLOBAL, LYNGBY_UI_GLOBAL.
%
% $Id: lyngby_uis_baf2.m,v 1.3 2003/05/26 17:01:35 fnielsen Exp $ 


      [RESULT_BAF2, RESULT_BAF2_AIC, RESULT_BAF2_UB] = ...
	  lyngby_baf2_main(XN, R, ...
	  'Components', BAF2_COMPONENTS,...
	  'MaxNuisanceDim', BAF2_MAX_NUISANCE);

      [dummy, nuisanceDim] = min(RESULT_BAF2_AIC);
      nuisanceDm = nuisanceDim - 1;
      baf2_level = lyngby_idf_f(1 - BAF2_ERRORLEVEL,...
	  BAF2_COMPONENTS, size(XN,1) - BAF2_COMPONENTS- 1);
      STRENGTH_BAF2 = sqrt(RESULT_BAF2);
      PROB_BAF2 = lyngby_cdf_f(RESULT_BAF2, BAF2_COMPONENTS, ...
	  size(XN,1) - BAF2_COMPONENTS - nuisanceDim);
      TRUNK_STRENGTH_BAF2 = baf2_level .* (RESULT_BAF2 > baf2_level);
      RESULT = RESULT_BAF2;
	  
