I recently asked a way to calculate BIC score for a given HMM (transition, emission, initial distribution). After doing some more research (basically the wiki page and this CV thread) I realized its a easy doable process. I didn't get any answers on my first thread but hopefully this one is a more specific question.
So for a given HMM, the BIC is scored with a formula.
> BIC = -2*logLike + num_of_params * log(num_of_data)
The formula requires two things that I don't know how to get. One is the number of params and the other is num of data. Based on above CV thread, the two general formulas seem to be
> Nparams = size(model.trans,2)*(size(model.trans,2)-1) +
> size(model.pi,2)-1) +
> size(model.emission.T,1)*(size(model.emission.T,2)-1)
and
> Nparams = Num_of_states*(Num_of_States-1) - Nbzeros_in_transition_matrix
Does the first formula work on every HMM with any nxn trans/emission matrix? And for the second formula can I say any transition probability less than $10^{-4}$ is effectively a zero?
Some context: I am using a software called ChromHMM which uses the Baum Welch algorithm on a multivariate data set to fit HMM for a given state size. I ran this software from 20 states to 40 states, giving me 20 models but I don't know which one to pick.