Generating statistics for HMM problem