initBdHMM {STAN} | R Documentation

## Initialization of bidirectional hidden Markov models

### Description

Initialization of bidirectional hidden Markov models

### Usage

    initBdHMM(obs, dStates = 0, uStates = 0, method, dirFlags = NULL, directedObs = rep(0, ncol(obs[[1]])), sizeFactors = matrix(1, nrow = length(obs), ncol = ncol(obs[[1]])), sharedCov = FALSE)

### Arguments

`obs` | The observations. A list of one or more entries containing the observation matrix (`numeric`) for the samples (e.g. chromosomes).
`dStates` | The number of directed states.
`uStates` | The number of undirected states.
`method` | Emission distribution of the model. One out of c("NegativeBinomial", "PoissonLogNormal", "NegativeMultinomial", "ZINegativeBinomial", "Poisson", "Bernoulli", "Gaussian", "IndependentGaussian")
`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.
`directedObs` | Integer vector defining the directionality (or strand-specificity) of the data tracks. Undirected (non-strand-specific) data tracks (e.g. ChIP) are indicated by '0'. Directed (strand-specific) data tracks are indicated by increasing pairs of integers. For instance c(0,0,0,1,1,2,2): The first three data tracks are undirected, followed by two pairs of directed measurements.
`sizeFactors` | Library size factors for Emissions PoissonLogNormal or NegativeBinomial as a length(obs) x ncol(obs[[1]]) matrix.
`sharedCov` | If TRUE, (co-)variance of (Independent)Gaussian is shared over states. Only applicable to 'Gaussian' or 'IndependentGaussian' emissions. Default: FALSE.

### Value

A HMM object.

### Examples

    data(example)
    bdHMM_ex = initBdHMM(observations, dStates=3, method="Gaussian")

[Package STAN version 2.22.0 Index]