`factorialfactory`

Construct a factorial distribution structure

**Syntax**

D = factorialfactory(ComponentD, num) D = factorialfactory(ComponentD)

**Description**

`D = factorialfactory(ComponentD, num)` returns a structure representing a factorial distribution. `ComponentD` is a distribution structure defining facorial distribution type, and `num` is the number of factors.

`D = factorialfactory(ComponentD)` where ComponentD is a cell array of distribution structures defined on the same data space, constructs a heterogeneous factorial distribution `D` where each component may be of a different distribution type.

**Distribution Parameters**

(`D``num-by-1`cell array of distribution parameter structures) : Contains the parameters for each component.(`W``num-by-num`matrix) : The mixing matrix.

**Probability Density Function**

The distribution has the following density:

where is the number of components, is the k-th row of mixing matrix , and represents the density function for k-th component.

`name`

See distribution structure common members.

Flag to control the memory usage (resulting code will be slower)

`M`

See distribution structure common members.

`num`

Number of components (excluding any fixed components)

**Syntax**

num = D.num()

`component`

Component distributions

**Syntax**

D_k = D.component(k)

`subparam`

Extract a subset of component parameters

**Syntax**

subtheta = D.subparam(theta, idx)

`dim`

See distribution structure common members.

`datadim`

See distribution structure common members.

`ll`

See distribution structure common members.

`llvec`

See distribution structure common members.

`llgrad`

See distribution structure common members.

`llgraddata`

See distribution structure common members.

`gaussianize`

`pdf`

See distribution structure common members.

`sample`

See distribution structure common members.

`randparam`

See distribution structure common members.

`init`

See distribution structure common members.

`penalizerparam`

See distribution structure common members.

**Penalizer Info**

The default penalizer for the mixture distribution is the mixture of the default penalizers of its components, with equal weights.

`penalizercost`

See distribution structure common members.

`penalizergrad`

See distribution structure common members.

`sumparam`

See distribution structure common members.

`scaleparam`

See distribution structure common members.

`sumgrad`

See distribution structure common members.

`scalegrad`

See distribution structure common members.

`entropy`

See distribution structure common members.

`kl`

See distribution structure common members.

`AICc`

See distribution structure common members.

`BIC`

See distribution structure common members.