mdwtcluster

Multisignals 1-D clustering

Syntax

S = mdwtcluster(X)
S = mdwtcluster(X,'PropName1',PropVal1,'PropName2',PropVal2,...)

Description

S = mdwtcluster(X) constructs clusters from a hierarchical cluster tree. The input matrix X is decomposed in row direction using the DWT function with the haar wavelet and the maximum allowed level.

S = mdwtcluster(X,'PropName1',PropVal1,'PropName2',PropVal2,...) allows you to modify some properties. The valid choices for PropName are:

    Note:   mdwtcluster requires the Statistics Toolbox™

'dirDec'

'r' (row) or 'c' (column). Default value is 'r'.

'level'

Level of the DWT decomposition. Default value is:
level=fix(log2(size(X,d)))
where d=1 or d=2, depending on the dirDec value.

'wname'

Wavelet name used for DWT. Default value is 'haar'.

'dwtEXTM'

DWT extension mode (see dwtmode).

'pdist'

See Statistics Toolbox pdist function. Default value is 'euclidean'.

'linkage'

See Statistics Toolbox linkage function. Default value is 'ward'.

'maxclust'

Number of clusters. Default value is 6. The input variable can be a vector.

'lst2clu'

Cell array that contains the list of data to classify.

If N is the level of decomposition, the allowed name values for the cells are:

  • 's' — Signal

  • 'aj' — Approximation at level j

  • 'dj' — Detail at level j

  • 'caj' — Coefficients of approximation at level j

  • 'cdj' — Coefficients of detail at level j

Default value is {'s';'ca1';...;'caN'}.

The output structure S is such that for each partition j:

S.Idx(:,j)

Contains the cluster numbers obtained from the hierarchical cluster tree (see cluster in the Statistics Toolbox software).

S.Incons(:,j)

Contains the inconsistent values of each non-leaf node in the hierarchical cluster tree (see Statistics Toolbox software function inconsistent).

S.Corr(j)

Contains the cophenetic correlation coefficients of the partition (see Statistics Toolbox software function cophenet).

    Note   If maxclustVal is a vector, then IdxCLU is a multidimensional array such that IdxCLU(:,j,k) contains the cluster numbers obtained from the hierarchical cluster tree for k clusters.

Examples

load elecsig10
lst2clu = {'s','ca1','ca3','ca6'};

% Compute the structure resulting from multisignal clustering
S = mdwtcluster(signals,'maxclust',4,'lst2clu',lst2clu)

S = 

    IdxCLU: [70x4 double]
    Incons: [69x4 double]
      Corr: [0.7920 0.7926 0.7947 0.7631]

% Retrieve indices of clusters
IdxCLU = S.IdxCLU;

% Plot the first cluster
plot(signals(IdxCLU(:,1)==1,:)','r');
hold on; 

% Plot the third clustering
plot(signals(IdxCLU(:,1)==3,:)','b')

% Check the equality of partitions
equalPART = isequal(IdxCLU(:,1),IdxCLU(:,3))

equalPART =

     1

% So we can see that we obtain the same partitions using
% coefficents of approximation at level 3 instead of original
% signals. Much less information is then used.

See Also

|

Was this topic helpful?