<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/a-well-hidden-e-step/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://xianblog.wordpress.com/2017/02/03/a-well-hidden-e-step/"> R – Xi'an's Og</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><a target="_blank" rel="nofollow" href="https://i0.wp.com/xianblog.files.wordpress.com/2012/12/img_3000.jpg?ssl=1"><img sizes="(max-width: 450px) 100vw, 450px" data-image-description="" data-orig-file="https://i0.wp.com/xianblog.files.wordpress.com/2012/12/img_3000.jpg?resize=450%2C338&amp;ssl=1" data-orig-size="2816,2112" data-image-title="Grand Palais from Esplanade des Invalides, Paris, Dec. 07, 2012" class="wp-image-18790" data-comments-opened="1" data-recalc-dims="1" data-attachment-id="18790" data-permalink="https://xianblog.wordpress.com/2012/12/08/paris-bottom-line-first-snowflakes/img_3000/" alt="Grand Palais from Esplanade des Invalides, Paris, Dec. 07, 2012" data-medium-file="https://i0.wp.com/xianblog.files.wordpress.com/2012/12/img_3000.jpg?resize=450%2C338&amp;ssl=1?w=300" data-large-file="https://i0.wp.com/xianblog.files.wordpress.com/2012/12/img_3000.jpg?resize=450%2C338&amp;ssl=1?w=450" data-image-meta="{&quot;aperture&quot;:&quot;4&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;Canon IXUS 115 HS&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1354875845&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;10.906&quot;,&quot;iso&quot;:&quot;100&quot;,&quot;shutter_speed&quot;:&quot;0.005&quot;,&quot;title&quot;:&quot;&quot;}" src="https://i0.wp.com/xianblog.files.wordpress.com/2012/12/img_3000.jpg?resize=450%2C338&ssl=1"></a><strong>A</strong> <a target="_blank" rel="nofollow" href="http://stats.stackexchange.com/q/257990/7224">recent question</a> on <a target="_blank" rel="nofollow" href="http://stats.stackexchange.com/q/257990/7224">X validated</a> ended up being quite interesting! The model under consideration is made of parallel Markov chains on a finite state space, all with the same Markov transition matrix, <strong>M</strong>, which turns into a hidden Markov model when the only summary available is the number of chains in a given state at a given time. When writing down the EM algorithm, the E step involves the expected number of moves from a given state to a given state at a given time. The conditional distribution of those numbers of chains is a product of multinomials across times and starting states, with no Markov structure since the number of chains starting from a given state is known at each instant. Except that those multinomials are constrained by the number of “arrivals” in each state at the next instant and that this makes the computation of the expectation intractable, as far as I can see.</p>
<p>A solution by Monte Carlo EM means running the moves for each instant under the above constraints, which is thus a sort of multinomial distribution with fixed margins, enjoying a closed-form expression but for the normalising constant. The direct simulation soon gets too costly as the number of states increases and I thus considered a basic Metropolis move, using one margin (row or column) or the other as proposal, with the correction taken on another margin. This is very basic but <a target="_blank" rel="nofollow" href="http://stats.stackexchange.com/a/258038/7224">apparently enough</a> for the purpose of the exercise. If I find time in the coming days, I will try to look at the ABC resolution of this problem, a logical move when starting from non-sufficient statistics!</p>
<p>Filed under: <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/category/books/">Books</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/category/kids/">Kids</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/category/pictures/">pictures</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/category/statistics/r-statistics/">R</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/category/statistics/">Statistics</a> Tagged: <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/abc/">ABC</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/cross-validated/">cross validated</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/em-algorithm/">EM algorithm</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/hidden-markov-models/">hidden Markov models</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/mcem/">MCEM</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/mcmc/">MCMC</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/monte-carlo-approximations/">Monte Carlo approximations</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/r/">R</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/simulation/">simulation</a>, <a target="_blank" rel="nofollow" href="https://xianblog.wordpress.com/tag/summary-statistics/">summary statistics</a> <a target="_blank" rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xianblog.wordpress.com/32596/"><img alt="" src="http://feeds.wordpress.com/1.0/comments/xianblog.wordpress.com/32596/" border="0"></a> <img alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" border="0" data-recalc-dims="1"></p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://xianblog.wordpress.com/2017/02/03/a-well-hidden-e-step/"> R – Xi'an's Og</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/UUcCX2nvX34"></a></div>