Home > evaluation > ccl_error_npe.m

ccl_error_npe

PURPOSE ^

[umse, variance, nmse] = ccl_error_npe (U, Unp)

SYNOPSIS ^

function [umse, variance, nmse] = ccl_error_npe (U, Unp)

DESCRIPTION ^

 [umse, variance, nmse] = ccl_error_npe (U, Unp)

 Calculate the nullspace projection error(NPE). This quantity is used to evaluate
 the quality of the learnt model in the absence of the true nullspace components

 Input:

   U                           True observations
   Unp                         Unp: learnt nullspace component

 Output:

   umse                        Mean square error
   variance                    variance in the observations
   nmse                        Normalised mean square error

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [umse, variance, nmse] = ccl_error_npe (U, Unp)
0002 % [umse, variance, nmse] = ccl_error_npe (U, Unp)
0003 %
0004 % Calculate the nullspace projection error(NPE). This quantity is used to evaluate
0005 % the quality of the learnt model in the absence of the true nullspace components
0006 %
0007 % Input:
0008 %
0009 %   U                           True observations
0010 %   Unp                         Unp: learnt nullspace component
0011 %
0012 % Output:
0013 %
0014 %   umse                        Mean square error
0015 %   variance                    variance in the observations
0016 %   nmse                        Normalised mean square error
0017 
0018 
0019 
0020 
0021 % CCL: A MATLAB library for Constraint Consistent Learning
0022 % Copyright (C) 2007  Matthew Howard
0023 % Contact: matthew.j.howard@kcl.ac.uk
0024 %
0025 % This library is free software; you can redistribute it and/or
0026 % modify it under the terms of the GNU Lesser General Public
0027 % License as published by the Free Software Foundation; either
0028 % version 2.1 of the License, or (at your option) any later version.
0029 %
0030 % This library is distributed in the hope that it will be useful,
0031 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0032 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0033 % Lesser General Public License for more details.
0034 %
0035 % You should have received a copy of the GNU Library General Public
0036 % License along with this library; if not, write to the Free
0037 % Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
0038 
0039 N   = size(U,2);
0040 umse= 0;
0041 
0042 for n=1:N
0043     up      = Unp(:,n);
0044     P       = up*up'/(up'*up);
0045     Pu      = P*U(:,n);
0046     umse    = umse + norm(Pu - up)^2;
0047 end
0048 
0049 umse    = umse / N ;
0050 variance= sum(var(U,1,2)) ;
0051 nmse    = umse / variance  ;
0052 end

Generated on Mon 01-Jan-2018 15:49:39 by m2html © 2005