maxent.createModel
Description
Initializes a new maximum entropy model of a specified type. After creating a model, you will probably want to fit it to the experimental data with trainModel.
Usage
model = maxent.createModel(ncells,model_string)
model = maxent.createModel(ncells,'highorder',correlations)
model = maxent.createModel(ncells,'composite',inner_models)
model = maxent.createModel(ncells,model_string,Name,Value,...)
Arguments
Mandatory arguments
- ncells - number of cells (dimensions) in the distribution
- model_string - string denoting the type of models. Currently supported model types:
- indep - independent model
- pairwise (or "ising") - pairwise maximum entropy model
- ksync - k-synchrony
- kpairwise (or "kising") - pairwise maximum entropy model with k-synchrony
- highorder - custom high-order interaction model, supplied as a third argument in the form of a cell array of arrays, for example: {[1 3],[3 5 7 8],[2 3]} denotes interactions x1x3, x3x5x7x8, x2x3
- rp - RP (Random Projection) model
- composite- composite model combining the energy function of several other maximum entropy models. these should be provided in the 3rd argument as pre-created models in a cell array.
Optional arguments (in the form of name,value pairs)
- nprojections - number of random projections (for RP model)
- distribution - distribution the random projection values are drawn from (for RP model)
- sparsity - sparsity between 0 (completely sparse) and 1 (not sparse at all) - (for RP model)
- threshold - relative threshold for random projection (for RP model)
Output
- model_out - Untrained maximum entropy model.
Example usage
Create a pairwise maximum entropy model:
model = maxent.createModel(100,'pairwise')
Create a maximum entropy models with moments x1x2, x3x5x7x8, x2x3:
model = maxent.createModel(30,'highorder',{[1 3],[3 5 7 8],[2 3]})
Create an RP model with 500 projections and an average indegree of 5
model = maxent.createModel(30,'rp','nprojections',500,'indegree',5)
Create a composite model consisting of an indepedent model, population synchrony and third-order correlations:
m1 = maxent.createModel(20,'indep');
m2 = maxent.createModel(20,'ksync');
m3 = maxent.createModel(20,'highorder',num2cell(nchoosek(1:30,3),2));
model = maxent.createModel(20,'composite',{m1,m2,m3});