Model Structure Definition

CCToolbox | Download | Documentation | Contact

Description

Every cluster function in the toolbox returns a model structure that can be directly used with other functions in the toolbox. In this section, we list every possible field that can be returned in a model structure. No single cluster function will return all of these; only those fields that are relevant are returned.

In the structure definition each row is formatted as follows:
.field    : (data type) comment,
where 'field' lists the exact field name; 'data type' is one of number, string, struct, or some other size designation such as n-K matrix (an n-by-K matrix); and 'comment' gives a short description of the field.

The definition is split up into two parts. In the first part, the base fields that are used by every method are listed. The second part lists those fields that are used by the more advanced clustering and alignment methods. These fields aren't usually interesting in themselves but are important for the implementation of the clustering algorithms.

First, we list a number of size variables that are used in the structure definition.

n     : number of trajectories
D : number of dimensions (e.g., 2 for lat and lon)
K : number of clusters
P : 1 + order of regression model
I : number of EM iterations

The Base Fields

.K : (number) number of clusters
.order : (number) order of polynomial regression model
.Options : (struct) stores various option settings
.method : (string) method name, see listmodels()
.zero : (string) type of preprocessing, see trajs2seq()
.Pik : (n-K matrix) membership probabilities
.Alpha : (K-vector) k-th mixture weight
.Mu : (P-K-D matrix) regression parameters
.Sigma : (K-D matrix) variance param for regression noise model
.Lhood : (I-vector) sequence of log-likelihood iterates
.NumPoints : (number) total number of points in all trajs
.C : (n-vector) most likely classification given .Pik
.TrainLhood : (number) equal to .Lhood(end)
.TrainLhood_ppt : (number) equal to .TrainLhood/.NumPoints
.NumIndParams : (number) number of independent parameters estimated
.state : (vector) stores rand() state information
.nstate : (vector) stores randn() state information

The Alignment Fields

.Ea : (n-K matrix) scale parameters (in time)
.Eb : (n-K matrix) translation parameters (in time)
.Ee : (n-K-D matrix) scale parameters (measurement space)
.Ef : (n-K-D matrix) translation parameters (measurement space)
.Va : (n-K matrix) variance for .Ea
.Vb : (n-K matrix) variance for .Eb
.Ve : (n-K-D matrix) variance for .Ee
.Vf : (n-K-D matrix) variance for .Ef
.Vab : (n-K matrix) covariance for .Ea and .Eb
.Vef : (n-K-D matrix) covariance for .Ee and .Ef
.Vae,.Vaf,etc.     : (n-K-D matrix) covariances for listed variables
.R : (K-1 matrix) variance param for prior on .Ea (also for .Ee when .Ea doesn't exist; this should be changed)
.S : (K-1 matrix) variance param for prior on .Eb (also for .Ef when .Eb doesn't exist; this should be changed)
.T : (K-D matrix) variance param for prior on .Ef
.U : (K-D matrix) variance param for prior on .Ee

Parameter Explanations

In this section, a more detailed description for some of the more complex model structure fields is given.

As an aside, it is important to note that each of following variables has an expected value under each cluster (i.e., it's associated structure field has at least K entries); this is the nature of a mixture model. However, it is also true that the .E- and .V- parameters are also trajectory-dependent (i.e., they have at least n*K entries).

For example, .Ee gives the expected scale parameter for each trajectory and each dimension, under each cluster (thus, there are n*D*K entries). However, the only trajectory-dependent parameter value that is relevant is the one associated with the corresponding most likely cluster for each trajectory. We are not normally interested in the expected transformation for a specific trajectory in a cluster for which the trajectory does not belong. In other words, we would like a reduced matrix of size n-by-D that only lists the entries for each trajectory (and dimension) from the clusters to which the trajectories belong.

You can retrieve a reduced matrix that only contains the relevant entries for each trajectory-dependent parameter by using GetCindx(). For example, GetCindx(model.Ee, model.C) will return an n-D matrix containing all the relevant entries for all n trajectories and D dimensions (this is explained more clearly for each case below). You can substitute any of the trajectory-dependent parameters (.Ee, .Ef, .Ve, .Vf, .Vef) for .Ee in the call to GetCindx() as shown below.

Top | CCToolbox | Download | Documentation | Contact