Accompanying code for the paper “An Expectation-Maximization Algorithm to Compute a Stochastic Factorization From Data”.
When a transition probability matrix is represented as the product of two stochastic matrices, swapping the factors of the multiplication yields another transition matrix that retains some fundamental characteristics of the original. Since the new matrix can be much smaller than its precursor, replacing the former for the latter can lead to significant savings in terms of computational effort. This strategy, dubbed the “stochastic-factorization trick,” can be used to compute the stationary distribution of a Markov chain, to determine the fundamental matrix of an absorbing chain, and to compute a decision policy via dynamic programming or reinforcement learning. In this paper we show that the stochastic-factorization trick can also provide benefits in terms of the number of samples needed to estimate a transition matrix. We introduce a probabilistic interpretation of a stochastic factorization and build on the resulting model to develop an algorithm to compute the factorization directly from data. If the transition matrix can be well approximated by a low-order stochastic factorization, estimating its factors instead of the original matrix reduces significantly the number of parameters to be estimated. Thus, when compared to estimating the transition matrix directly via maximum likelihood, the proposed method is able to compute approximations of roughly the same quality using less data. We illustrate the effectiveness of the proposed algorithm by using it to help a reinforcement learning agent learn how to play the game of blackjack.
Barreto, A. M., Beirigo, R. L., Pineau, J., & Precup, D. (2015, June). An expectation-maximization algorithm to compute a stochastic factorization from data. In Twenty-Fourth International Joint Conference on Artificial Intelligence.
The authors would like to thank Borja Pigem for helpful discussions regarding topics related to this work. Funding for this research was provided by Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq), grant 461739/2014-3, and by the NSERC Discovery Grant Program.