Home > utils > 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: $
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 end

Generated on Tue 10-Feb-2015 18:16:33 by m2html © 2005