Description Usage Arguments Details Value Author(s) References See Also Examples

Inherithance function from `nbh`

that receives a vector of integers and compute optimal HMM parameters via EM algorithm.

1 2 3 4 |

`x` |
A vector of integers, conceptaully representing the read counts within bins of chromosome. |

`K` |
Number of hidden states. |

`NBM_NIT_MAX` |
Maximum number of EM iterations (Default: 250) for the negative binomial mixture model (NBM) intialization step (See |

`NBM_TOL` |
Threshold as fraction of increase in likelihood (given the current NBM parameters) comparing with the likelihood from the last iteration. EM for the NBM stops when the improvement is below the threshold (Default: 0.01). |

`NBH_NIT_MAX` |
Maximum number of EM iterations (Default: 250) for the negative binomial hidden Markov model (NBH). |

`NBH_TOL` |
Threshold as fraction of increase in likelihood (given the current NBH parameters) comparing with the likelihood from the last iteration. EM for the NBH stops when the improvement is below the threshold (Default: 0.001). |

`runViterbi` |
Binary indicator. If TRUE, Viterbi algorithm will be applied to derive the maximum likelihood hidden state sequence using the optimized HMM paramters obtained from the EM (See |

`...` |
Extra arguments are ignored. |

The function consists of three major steps: (1) negarive binomail mixture model used to initialized HMM parameters; (2) optimization of HMM paramters using EM algorithm; (3) Viterbi maximum-liklihood estimation of hidden state sequence. Step (1) involves optimization of NBM parameters assuming the data points are independently sampled from a mixture of K NB distributions (See `nbh_init`

). Given the optimized paramters for K-NBM, step (2) drops the independence assumption by introducing the transition probibility between hidden variables, which is initlaized as the mixing proportions of NBM (See `nbh_init`

). Given the optimized HMM paramters, step (3) derives the maximum liklihood hidden state sequence using Viterbi algorithm. Step (3) is run only when runViterbi is TRUE.

A list containing:

`initAlpha` |
Initialized alpha of NBM from |

`initBeta` |
Initialized beta of NBM from |

`initTRANS` |
Initialized mixing proportion of NBM from |

`postprob` |
Posteriors of the K hidden states for each observed count derived from |

`alpha` |
Optimized alpha of the NB mixture components in the HMM using |

`TRANS` |
Optimized transition probability of the HMM using |

`viterbi_state` |
Sequence of discrete values representing the hidden states derived from the maxmium likelihood estimation using Viterbi algorithm (See |

Yue Li

Rabiner, L. R. (1989). A tutorial on hidden Markov models and selected applications in speech recognition (Vol. 77, pp. 257-286). Presented at the Proceedings of the IEEE. doi:10.1109/5.18626

Bishop, Christopher. Pattern recognition and machine learning. Number 605-631 in Information Science and Statisitcs. Springer Science, 2006.

Capp\'e, O. (2001). H2M : A set of MATLAB/OCTAVE functions for the EM estimation of mixtures and hidden Markov models. (http://perso.telecom-paristech.fr/cappe/h2m/)

`mainSeekSingleChrom, nbh, nbh.GRanges`

1 | ```
if(interactive()) ?nbh # see nbh for example of nbh running on integer object
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.