function [mean_specs, std_specs] = show_spec_v_modes(models, training_data, n_iters, ref_points_vec)
% SHOW_SPEC_V_MODES: Shows the specificity of the models versus
%                    the difference of modes.
%
% Code written by Katherine Smith, 2003
%
%    GENERAL
%
%      [mean_specs, std_specs] = show_spec_v_modes
%             (models, training_data, n_iters, ref_points_vec)
%
%    INPUT/S
%
%      -models:
%           The models to be investigated.
%
%      -training_data:
%           The training data that is used with the model.
%
%      -n_iters:
%           Number of iteration used to control complexity.
%
%      -ref_points_vec:
%           The points of the reference image
%           
%    OUTPUT/S
%
%      -mean_specs:
%           Mean specificity.
%
%      -std_specs:
%           Standard deviation of specificity.
%
%    PENDING WORK
%
%      -
%
%    KNOWN BUG/S
%
%      -None.
%
%    COMMENT/S
%
%      -
%
%    RELATED FUNCTION/S
%
%      
%
%    ABOUT
%
%      -Created:     November 23rd, 2003
%      -Last update: Novermber 27th, 2003
%      -Revision:    0.0.3
%      -Author:      R. S. Schestowitz, University of Manchester
% ==============================================================

n_models = size(models,1); 
           % retrieve number of models

for i = 1:n_models
           % for each model
  n_modes = size(models(i).model.pcs,2); 
           % get number of modes in the current model
  for j=1:n_modes
           % calculate specificity using index j modes
    [mean_spec(i,j), std_spec(i,j)]= find_specificity(models(i).model,training_data, n_iters, ref_points_vec, 'n_modes', j);
  end
end

mean_specs = mean(mean_spec);
           % get the overall mean
std_specs = mean(std_spec);
           % get the overall mean