Learn R Programming

STAN (version 2.0.3)

getAvgSignal: Compute average signal in state segmentation

Description

Compute average signal in state segmentation

Usage

getAvgSignal(viterbi, obs, fct=mean)

Arguments

viterbi
A list containing the viterbi paths as factors. The output from getViterbi.
obs
The observations. A list of one or more entries containing the observation matrix (numeric) for the samples (e.g. chromosomes).
fct
The averaging function, default: mean.

Value

A state x data track matrix containing the average signal.

Examples

Run this code
data(yeastTF_databychrom_ex)
nStates = 6
dirobs = as.integer(c(rep(0,10), 1, 1))
bdhmm_gauss = initBdHMM(yeastTF_databychrom_ex, nStates, "Gaussian", directedObs=dirobs)
bdhmm_fitted_gauss = fitHMM(yeastTF_databychrom_ex, bdhmm_gauss)
viterbi_bdhmm_gauss = getViterbi(bdhmm_fitted_gauss, yeastTF_databychrom_ex)
avg_signal = getAvgSignal(viterbi_bdhmm_gauss, yeastTF_databychrom_ex)

Run the code above in your browser using DataLab