Learn R Programming

STAN (version 2.0.3)

getLogLik: Calculate log likelihood state distribution.

Description

The function calculates log likelihood for one or more observation sequence.

Usage

getLogLik(hmm, obs = list(), emissionProbs = list(), dirFlags = list(), verbose = FALSE, nCores = 1, sizeFactors=matrix(1, nrow=length(obs), ncol=ncol(obs[[1]])))#'

Arguments

hmm
The Hidden Markov Model.
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.
sizeFactors
Library size factors for Emissions PoissonLogNormal or NegativeBinomial as a length(obs) x ncol(obs[[1]]) matrix.

Value

The log likelihood of the observations sequences, given the model.

See Also

HMM

Examples

Run this code

data(example)
hmm_ex = initHMM(observations, nStates=3, method="Gaussian") 
hmm_fitted = fitHMM(observations, hmm_ex)
loglik = getLogLik(hmm_fitted, observations)
loglik

Run the code above in your browser using DataLab