mlpy.stats.dbn.hmm.HMM.sample

HMM.sample(length, size=1)[source]

Generates random samples from the model.

Parameters:

length : int or ndarray[int]

Length of a sample

size : int, optional

Number of samples to generate. Default is 1.

Returns:

obs : array_like, shape (n, ni, nfeatures)

List of samples, where n is the number of samples, ni is the length of the i-th sample, and each observation has nfeatures.

hidden_states : array_like, shape (n, ni)

List of hidden states, where n is the number of samples, ni is the i-th hidden state.