Code covered by the BSD License  

Highlights from
Statistical Learning Toolbox

from Statistical Learning Toolbox by Dahua Lin
Functions for statistical learning, pattern recognition and computer vision, covering many topics.

Description of slkernelscatter
Home > sltoolbox > kernel > slkernelscatter.m

slkernelscatter

PURPOSE ^

SLKERNELSCATTER Compute the kernelized scatter matrix

SYNOPSIS ^

function S = slkernelscatter(K, type, varargin)

DESCRIPTION ^

SLKERNELSCATTER Compute the kernelized scatter matrix

 $ Syntax $
   - S = slkernelscatter(K, type, ...)

 $ Arguments $
   - K:        the kernel gram matrix of the samples
   - type:     the type of the scatter matrix
   - S:        the resulting scatter matrix

 $ Description $
   - S = slkernelscatter(K, type, ...) computes the kernelized scatter
     matrix of K. It can be shown that the computation of the kernelized
     scatter matrix is equivalent to the computation of conventional 
     scatter matrix with the sample matrix replaced by the gram matrix.
     Thus this function simply invoke slscatter with K replacing X.
     The usage can be referred to function slscatter.

 $ Remarks $
   -# The so-called kernel scatter matrix is an n x n matrix defined by
      following formula:
       S = Phi^T * scatter(phi_1, phi_2, ..., phi_n) * Phi
      here scatter(.) is the scatter matrix defined like for conventional
      scatter but on the nonlinearly mapped features. Phi is the set of
      nonlinearly mapped features. The kernelized scatter matrix plays 
      a core role in kernelized discrminant analysis.

 $ History $
   - Created by Dahua Lin on May 03, 2006

CROSS-REFERENCE INFORMATION ^

This function calls:
  • slscatter SLSCATTER Compute the scatter matrix
  • raise_lackinput RAISE_LACKINPUT Raises an error indicating lack of input argument
This function is called by:

SOURCE CODE ^

0001 function S = slkernelscatter(K, type, varargin)
0002 %SLKERNELSCATTER Compute the kernelized scatter matrix
0003 %
0004 % $ Syntax $
0005 %   - S = slkernelscatter(K, type, ...)
0006 %
0007 % $ Arguments $
0008 %   - K:        the kernel gram matrix of the samples
0009 %   - type:     the type of the scatter matrix
0010 %   - S:        the resulting scatter matrix
0011 %
0012 % $ Description $
0013 %   - S = slkernelscatter(K, type, ...) computes the kernelized scatter
0014 %     matrix of K. It can be shown that the computation of the kernelized
0015 %     scatter matrix is equivalent to the computation of conventional
0016 %     scatter matrix with the sample matrix replaced by the gram matrix.
0017 %     Thus this function simply invoke slscatter with K replacing X.
0018 %     The usage can be referred to function slscatter.
0019 %
0020 % $ Remarks $
0021 %   -# The so-called kernel scatter matrix is an n x n matrix defined by
0022 %      following formula:
0023 %       S = Phi^T * scatter(phi_1, phi_2, ..., phi_n) * Phi
0024 %      here scatter(.) is the scatter matrix defined like for conventional
0025 %      scatter but on the nonlinearly mapped features. Phi is the set of
0026 %      nonlinearly mapped features. The kernelized scatter matrix plays
0027 %      a core role in kernelized discrminant analysis.
0028 %
0029 % $ History $
0030 %   - Created by Dahua Lin on May 03, 2006
0031 %
0032 
0033 %% parse and verify input arguments
0034 
0035 if nargin < 2
0036     raise_lackinput('slkernelscatter', 2);
0037 end
0038 
0039 if ndims(K) ~= 2 || size(K, 1) ~= size(K, 2)
0040     error('sltoolbox:invaliddims', ...
0041         'The gram matrix K should be a square matrix');
0042 end
0043 
0044 %% delegate to slscatter for computation
0045 
0046 S = slscatter(K, type, varargin{:});

Generated on Wed 20-Sep-2006 12:43:11 by m2html © 2003

Contact us at files@mathworks.com