osl_dynamics.simulation.MixedHSMM#

class osl_dynamics.simulation.MixedHSMM(gamma_shape, gamma_scale, mixed_state_vectors, off_diagonal_trans_prob=None, full_trans_prob=None)#

HSMM where some of the states are mixtures of modes.

The HSMM (hsmm) has one state for each mode (active on its own) followed by one state for each mixture in mixed_state_vectors. The mode time course is the mixing vector of the active HSMM state.

Parameters:
gamma_shapefloat

Shape parameter for the Gamma distribution of state lifetimes.

gamma_scalefloat

Scale parameter for the Gamma distribution of state lifetimes.

mixed_state_vectorsnp.ndarray

Mixing vector of each mixed state, e.g. with 3 modes [[0.5, 0.5, 0], [0.1, 0, 0.9]]. Shape is (n_mixed_states, n_modes).

off_diagonal_trans_probnp.ndarray, optional

Transition probabilities for out of state transitions, shape (n_modes + n_mixed_states, n_modes + n_mixed_states).

full_trans_probnp.ndarray, optional

A transition probability matrix, the diagonal of which will be ignored.

mixed_state_vectors#
state_vectors#
hsmm#
off_diagonal_trans_prob = None#
generate_modes(n_samples)#

Generate a mode time course.

Parameters:
n_samplesint

Number of samples.

Returns:
mode_time_coursenp.ndarray

Mixing coefficients. Shape is (n_samples, n_modes).