""" Sparse_hmm_lor.py For making the "likeLor" figure in that plots cross entropy vs number of states, going up to millions of states. Builds discrete output HMMs of quantized observations of the Lorenz system by using information about the continuous states of the system. Goal is to build an HMM that gets close to the entropy bound estimated via Lyapunov exponents. """ import sys, numpy, scipy.sparse, math, time, lorenz def F_step(Pyt,PN,a,alpha,ScS,YcS): import scipy.weave as weave ScS_indptr = ScS.indptr # I would like to avoid these translations ScS_indices = ScS.indices ScS_data = ScS.data YcS_indptr = YcS.indptr YcS_indices = YcS.indices YcS_data = YcS.data return weave.inline(""" int i,j,k; int yt = Pyt; /* Weave chokes without these cast like things */ int N = PN; double alpha_i,gamma; for(i=0;i