himamo v0.1.0 Himamo.BaumWelch.StepE
Defines components of the E-step of the Baum-Welch algorithm (Expectation).
Calculates required statistics for the given model.
Summary
Functions
Computes alpha variable for Baum-Welch
Computes a Matrix where each element is alpha_{t, i} * beta_{t, i}
Computes beta variable for Baum-Welch
Computes gamma variable for Baum-Welch
Computes xi variable for Baum-Welch
Functions
Specs
compute_alpha(Himamo.Model.t, Himamo.ObsSeq.t) :: Himamo.Matrix.t
Computes alpha variable for Baum-Welch.
α_t(i) is the probability of being in state S_i at time t after
observing the first t symbols.
Returns tuple of tuples (size T×N) where:
T- length of observation sequenceN- number of states in the model
Specs
compute_alpha_times_beta(Himamo.Matrix.t, Himamo.Matrix.t) :: Himamo.Matrix.t
Computes a Matrix where each element is alpha_{t, i} * beta_{t, i}.
This is not matrix multiplication. The result of the above expression is used in multiple places, so the values are computed up front.
Specs
compute_beta(Himamo.Model.t, Himamo.ObsSeq.t) :: Himamo.Matrix.t
Computes beta variable for Baum-Welch.
ß_t(i) is the probability of being in state S_i at time t and
observing the partial sequence from t+1 to the end.
Returns tuple of tuples (size T×N) where:
T- length of observation sequenceN- number of states in the model
Specs
compute_gamma(Himamo.Model.t, Himamo.ObsSeq.t, [{:xi, Himamo.Matrix.t}]) :: Himamo.Matrix.t
Computes gamma variable for Baum-Welch.
γ_t(i) is the probability of being in state S_i at time t given the
full observation sequence.
Returns tuple of tuples (size T×N) where:
T- length of observation sequenceN- number of states in the model
Specs
compute_xi(Himamo.Model.t, Himamo.ObsSeq.t, alpha: Himamo.Matrix.t, beta: Himamo.Matrix.t) :: Himamo.Matrix.t
Computes xi variable for Baum-Welch.
ξ_t(i,j) is the probability of being in state S_i at time t and in
state S_j at time t+1 given the full observation sequence.
Returns tuple of tuples of tuples (size T×N×N) where:
T- length of observation sequenceN- number of states in the model