Syntax:
[segment,tc] = pcaseg(data,num_segments,q,flag)
This function execute the Bottom-Up segmentation of the data until only num_segments segments remain.
The result of the segmentation can be found in the structure segment. It contains the following:
segment.lx : the left bound of the segments;
segment.rx : the right bound of the segments;
segment.mc : merging cost of the segments with their right neighbors;
segment.c : cost of the segments;
segment.pc : principal components of the PCA model of the segments;
segment.avg : mean of the data in the particular segments;
segment.latent : eigenvalues of the covariance matrices.
This function uses the pcaresid.m and princomp.m functions.
Example:
flag=[0 1]; % 0:T2, 1:Q for Bottom-Up algorithm for i=1:length(flag) segment=[]; tc=[]; index=[]; [segment,tc] = pcaseg(x,inicBU,q,flag(i)); . . . end