predict.hmma: Predict sequence of data on HMMA

Description Usage Arguments Details Value See Also

View source: R/predict.hmma.R

Description

predict.hmma is simply a wrapper function for the mhsmm predict.hmmspec function. It generates the predicted state sequence for dat data, given the model.

Usage

1
2
## S3 method for class 'hmma'
predict(object, data, method = "viterbi", ...)

Arguments

object

The HMMA

data

The data file

method

The prediction method (viterbi or smoothed, see details)

...

Futher arguments.

Details

From the mhsmm documentation: If method="viterbi", this technique applies the Viterbi algorithm for HMMs, producing the most likely sequence of states given the observed data. If method="smoothed", then the individually most likely (or smoothed) state sequence is produced, along with a matrix with the respective probabilities for each state. This function differs from predict.hmm in that it takes the output from hmmspec ie. this is useful when users already know their parameters and wish to make predictions.

Value

The return object contains the data, a vector 's' with the reconstructed state sequence, the vector N with the lengths of the sequences, a matrix p with the probabilities of the states (only with smoothed). For more details see predict.hmmspec.

The loglikelihood is returned as the $loglik component.

See Also

predict.hmmspec for more information.


hmma documentation built on July 2, 2020, 12:10 a.m.