API reference

Types

ControlledHiddenMarkovModels.AbstractControlledHiddenMarkovModelType
ControlledHiddenMarkovModels.ForwardBackwardStorageType
ForwardBackwardStorage{R}

Storage for the forward-backward algorithm applied to multiple sequences.

Fields

  • α::Vector{Matrix{R}}
  • c::Vector{Vector{R}}
  • β::Vector{Matrix{R}}
  • bβ::Vector{Matrix{R}}
  • γ::Vector{Matrix{R}}
  • ξ::Vector{Array{R,3}}

Methods

Base.randFunction
rand(rng, hmm::AbstractHMM, T, par)

Sample a trajectory of length T from hmm with parameters par.

Returns a couple (state_sequence, obs_sequence).

Base.randMethod
rand(rng, hmm::AbstractControlledHMM, control_sequence, par)

Sample a trajectory from hmm with controls control_sequence and parameters par.

Returns a couple (state_sequence, obs_sequence).

ControlledHiddenMarkovModels.baum_welch_multiple_sequencesFunction
baum_welch_multiple_sequences(obs_sequences, hmm_init::HMM[, par; max_iterations, tol])

Apply the Baum-Welch algorithm on multiple observation sequences, starting from an initial HMM hmm_init with parameters par.

The parameters are not modified.

ControlledHiddenMarkovModels.fit_from_multiple_sequencesMethod
fit_from_multiple_sequences(::Type{D}, xs, ws)

Fit a distribution of type D based on multiple sequences of observations xs associated with multiple sequences of weights ws.

Must accept arbitrary iterables for xs and ws.

ControlledHiddenMarkovModels.infer_current_stateFunction
infer_current_state(
    hmm::AbstractControlledHMM, obs_sequence, control_sequence, par; safe
)

Infer the posterior distribution of the current state given obs_sequence for hmm with controls control_sequence and parameters par.

If safe = true, everything is done in log scale.

ControlledHiddenMarkovModels.infer_current_stateFunction
infer_current_state(hmm::AbstractHMM, obs_sequence, par; safe)

Infer the posterior distribution of the current state given obs_sequence for hmm with parameters par.

If safe = true, everything is done in log scale.

ControlledHiddenMarkovModels.iszero_safeMethod
iszero_safe(x::R)

Check if a number x is zero by comparing its inverse with typemax(R).

This is useful in the following case:

julia> x = 1e-320
1.0e-320

julia> iszero(x)
false

julia> inv(x)
Inf
ControlledHiddenMarkovModels.update_obs_density!Method
update_obs_density!(obs_density, obs_sequence, hmm::AbstractHMM, par)

Update the values obs_density[s, t] using the emission density of hmm with parameters par applied to obs_sequence[t].

DensityInterface.logdensityofFunction
logdensityof(hmm::AbstractControlledHMM, obs_sequence, control_sequence, par; safe)

Compute the log likelihood of obs_sequence for hmm with controls control_sequence and parameters par.

If safe = true, everything is done in log scale.

DensityInterface.logdensityofFunction
logdensityof(hmm::AbstractHMM, obs_sequence, par; safe)

Compute the log likelihood of obs_sequence for hmm with parameters par.

If safe = true, everything is done in log scale.

Index