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