Anthony Liu <[EMAIL PROTECTED]> writes:
> OK, I actually just want to "manually" create Hidden
> Markov Models by randomly generating the initial state
> probabilities PI,

OK, this sounds like you actually want to divide the unit interval up
into pieces of varying sizes.  Example (untested):

  n = 10   # number of pieces desired

  # Take the unit interval [0,1] and sprinkle in n-1 random points
  s = sorted([0,1] + [random() for i in xrange(n-1)])

  # now find the size of each sub-interval and make a list
  r = [(s[i+1] - s[i]) for i in xrange(n)]

  print sum(r)   # should be 1.0 within rounding error
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to