When L=1, calculate values for backward, forward variables, probabilities of hidden states. A supporting function called by em.hmm.

1 | ```
bwfw1.hmm(x, pii, A, f0, f1)
``` |

`x` |
the observed Z values |

`pii` |
(prob. of being 0, prob. of being 1), the initial state distribution |

`A` |
A=(a00 a01\\a10 a11), transition matrix |

`f0` |
(mu, sigma), the parameters for null distribution |

`f1` |
(mu[1], sigma[1]\\...\\mu[L], sigma[L])–an L by 2 matrix, the parameter set for the non-null distribution |

calculates values for backward, forward variables, probabilities of hidden states,

–the lfdr variables and etc.

–using the forward-backward procedure (Rabiner 89)

–based on a sequence of observations for a given hidden markov model M=(pii, A, f)

–see Sun and Cai (2009) for a detailed instruction on the coding of this algorithm

`alpha` |
rescaled backward variables |

`beta` |
rescaled forward variables |

`lfdr` |
lfdr variables |

`gamma` |
probabilities of hidden states |

`dgamma` |
rescaled transition variables |

`omega` |
rescaled weight variables |

Wei Z, Sun W, Wang K and Hakonarson H

Multiple Testing in Genome-Wide Association Studies via Hidden Markov Models, Bioinformatics, 2009

Large-scale multiple testing under dependence, Sun W and Cai T (2009), JRSSB, 71, 393-424

A Tutorial on Hidden Markov Models and Selected Applications in Speech Recognition, Rabiner L (1989), Procedings of the IEEE, 77, 257-286.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.