Home > Source > Model > measure_model.m

measure_model

PURPOSE ^

MEASURE_MODEL: Measure the "goodness" of a model given some

SYNOPSIS ^

function score = measure_model(combined_variances, n_modes, model_evaluation_method, combined_model)

DESCRIPTION ^

 MEASURE_MODEL: Measure the "goodness" of a model given some
                of its properties.

 Code written by Katherine Smith, 2003

    GENERAL

      score = measure_model(combined_variances, n_modes, model_evaluation_method, combined_model)

    INPUT/S

      -combined_model:
             The full combined model

      -combined_variances: (obsolete)
           The combined variances of the model.

      -n_modes:
           The total number of modes of the model.
 
      -method:
           Method of evaluating a model.

    OUTPUT/S

      -score:
           A score indicating the "goodness" of the model.

    PENDING WORK

      -Add some comments on process

    KNOWN BUG/S

      -None.

    COMMENT/S

      -Smith: add a small error to avoid zero values

    RELATED FUNCTION/S

      

    ABOUT

      -Created:     November 23rd, 2003
      -Last update: February 10th, 2004
      -Revision:    0.0.9
      -Author:      R. S. Schestowitz, University of Manchester
 ==============================================================

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function score = measure_model(combined_variances, n_modes, model_evaluation_method, combined_model)
0002 % MEASURE_MODEL: Measure the "goodness" of a model given some
0003 %                of its properties.
0004 %
0005 % Code written by Katherine Smith, 2003
0006 %
0007 %    GENERAL
0008 %
0009 %      score = measure_model(combined_variances, n_modes, model_evaluation_method, combined_model)
0010 %
0011 %    INPUT/S
0012 %
0013 %      -combined_model:
0014 %             The full combined model
0015 %
0016 %      -combined_variances: (obsolete)
0017 %           The combined variances of the model.
0018 %
0019 %      -n_modes:
0020 %           The total number of modes of the model.
0021 %
0022 %      -method:
0023 %           Method of evaluating a model.
0024 %
0025 %    OUTPUT/S
0026 %
0027 %      -score:
0028 %           A score indicating the "goodness" of the model.
0029 %
0030 %    PENDING WORK
0031 %
0032 %      -Add some comments on process
0033 %
0034 %    KNOWN BUG/S
0035 %
0036 %      -None.
0037 %
0038 %    COMMENT/S
0039 %
0040 %      -Smith: add a small error to avoid zero values
0041 %
0042 %    RELATED FUNCTION/S
0043 %
0044 %
0045 %
0046 %    ABOUT
0047 %
0048 %      -Created:     November 23rd, 2003
0049 %      -Last update: February 10th, 2004
0050 %      -Revision:    0.0.9
0051 %      -Author:      R. S. Schestowitz, University of Manchester
0052 % ==============================================================
0053 
0054 Epsilon = 0.0001;
0055 current_method = model_evaluation_method;
0056 
0057 % size(combined_variances,2) % see number of modes
0058 if (strcmp(current_method,'determinant')),
0059           % see Kotcheff
0060     padded_variances = zeros(1,n_modes); 
0061           % a vector of zeroes the size of modes number
0062     if(size(combined_variances,2)<= n_modes),
0063       padded_variances(:,1:size(combined_variances,2)) = combined_variances;
0064     else
0065       padded_variances(:,1:n_modes) = combined_variances(:,1:n_modes);
0066     end
0067     padded_variances = padded_variances + Epsilon; 
0068           % Smith: add a small error to avoid 0
0069     score = prod(padded_variances); 
0070           % product of vector components i.e. determinant (Kotcheff)
0071 elseif (strcmp(current_method,'minimum_description_length')),
0072     msgbox('MDL: Not yet implemented');
0073 elseif (strcmp(current_method,'sum_of_log_eigenvalues')),     
0074     padded_variances = zeros(1,n_modes); 
0075           % a vector of zeroes the size of modes number
0076     if(size(combined_variances,2)<= n_modes),
0077       padded_variances(:,1:size(combined_variances,2)) = combined_variances;
0078     else
0079       padded_variances(:,1:n_modes) = combined_variances(:,1:n_modes);
0080     end
0081     padded_variances = padded_variances + 0.0001;
0082     score = sum(log(padded_variances));
0083 elseif (strcmp(current_method,'specificity')),
0084     msgbox('Specificity Evaluation: Not yet implemented'); % need ref_points and images score = find_specificity(combined_model, images, 25, ref_points_vec);
0085 elseif (strcmp(current_method,'generalisability')),  
0086     score = find_generalisability(combined_model, 25); % score = find_generalisability(combined_model........
0087 else
0088     error('Unknown model evaluation method.');
0089 end

Generated on Fri 14-May-2004 10:05:30 by m2html © 2003