Home > . > prt_normalise_kernel.m

prt_normalise_kernel

PURPOSE ^

FORMAT K_normalised = prt_normalise_kernel(K)

SYNOPSIS ^

function K_normalised = prt_normalise_kernel(K)

DESCRIPTION ^

 FORMAT K_normalised = prt_normalise_kernel(K)

 This function normalises the kernel matrix such that each entry is 
 divided by the product of the std deviations, i.e.
 K_new(x,y) = K(x,y) / sqrt(var(x)*var(y)) 
__________________________________________________________________________
 Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function K_normalised = prt_normalise_kernel(K)
0002 
0003 % FORMAT K_normalised = prt_normalise_kernel(K)
0004 %
0005 % This function normalises the kernel matrix such that each entry is
0006 % divided by the product of the std deviations, i.e.
0007 % K_new(x,y) = K(x,y) / sqrt(var(x)*var(y))
0008 %__________________________________________________________________________
0009 % Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory
0010 
0011 % Written by A. Marquand
0012 % $Id: prt_normalise_kernel.m 135 2011-10-11 10:21:27Z amarquan $
0013 
0014 d = diag(K);
0015 K0 = sqrt(repmat(d,[1,size(K,1)]).* repmat(d',[size(K,1),1]));
0016 K_normalised = K./K0;
0017 
0018 return

Generated on Sun 20-May-2012 13:24:48 by m2html © 2005