Ticket #9735: trac_9735-chmm-noise.patch

File trac_9735-chmm-noise.patch, 1.1 KB (added by jhpalmieri, 11 years ago)
  • sage/stats/hmm/chmm.pyx

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1281650275 25200
    # Node ID 43f16d7fe5750ef79a4a3549f792b135d852bde9
    # Parent  118c8bba4a4332d372bed16e0df584090e1c6716
    #9735: numerical noise in chmm.pyx
    
    diff -r 118c8bba4a43 -r 43f16d7fe575 sage/stats/hmm/chmm.pyx
    a b  
    130130    for which our observation sequence is more likely::
    131131
    132132        sage: m.baum_welch(obs)
    133         (-10.610333495739708, 14)
     133        (-10.6103334957397..., 14)
    134134        sage: m.log_likelihood(obs)
    135         -10.610333495739708
     135        -10.6103334957397...
    136136
    137137    Notice that running Baum-Welch changed our model::
    138138
     
    568568
    569569            sage: m = hmm.GaussianHiddenMarkovModel([[0.5,0.5],[0.5,0.5]], [(0,1),(10,1)], [0.5,0.5])
    570570            sage: m.viterbi([0,1,10,10,1])
    571             ([0, 0, 1, 1, 0], -9.0604285688230899)
     571            ([0, 0, 1, 1, 0], -9.0604285688230...)
    572572
    573573        Another example in which the most likely states change based
    574574        on the last observation::