Skip to main content
Log in

Stochastic approximation Monte Carlo importance sampling for approximating exact conditional probabilities

  • Published:
Statistics and Computing Aims and scope Submit manuscript

Abstract

Importance sampling and Markov chain Monte Carlo methods have been used in exact inference for contingency tables for a long time, however, their performances are not always very satisfactory. In this paper, we propose a stochastic approximation Monte Carlo importance sampling (SAMCIS) method for tackling this problem. SAMCIS is a combination of adaptive Markov chain Monte Carlo and importance sampling, which employs the stochastic approximation Monte Carlo algorithm (Liang et al., J. Am. Stat. Assoc., 102(477):305–320, 2007) to draw samples from an enlarged reference set with a known Markov basis. Compared to the existing importance sampling and Markov chain Monte Carlo methods, SAMCIS has a few advantages, such as fast convergence, ergodicity, and the ability to achieve a desired proportion of valid tables. The numerical results indicate that SAMCIS can outperform the existing importance sampling and Markov chain Monte Carlo methods: It can produce much more accurate estimates in much shorter CPU time than the existing methods, especially for the tables with high degrees of freedom.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4

Similar content being viewed by others

References

  • 4ti2 team: 4ti2—a software package for algebraic, geometric and combinatorial problems on linear spaces (2006). Available at www.4ti2.de

  • Agresti, A.: Categorical Data Analysis, 2nd edn. Wiley, New York (2002)

    Book  MATH  Google Scholar 

  • Andrieu, C., Moulines, a., Priouret, P.: Stability of stochastic approximation under verifiable conditions. SIAM J. Control Optim. 44, 283–312 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  • Atchadé, Y.F., Liu, J.S.: The Wang-Landau algorithm for Monte Carlo computation in general state spaces. Stat. Sin. 20, 209–233 (2010)

    MATH  Google Scholar 

  • Baglivo, J., Oliver, D., Pagano, M.: Methods for the analysis of contingency tables with large and small cell counts. J. Am. Stat. Assoc. 83, 1006–1013 (1988)

    Article  Google Scholar 

  • Berg, B.A., Neuhaus, T.: Multicanonical algorithms for first order phase transitions. Phys. Lett. B 267, 249–252 (1991)

    Article  Google Scholar 

  • Bezáková, I., Bhatnagar, N., Vigoda, E.: Sampling binary contingency tables with a greedy start. In: Proceedings of the 17th Annual ACM-SIAM Symposium on Discrete Algorithm (SODA) (2006)

    Google Scholar 

  • Bezáková, I., Sinclair, A., Stefankovic, D., Vigoda, E.: Negative examples for sequential importance sampling of binary contingency tables. In: Algorithms ESA 2006. Lecture Notes in Computer Science, vol. 4168, pp. 136–147. Springer, Berlin (2007)

    Chapter  Google Scholar 

  • Blanchet, J.H.: Efficient importance sampling for binary contingency tables. Ann. Appl. Probab. 19, 949–982 (2009)

    Article  MATH  MathSciNet  Google Scholar 

  • Booth, J.G., Butler, R.W.: An importance sampling algorithm for exact conditional test in log-linear models. Biometrika 86(2), 321–332 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  • Bornn, L., Jacob, P.E., Del Moral, P., Doucet, A.: An adaptive interacting Wang-Landau algorithm for automatic density exploration (2012). arXiv:1109.3829

  • Botev, Z.I., Kroese, D.P.: An efficient algorithm for rate-event probability estimation, combinatorial optimization, and counting. Methodol. Comput. Appl. Probab. 10, 471–505 (2008)

    Article  MathSciNet  Google Scholar 

  • Caffo, B.S., Booth, J.G.: A Markov chain Monte Carlo algorithm for approximating exact conditional probabilities. J. Comput. Graph. Stat. 10(4), 730–745 (2001)

    Article  MathSciNet  Google Scholar 

  • Chen, H.F.: Stochastic Approximation and Its Applications. Kluwer Academic, Dordrecht (2002)

    MATH  Google Scholar 

  • Chen, Y., Diaconis, P., Holmes, S.P., Liu, J.S.: Sequential Monte Carlo methods for statistical analysis of table. J. Am. Stat. Assoc. 100, 109–120 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  • Chen, Y., Dinwoodie, I.H., Sullivant, S.: Sequential importance sampling for multiway tables. Ann. Stat. 34, 523–545 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  • Chopin, N., Lelievre, T., Stoltz, G.: Free energy methods for Bayesian inference: efficient exploration of univariate Gaussian mixture posteriors. Stat. Comput. 22, 897–916 (2012)

    Article  MATH  MathSciNet  Google Scholar 

  • Christensen, R.: Log-liner Models and Logistic Regression, 2nd edn. Springer, New York (1997)

    Google Scholar 

  • Cox, D., Little, J., O’Shea, D.: Ideals, Varieties and Algorithms. Springer, New York (1992)

    Book  MATH  Google Scholar 

  • Dalenius, P., Reiss, R.S.: Data-swapping: a technique for disclosure control. J. Stat. Plan. Inference 6, 73–85 (1982)

    Article  MATH  MathSciNet  Google Scholar 

  • Darve, E., Pohorille, A.: Calculating free energies using average force. J. Chem. Phys. 115, 9169–9183 (2001)

    Article  Google Scholar 

  • De Loera, J.A., Onn, S.: Markov basis of three-way tables are arbitrarily complicated. J. Symb. Comput. 41, 173–181 (2006)

    Article  MATH  Google Scholar 

  • Del Moral, P., Doucet, A., Jasra, A.: Sequential Monte Carlo samplers. J. R. Stat. Soc. B 68, 411–436 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  • Diaconis, P., Sturmfels, B.: Algebraic algorithms for sampling from conditional distributions. Ann. Stat. 26, 363–397 (1998)

    Article  MATH  MathSciNet  Google Scholar 

  • Dinwoodie, I.H., Chen, Y.: Sampling large tables with constraints. Stat. Sin. 21, 1591–1609 (2011)

    MATH  MathSciNet  Google Scholar 

  • Dobra, A.: Markov bases for decomposable graphical models. Bernoulli 9, 1093–1108 (2003)

    Article  MATH  MathSciNet  Google Scholar 

  • Faraway, J.J.: Extending the Linear Model with R. Chapman & Hall, London (2006)

    MATH  Google Scholar 

  • Fort, G., Jourdain, B., Kuhn, E., Lelièvre, T., Stoltz, G.: Convergence and efficiency of the Wang-Landau algorithm (2012). arXiv:1207.6880

  • Hastings, W.K.: Monte Carlo sampling methods using Markov chains and their applications. Biometrika 57, 97–109 (1970)

    Article  MATH  Google Scholar 

  • Hout, M., Duncan, O.D., Sobel, M.E.: In: Association and Heterogeneity: Structural Models of Similarities and Differences (1987)

    Google Scholar 

  • Jacob, P.E., Ryder, R.J.: The Wang-Landau algorithm reaches the Flat Histogram criterion in finite time (2011). arXiv:1110.4025

  • Jerrum, M.R., Sinclair, A., Vigoda, E.: A polynomial-time approximation algorithm for the permanent of a matrix with non-negative entries. J. Assoc. Comput. Mach. 51, 671–697 (2004)

    Article  MATH  MathSciNet  Google Scholar 

  • Kuroda, M., Hashiguchi, H., Nakagawa, S.: Computing p-values in conditional independence models for a contingency table. Comput. Stat. 25, 57–70 (2010)

    Article  MATH  MathSciNet  Google Scholar 

  • Lauritzen, S.L.: Graphical Models. Clarendon Press, Oxford (1996)

    Google Scholar 

  • Liang, F.: Dynamically weighted importance sampling in Monte Carlo computation. J. Am. Stat. Assoc. 97, 807–821 (2002)

    Article  MATH  Google Scholar 

  • Liang, F.: Annealing contour Monte Carlo for structure optimization in an off-lattice protein model. J. Chem. Phys. 120, 6756–6763 (2004)

    Article  Google Scholar 

  • Liang, F.: A generalized Wang-Landau algorithm for Monte Carlo Computation. J. Am. Stat. Assoc. 100, 1311–1327 (2005)

    Article  MATH  Google Scholar 

  • Liang, F.: A theory on flat histogram Monte Carlo methods. J. Stat. Phys. 122, 511–529 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  • Liang, F.: On the use of stochastic approximation Monte Carlo for Monte Carlo integration. Stat. Probab. Lett. 79, 581–587 (2009a)

    Article  MATH  Google Scholar 

  • Liang, F.: Improving stochastic approximation Monte Carlo by kernel smoothing: theory and applications. Ann. Stat. 37, 2626–2654 (2009b)

    Article  MATH  Google Scholar 

  • Liang, F.: Trajectory averaging for stochastic approximation MCMC algorithms. Ann. Stat. 38, 2823–2856 (2010)

    Article  MATH  Google Scholar 

  • Liang, F., Liu, C., Carroll, R.: Stochastic approximation in Monte Carlo computation. J. Am. Stat. Assoc. 102(477), 305–320 (2007)

    Article  MATH  MathSciNet  Google Scholar 

  • Long, M.A., Berry, K.J., Mielke, P.W.: Multiway contingency tables: Monte Carlo resampling probability values for the chi-squared and likelihood-ratio tests. Psychol. Rep. 107, 501–510 (2010)

    Article  Google Scholar 

  • Marsili, S., Barducci, A., Chelli, R., Procacci, P., Schettino, V.: Self-healing umbrella sampling: a non-equilibrium approach for quantitative free energy calculations. J. Phys. Chem. B 110, 14011–14013 (2006)

    Article  Google Scholar 

  • Mehta, C., Patel, N.: A network algorithm for the exact treatment of the 2×K contingency table. Commun. Stat. 9, 649–664 (1980)

    Article  MathSciNet  Google Scholar 

  • Mehta, C., Patel, N., Senchauduri, P.: Importance sampling for estimating exact probabilities in permutational inference. J. Am. Stat. Assoc. 83, 999–1005 (1988)

    Article  Google Scholar 

  • Metropolis, N., Rosenbluth, A.W., Rosenbluth, M.N., Teller, A.H., Teller, E.: Equations of state calculations by fast computing machines. J. Chem. Phys. 21, 1087–1091 (1953)

    Article  Google Scholar 

  • Robbins, H., Monro, S.: A stochastic approximation method. Ann. Math. Stat. 22, 400–407 (1951)

    Article  MATH  MathSciNet  Google Scholar 

  • Roberts, G.O., Tweedie, R.L.: Geometric convergence and central limit theorems for multidimensional Hastings and Metropolis algorithms. Biometrika 83, 95–110 (1996)

    Article  MATH  MathSciNet  Google Scholar 

  • Rubinstein, R.Y., Kroese, D.P.: Simulation and the Monte Carlo Method, 2nd edn. Wiley, New York (2007)

    Book  Google Scholar 

  • Song, Q., Wu, M., Liang, F.: Weak convergence rate of population stochastic approximation MCMC algorithm. J. Appl. Probab. (2011, under review)

  • Wang, F., Landau, D.P.: Efficient, multiple-range random walk algorithm to calculate density of states. Phys. Rev. Lett. 86, 2050–2053 (2001)

    Article  Google Scholar 

  • Whittaker, J.: Graphical Models in Applied Mathematical Statistics. Wiley, New York (1990)

    Google Scholar 

  • Wu, M., Liang, F.: Population SAMC vs SAMC: convergence and applications to Bayesian model selection problems. J. Biom. Biostat. S1, 002 (2011)

    Google Scholar 

Download references

Acknowledgements

The authors thank the editor, associate editor and two referees for their constructive comments which have led to significant improvement of this paper. Cheon’s research was partially supported by Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education, Science and Technology (2011-0015000). Liang’s research was partially supported by grants from the National Science Foundation (DMS-1007457 and DMS-1106494) and the award (KUS-C1-016-04) made by King Abdullah University of Science and Technology (KAUST). Chen’s research was partly supported by the National Science Foundation grant DMS-1106796.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Faming Liang.

Appendices

Appendix A: Markov basis

Let M denote a Poisson log-linear model, as described in Sect. 2, for a contingency table. Let T(M) denote the set of all contingency tables having the marginal totals of the sufficient statistics of model M. Let δ denote a data swapping move (Dalenius and Reiss 1982) of M, in which cell entries are moved from one cell to the other while the marginals of the sufficient statistics of M are left unchanged.

Definition A.1

A Markov basis \(\mathcal{M}\) of the model M is a finite collection of data swapping moves that connect any two tables in T(M). In other words, for any two tables x,yT(M), there exists a sequence of data swapping moves \(\boldsymbol{\delta }_{1}, \ldots, \boldsymbol{\delta}_{s} \in\mathcal{M}\) such that

$$\boldsymbol{y}-\boldsymbol{x}=\sum_{k=1}^s \boldsymbol{\delta}_k, \quad\mbox{and} \quad\boldsymbol{x}+\sum _{k=1}^{s'} \boldsymbol { \delta}_k \in T(M), $$

for 1≤s′≤s.

The Markov basis can be computed by finding a Gröbner basis of a well-specified polynomial ideal, which has been implemented in the package 4ti2 (4ti2 team 2006). Although a Markov basis always exists, computing the Markov basis can be very time-consuming or even practically impossible for certain types of models. For example, De Loera and Onn (2006) showed that for the three-way contingency tables with fixed two margins, the Markov basis can contain entries of arbitrarily large size.

Appendix B: Contingency tables of examples

Table 6 Data for the sexual fun study example (source: Hout et al. 1987)
Table 7 Data for the health care study example (source: Long et al. 2010). Notation: A=Level of care with 1 = independent, 2 = assisted living, and 3 = continuous care; B = religious preference with 1 = Protestant, 2 = Catholic, 3 = Jewish, and 4 = Other; and C = marital status with 1 = single, 2 = married, 3 = widowed, 4 = divorced, and 5 = separated
Table 8 Data for the abortion opinion study example (source: Christensen 1997)
Table 9 Whittaker’s survey data on women’s economic activity (source: Whittaker 1990)

Rights and permissions

Reprints and permissions

About this article

Cite this article

Cheon, S., Liang, F., Chen, Y. et al. Stochastic approximation Monte Carlo importance sampling for approximating exact conditional probabilities. Stat Comput 24, 505–520 (2014). https://doi.org/10.1007/s11222-013-9384-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11222-013-9384-6

Keywords

Navigation