def _generateModel0(numCategories):
 initProb = numpy.zeros(numCategories)
 initProb[0] = 0.5
 initProb[4] = 0.5
 firstOrder = dict()
 for catIdx in range(numCategories):
  key = str([catIdx])
  probs = (numpy.ones(numCategories) / numCategories)
  if ((catIdx == 0) or (catIdx == 4)):
   probs.fill(0)
   probs[1] = 1.0
  firstOrder[key] = probs
 secondOrder = dict()
 for firstIdx in range(numCategories):
  for secondIdx in range(numCategories):
   key = str([firstIdx, secondIdx])
   probs = (numpy.ones(numCategories) / numCategories)
   if (key == str([0, 1])):
    probs.fill(0)
    probs[2] = 0.8
    probs[3] = 0.2
   elif (key == str([4, 1])):
    probs.fill(0)
    probs[2] = 0.2
    probs[3] = 0.8
   secondOrder[key] = probs
 return (initProb, firstOrder, secondOrder, 3)

def _generateModel0 ( numCategories ) : initProb = numpy . zeros ( numCategories ) initProb [ 0 ] = 0.5 initProb [ 4 ] = 0.5 firstOrder = dict ( ) for catIdx in range ( numCategories ) : key = str ( [ catIdx ] ) probs = ( numpy . ones ( numCategories ) / numCategories ) if ( ( catIdx == 0 ) or ( catIdx == 4 ) ) : probs . fill ( 0 ) probs [ 1 ] = 1.0 firstOrder [ key ] = probs secondOrder = dict ( ) for firstIdx in range ( numCategories ) : for secondIdx in range ( numCategories ) : key = str ( [ firstIdx , secondIdx ] ) probs = ( numpy . ones ( numCategories ) / numCategories ) if ( key == str ( [ 0 , 1 ] ) ) : probs . fill ( 0 ) probs [ 2 ] = 0.8 probs [ 3 ] = 0.2 elif ( key == str ( [ 4 , 1 ] ) ) : probs . fill ( 0 ) probs [ 2 ] = 0.2 probs [ 3 ] = 0.8 secondOrder [ key ] = probs return ( initProb , firstOrder , secondOrder , 3 )
generate the initial .