getAvgSignal {STAN} | R Documentation

## 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

    data(yeastTF_databychrom_ex)
    dStates = 6
    dirobs = as.integer(c(rep(0,10), 1, 1))
    bdhmm_gauss = initBdHMM(yeastTF_databychrom_ex, dStates = dStates, method = "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)

[Package STAN version 2.22.0 Index]