Learn R Programming

STAN (version 1.4.0)

getPosterior: Calculate posterior state distribution.

Description

The function calculates posterior state probabilities for one or more observation sequence.

Usage

getPosterior(hmm, obs=list(), emissionProbs=list(), dirFlags=list(), verbose=FALSE, nCores=1)

Arguments

hmm
The initial Hidden Markov Model. This is a HMM.
obs
The observations. A list of one or more entries containing the observation matrix (numeric) for the samples (e.g. chromosomes).
emissionProbs
List of precalculated emission probabilities of emission function is of type 'null'.
dirFlags
The flag sequence is needed when a bdHMM is fitted on undirected data (e.g.) ChIP only. It is a list of character vectors indication for each position its knwon directionality. U allows all states. F allows undirected states and states in forward direction. R allows undirected states and states in reverse direction.
verbose
logical for printing algorithm status or not.
nCores
Number of cores to use for computations.

Value

A list containing for the observation sequences the posterior state (col) distribution at each position (row).

See Also

HMM

Examples

Run this code
data(example)
hmm_fitted = fitHMM(observations, hmm_ex)
posterior_hmm = getPosterior(hmm_fitted$hmm, observations)

Run the code above in your browser using DataLab