[Biojava-l] HMM's and Distributions

Thomas Down td2@sanger.ac.uk
Wed, 17 Jan 2001 10:46:49 +0000


On Wed, Jan 17, 2001 at 12:33:57PM +1300, Mark Schreiber wrote:
> Hi,
> 
> As a bit of a learning excercise I am recoding the Dice.java demo to work
> with the new definitions of some of the Seq and Dist and DP classes. This
> may also be useful to others so I may post it when finished.
> 
> I have on quick question. I notice that transition probabilities are
> passed to a HMM as a Distribution object. How would one construct such an
> object to hold the transitions and probabilities??

MarkovModel implementations implicitly construct alphabets
representing the set of transition destinations from any given
state, so you can do

  dist = DistributionFactory.DEFAULT.createDistribution(
                  model.transitionsFrom(someState));

I think you can also just get the distribution in current use:

  dist = model.getWeights(someState);

And alter that using the Distribution.setWeight(double) method.

Hope this helps,

    Thomas.
-- 
``If I was going to carry a large axe on my back to a diplomatic
function I think I'd want it glittery too.''
           -- Terry Pratchett