Code covered by the BSD License  

Highlights from
Causal State Modeller Toolbox

image thumbnail

Causal State Modeller Toolbox

by

 

11 Oct 2011 (Updated )

Allows users to infer minimal and optimal statistical predictors from time series data.

MixtureModelFitter(a, n, option)
function [MEAN, VAR, bestN, MPs] = MixtureModelFitter(a, n, option)

AICmin = 9999999;

maxN = n;

if option == 0
    minN = 1;
elseif option == 1
    minN = maxN;
end

for N = minN:maxN

    obj = gmdistribution.fit(a',N);
    mps = obj.PComponents;
    ComponentMeans = obj.mu;
    ComponentCovariances = obj.Sigma;
    AIC= obj.AIC;

    if AIC < AICmin
        AICmin = AIC;
        bestN = N;
        MEAN = ComponentMeans;
        MPs = mps;
        for i = 1:N
            VAR(i) = ComponentCovariances(i);
        end
    end

end

Contact us