Abstract
Sampling from constrained distributions has posed significant challenges in terms of algorithmic design and non-asymptotic analysis, which are frequently encountered in statistical and machine-learning models. In this study, we propose three sampling algorithms based on Langevin Monte Carlo with the Metropolis–Hastings steps to handle the distribution constrained within some convex body. We present a rigorous analysis of the corresponding Markov chains and derive non-asymptotic upper bounds on the convergence rates of these algorithms in total variation distance. Our results demonstrate that the sampling algorithm, enhanced with the Metropolis–Hastings steps, offers an effective solution for tackling some constrained sampling problems. The numerical experiments are conducted to compare our methods with several competing algorithms without the Metropolis–Hastings steps, and the results further support our theoretical findings.
1. Introduction
Sampling from distributions with some constraints has extensive applications in statistics, machine-learning, and operations research, among other areas. Some distributions have bounded support, such as the simple but versatile uniform distribution which serves as the foundation for a series of Monte Carlo methods, as discussed in [1]. Furthermore, many statistical inference problems involve estimating parameters subject to constraints on the parameter space, which defines a posterior distribution with bounded support in a Bayesian setting. Examples include Latent Dirichlet Allocation [2], truncated data problems in failure and survival time studies [3], ordinal data models [4], constrained lasso and ridge regressions [5], and non-negative matrix factorization [6]. In Bayesian learning, sampling from posterior distributions is a fundamental primitive, used for exploring posterior distributions, identifying the unknown parameters [7,8], obtaining credible intervals, and solving inverse problems [7,8]. Finally, constrained sampling has great potential in solving constrained optimization problems [9,10].
Many Markov Chain Monte Carlo (MCMC) algorithms have been extensively studied for sampling from probability distributions with convex support or more generally with constrained parameters, mainly in the fields of Bayesian statistics and theoretical computer science. Early work includes, among others, [1,11,12,13,14]. Firstly, based on MCMC algorithms, a direct solution involves discarding samples that violate the constraints, thereby exclusively retaining samples that satisfy the constraints; see, for example, [1,15,16]. However, these rejection-type approaches may encounter an excessive number of rejections or an extremely large acceptance rate within some local subspace that satisfies the constraints, which leads to poor mixing and computational inefficiency, especially for complicated constraints and the high dimensional distributions [17,18]. Secondly, some literature draws inspiration from penalty functions in optimization problems and considers the construction of barriers along the boundaries of the constrained domain, effectively constraining the sampling process within the constrained area. These approaches encounter a major challenge when the samples reach the boundaries of the constraints, necessitating the implementation of a mechanism based on reflection to redirect them back into the constrained region. To address this issue, Ref. [19] extended the Hamiltonian Monte Carlo (HMC) method by setting the potential energy outside the constraint region to infinity, restricting the states to the desired domain. Ref. [20] extended the HMC method to sample from truncated multivariate Gaussian distributions, and Ref. [21] proposed an approach that involves mapping the constrained domain onto a sphere in an augmented space. Thirdly, motivated by the constrained optimization methods, the constrained sampling problem can be reformulated as an unconstrained sampling problem via suitable transformations. Following this idea, Ref. [22] proposed a family of novel algorithms based on HMC through the introduction of Lagrange multipliers that address a broader range of constrained sampling problems. More recently, Ref. [23] tackled the constrained sampling problem via the mirror-Langevin algorithm. In spite of the widespread adoption of these MCMC methods, most of them have primarily focused on the algorithm design and lack the rigorous theoretical analysis of convergence rates.
Among all the MCMC algorithms, a class of algorithms based on the Langevin dynamics has garnered significant attention in both practical applications and theoretical analyses [24,25,26,27]. It has recently witnessed a notable increase in non-asymptotic analyses of these algorithms, initiated by the seminal work of [28]. In the setting of unconstrained sampling, Ref. [29] extended the theoretical analysis of convergence rates by studying with decreasing step size, and Refs. [30,31] derived corresponding convergence results based on alternative distances. These theoretical analyses focus on the Langevin algorithm without the Metropolis–Hastings step. More recently, Refs. [32,33] have shown that incorporating the Metropolis–Hastings step can significantly improve the convergence rate of the associated Langevin algorithm. In the setting of constrained sampling, Ref. [34] suggested a Euclidean projection step in the Langevin algorithms for the constrained case (PLMC) and derived the convergence rate of the associated Markov chain. Ref. [35] presented a detailed theoretical analysis for a proximal version of the Langevin algorithm that incorporates the Moreau-Yosida envelope of the indicator function (MYULA) to handle the distributions that are restricted to a convex body. Ref. [36] constructed the mirrored Langevin algorithm (MLD) using a mirror map to constrain the domain, which achieves the same convergence rate as its unconstrained counterpart [28]. However, these constrained sampling algorithms are all developed based on the Langevin algorithm without incorporating the Metropolis–Hastings steps, thus not leveraging the fast mixing advantages of them.
In this paper, we considered the constrained Langevin Monte Carlo with the Metropolis–Hastings step for sampling from the distributions restricted to some convex support. Firstly, for certain constraints, we re-examine the simple and intuitive rejection-type methods for sampling from constrained distributions, and reach a surprising discovery that the corresponding algorithm still retained the advantage of rapid convergence by carefully selecting the step size parameter. Subsequently, for the more generally constrained domain, we build upon the framework proposed in [35], incorporating the Metropolis–Hastings step for further refinement, and analyze the convergence rate of the corresponding Markov chain. We present detailed non-asymptotic analysis for these constrained algorithms and achieve notably enhanced convergence rates in the total variation distance. Compared with the best rate in [36], our results show that adopting the Metropolis–Hastings step in some constrained MCMC algorithms can also lead to an exponentially improved dependence on the error tolerance.
The rest of the paper is organized as follows. In Section 2, we introduce the preliminaries and the problem set-up of our study. Then, we propose the constrained sampling algorithms tailored to different types of constraint regions in Section 3. Section 4 provides the non-asymptotic theoretical results of the proposed algorithms. The numerical experiments and comparisons are presented in Section 5. Some Markov chain basics are provided in Appendix A and all the technical proofs are deferred to Appendix B.
Notation: Let represent the smallest integer not less than . For a vector , we use to denote its Euclidean norm. For a symmetric matrix A, denote by and the smallest and largest eigenvalues of A, respectively, and let be its transpose. For two square matrices A and B, we write if is a positive semi-definite matrix. Denote by the indicator function. For , let denote a closed Euclidean ball with center x and radius r. For two real-valued sequences and , we say if there exists a universal constant c such that , and if where the sequence grows at most poly-logarithmically with n. For any two probability measures and , denote by the total variation distance between and .
2. Preliminaries and Problem Set-Up
In this section, we introduce the MCMC sampling methods with its mixing analysis, the traditional unconstrained Metropolis-Adjusted Langevin Algorithm (MALA), and our problem set-up for this paper.
2.1. Markov Chain Monte Carlo and Mixing
Consider a distribution equipped with a density such that
for some potential function . In certain scenarios, it is necessary to perform sampling from this distribution. For example, many statistical applications involve estimating the expectation of a function for , where analytical and numerical computation is infeasible. Monte Carlo approximation provides a solution by generating samples from and using sample mean to estimate the population expectation. Hence, the key point is to access samples from .
MCMC represents a class of popular sampling algorithms, which construct an appropriate Markov chain whose stationary distribution is or close to in certain metrics. The class of the Metropolis–Hastings algorithms refers to a type of MCMC method that ensures the corresponding Markov chain converges to the target distribution by incorporating the Metropolis–Hastings step. The Metropolis–Hastings algorithms usually take two steps to generate a Markov chain: a proposal step and a reject-accept step. At each iteration, a sample is generated from the proposal distribution in the proposal step, and it is updated as a new state of the Markov chain with probability determined by the Metropolis–Hastings correction in the reject-accept step.
Given an error tolerance , in order to obtain an -accurate sample with respect to some metric, one simulates the Markov chain for a certain number of steps k, as determined by a mixing time analysis. Specifically, we are concerned about how many steps the chain needs to take such that the current distribution of the chain is -close to the target distribution . Based on this, we define the -mixing time with respect to the target distribution as
for the error tolerance , where is the transition operator of the Markov chain and is the distribution of the Markov chain at k-th step from an initial distribution .
2.2. Metropolis-Adjusted Langevin Algorithm
Consider the problem of sampling from the distribution with density defined as (1). MALA [26,27] adopts the Gaussian distribution as the proposal distribution for the k-th step, where is the current state and is a proper step size, and performs a Metropolis–Hastings accept-reject step. MALA is the standard Metropolis–Hastings algorithm applied to the Langevin dynamics, and the associated Langevin-type algorithms belong to a family of gradient-based MCMC sampling algorithms [37]. The Langevin-type algorithms can be understood as the Euler discretization of the Langevin dynamics:
where is the standard Brownian motion on .
Algorithm 1 provides the unconstrained MALA for sampling from the distribution supported on , where denotes the probability density function of .
| Algorithm 1 Metropolis-adjusted Langevin algorithm |
Input: a sample from an initial distribution , the step size h
Output:
|
2.3. Problem Set-Up
In this part, we consider the problem of sampling from a target distribution or posterior supported on a compact set equipped with a density . It can be written in the form
for some potential function . Assume that the function and the set satisfy the following assumptions:
Assumption 1.
is a twice continuously differentiable, L-smooth and m-strongly convex function on . That is, there exist universal constants such that
for any .
Assumption 2.
is a compact and convex set satisfying
for some universal constants and .
Hereafter, we assume that the above two assumptions hold, which is frequently used in the literature for the analysis of constrained sampling algorithms [34,35,36]. We will modify the MALA in Algorithm 1 to adapt to sampling from the above constrained distribution, and analyse its non-asymptotic theoretical properties and derive the mixing time bound in terms of the problem dimension d and the error tolerance .
3. The Constrained Langevin Algorithms
In this section, we present three sampling algorithms based on MALA to handle the distribution constrained within some convex body . As discussed in [34], the inherent challenges in constrained sampling problems arise from the complex properties on the boundary of the constraint region, and the lack of the curvature in the potential function. To tackle these challenges, Ref. [34] initially studied constrained sampling from the uniform distribution on , and then extended the exploration to more general distributions. Similarly, we begin our investigation by examining some simple constrained regions and progressively extend our analysis to more complex constraint scenarios.
3.1. Constrained Langevin Algorithm via Rejection
We initially discuss the case where the constraint region is an Euclidean ball on , where the boundary can be characterized by a curve equation. If for some universal constant and , we consider the simple and intuitive rejection-type methods via the Metropolis–Hastings accept-reject step for sampling from the distribution with density defined as (3). The constrained MALA for outlined in Algorithm 2 as follows, where denotes the probability density function of the Gaussian distribution .
| Algorithm 2 The MALA for Euclidean ball constrained domain |
Input: a sample from an initial distribution , the step size h
Output:
|
Compared with Algorithm 1, this modified algorithm forces the Markov chain to stay at the current state when it jumps out of the limited state space , which is a quite natural extension of the unconstrained MALA. This idea is not completely novel. Ref. [34] suggested a projection step in unadjusted Langevin algorithm for sampling from a log-concave distribution with compact support. Ref. [10] proposed an MALA for constrained optimization, where they used a similar step to constrain the Markov chain to stay at a given state space. Due to the favorable properties on the boundary of constrained domain , we can establish the theoretical results of Algorithm 2; see Lemma A1 in Appendix B for details.
3.2. Norm-Constrained Domain
Regularization is a technique commonly used in machine-learning and statistical modeling. As discussed in [38], some models with regularization can be reformulated as the distributions with norm-constraint on the parameters. Notice that the -norm for the vector is defined as
For the norm-constrained domain with some universal constant , we can transform it into the Euclidean ball via a vector-valued function . Specifically, for any , we have with
such that . Due to the bijective nature of the function , its inverse function can be defined accordingly. Similarly, for any , we have with
such that . By utilizing the vector-valued functions and defined above, we can employ the Euclidean ball constrained sampling algorithm, as described in Section 3.1, to tackle the norm-constrained domain . The computational process is outlined in Algorithm 3, where
with the potential function .
| Algorithm 3 The MALA for norm-constrained domain |
Input: a sample from an initial distribution , the step size h
Output:
|
Compared with Algorithm 2, the Algorithm 3 achieves the transformation by incorporating two transformation steps, thereby addressing the norm-constrained sampling problems. The main purpose of this approach is to facilitate theoretical analysis by leveraging the well-understood properties of the boundary of the Euclidean ball compared to the boundary of the norm-constrained domain; see Appendix B.7 for details.
3.3. Constrained Langevin Algorithm via an Approximation of the Indicator Function
We proceed to discuss the constrained sampling for more general constraint regions. Given , define
for any . Then, the target distribution with density defined as (3) can be reformulated as
with the potential function satisfying
where is defined in (4). Notice that is a convex function on . Under Assumption 1, we then know that the potential function is smooth and strongly convex on . By this transformation, the problem of constrained sampling is apparently converted into an unconstrained counterpart. However, the non-differentiability of the function on the boundary of poses a challenge when applying the gradient-based unconstrained sampling algorithms. To address this issue, we can approximate the function by a differentiable function such as the Moreau-Yosida (MY) envelope [35]. The MY envelope of is defined as
for any , where is a regularization parameter and is the projection function onto . By [35], the function is convex and continuously differentiable with the gradient
for any , and it holds that
for any . Then the approximation of defined as (6) can be given by
which is continuously differentiable, smooth and strongly convex on if satisfying Assumption 1. Define the distribution with density
Recall that the target distribution with the reformulated density defined as (5). As discussed in [35], under some mild conditions including Assumptions 1 and 2, the approximation error between and in total variation distance can be made arbitrarily small by adjusting the regularization parameter . Therefore, we can utilize the gradient-based unconstrained sampling algorithms, such as the MALA presented in Algorithm 1, for constructing an appropriate Markov chain whose stationary distribution is close to ; see Algorithm 4 for details, where denotes probability density function of the Gaussian distribution with defined as (8).
| Algorithm 4 The MALA for convex constrained domain |
Input: a sample from an initial distribution , the step size h
Output:
|
4. Theoretical Results
In this section, we first analyze the properties of the Markov chains determined by the three constrained sampling algorithms presented in Section 3, and then establish the mixing time bounds of these Markov chains.
4.1. Properties of the Markov Chains
The outcomes from each algorithm presented in Section 3 form a Markov chain, whose properties are established in Propositions 1, 2, and 3, respectively, as below.
Proposition 1.
For with some universal constant and , the Markov chain determined by Algorithm 2 is -irreducible, smooth, and reversible with respect to the stationary distribution with density defined as (3) (The definition of the -irreducible, reversible, and smooth Markov chain is deferred to Appendix A).
Remark 1.
Proposition 1 shows that the Markov chain determined by Algorithm 2 enjoys a series of nice properties as the unconstrained MALA, which form the basis for the study of the mixing time bounds of such Markov chain.
The similar properties hold for the Markov chains determined by Algorithms 3 and 4 as well.
Proposition 2.
For with some universal constant , the Markov chain determined by Algorithm 3 is -irreducible, smooth, and reversible with respect to the stationary distribution with density defined as (3).
Proposition 3.
Under Assumption 2, the Markov chain determined by Algorithm 4 is -irreducible, smooth, and reversible with respect to the distribution with density defined as (11).
4.2. Mixing Time Bounds of the Markov Chains
For a distribution supported on with the density , recall that the -mixing time with respect to is defined as (2). A -warm initial distribution with density with respect to the distribution is commonly used for the mixing time analysis, which satisfies
for some finite constant . We say that the Markov chain is -lazy if at each iteration the chain is forced to stay at the previous state with probability at least . It is a convenient assumption for theoretical analysis of the convergence rate, but not likely to be used in practice since the lazy steps slow down the mixing rate of Markov chain. Given the definitions above and some Markov chain basics in Appendix A, we can obtain the following results for some well-behaved Markov chains defined on .
Lemma 1.
Remark 2.
Lemma 1 provides a control on the mixing time of a Markov chain on in terms of . This result can be seen as an extension of Lemma 3 in [33] to the case where a Markov chain defined on . We then can readily derive the mixing time bound if a lower bound for is known.
The following lemma gives a lower bound for .
Lemma 2.
Assume that the distribution Π supported on with the density π satisfy the log-isoperimetry inequality defined as (A1) for some constant . If a reversible Markov chain with stationary distribution Π satisfies for some and , it then holds that
for any , where is the one-step transition distribution of this Markov chain at and is the conductance profile of this Markov chain defined in (A3).
Remark 3.
Lemma 2 states a lower bound for the conductance profile of a Markov chain on . Similar results can be found in the [33,39,40]. Lemma 2, together with Lemma 1, provides a general framework for obtaining mixing time bound of a well-behaved Markov chain on .
Based on Lemmas 1 and 2, we can drive the upper bounds for each -mixing time of the Markov chains determined by the three constrained sampling algorithms presented in Section 3.
Theorem 1.
For with some universal constant and , let Assumption 1 hold with and . Given a β-warm initial distribution and an error tolerance , the Markov chain determined by Algorithm 2 satisfies
for any step size h satisfying
with and some constant , where with density defined as (3).
Remark 4.
Theorem 1 presents a sharp mixing time bound for Algorithm 2 with a -warm initial distribution as up to β and L, m, R which are specified in Assumptions 1 and 2. This result improves upon the previously known mixing time bounds for constrained sampling algorithms in [34,35,36]; see Table 1 for details.
Table 1.
Convergence rates for sampling from log-concave distributions with bounded support.
For sampling from the norm-constrained domain with some universal constant , we transform it into the sampling from Euclidean ball as shown in Algorithm 3; then, the similar result holds for the Markov chain determined by Algorithm 3 as well.
Corollary 1.
For with some universal constant , let Assumption 1 hold with and . Given a β-warm initial distribution and an error tolerance , the Markov chain determined by Algorithm 3 satisfies
for any step size h satisfying
with and some constant , where with density defined as (3).
For the Markov chain determined by Algorithm 4, we can also derive a sharp mixing time bound by the mixing time analysis for sampling from log-concave distribution without constraints in [33] and the approximation error between and in [35].
Theorem 2.
Let Assumptions 1 and 2 hold, and assume that there exists a universal constant such that . Given the initial distribution with and an error tolerance , the Markov chain determined by Algorithm 4 satisfies
for the step size h satisfying
with some universal constant , where is defined as in (10) with , and with density defined as (3).
Remark 5.
Theorem 2 presents a mixing time bound for Algorithm 4 with a feasible initial distribution as up to L, m, r which are specified in Assumptions 1 and 2 if we choose the regularization parameter . This result improves upon the mixing time bound for constrained sampling algorithm without incorporating the Metropolis–Hastings step in [35]; see Table 1 for details.
5. Numerical Experiments
In this section, we conduct numerical experiments to validate the theoretical properties derived in Section 4 and compare the constrained sampling algorithms presented in Section 3 with three competing MCMC algorithms for sampling from constrained log-concave distributions listed in Table 1 under various simulation settings. The implementation of these algorithms involves the selection of a step size. For Algorithms 2 and 3, we follow Theorem 1 and Corollary 3, respectively, to select the step size. For Algorithm 4, we choose the step size as that in [32] for the MALA for sampling from log-concave distribution without constraints. The step size choice of the other three MCMC algorithms follows the recommendation in the associated papers; see Table 2 for details.
Table 2.
Step sizes for sampling from log-concave distributions with bounded support.
5.1. Sampling from the Euclidean Ball Constrained Domain
We consider the problem of sampling from a truncated multivariate Gaussian distribution on , which admits the density
where the mean and covariance matrix is a diagonal matrix with and . For this target distribution, the potential function and its derivatives are given as , , and . Therefore, the function is smooth with parameter and strongly convex with parameter on . We select with , the initial distribution , and use the inverse transformation algorithm [14] to generate an initial point from . We compare Algorithm 2 with the three sampling algorithms in literature given in Table 2, and follow the recommendation in the associated papers to choose the initial points of the three sampling algorithms.
5.1.1. The Trace Graphs of Sampling Algorithms
To initiate a preliminary assessment of the convergence properties of these algorithms, we commence with simple sample trace plots. Write and . Figure 1 depicts the traces of of the Markov chains determined by the four sampling algorithms under dimension . Evidently, in comparison to the other three algorithms, Algorithm 2 exhibits a notably faster mixing time, as evidenced by the trace consistently remaining around its mean . Conversely, the traces of the other three sampling algorithms exhibit greater fluctuations and deviate more from .
Figure 1.
The trace graphs of of the Markov chain determined by the four sampling algorithms.
Figure 2 illustrates the histograms and densities corresponding to these traces of . Similarly, it is evident that Algorithm 2 achieves sample means closer to , along with the least variance. Conversely, the sample means obtained from the other three sampling algorithms exhibit a certain degree of deviation from , accompanied by heavier tails.
Figure 2.
The densities of of the Markov chain determined by the four sampling algorithms.
5.1.2. Dimension and Error Dependence of Algorithm 2
The goal of this simulation is to demonstrate that the dimension and error tolerance dependence of the mixing time bound for Algorithm 2 both conform to the theoretical results shown in Theorem 1.
Since the total variation distance between continuous measures is hard to estimate, we use the error in quantiles along some direction for convergence diagnostics in the experiments. In the spirit of [33], we measure the error in the quantile of the sample distribution and the true distribution in the direction along the eigenvector of corresponding to . The approximate mixing time is then defined as the smallest iteration k when such error between the distribution of the Markov chain at iteration k and the target distribution falls below the error tolerance . We simulate 20 independent runs of the Markov chain of the algorithms with N = 20,000 samples at each run to determine the approximate mixing time . Then the final is the average of these 20 independent runs.
Figure 3a shows the dependence of the approximate mixing time as a function of dimension d for Algorithm 2. By the linear regression for with respect to d, we conclude that the mixing time of Algorithm 2 is linear in d with slope and R-squared . Figure 3b presents the dependence of the approximate mixing time on the inverse of the error tolerance for Algorithm 2 under . The linear regression for the approximate mixing time with respect to suggests that the mixing time of Algorithm 2 is linear in with slope and R-squared , which is consistent with the theoretical results given in Theorem 1.
Figure 3.
Approximate mixing time with respect to dimension and error tolerance of Algorithm 2. (a) Dimension dependence for fixed error tolerance. (b) Error tolerance dependence for fixed dimension.
5.1.3. Comparison with Competitive Algorithms
Figure 4a shows the dependence of the approximate mixing time on the problem dimension d for the four sampling algorithms. Compared with the other three algorithms, the approximate mixing time of Algorithm 2 seems more robust to dimension. When d is small, the approximate mixing time of the four algorithms is comparatively close. However, as the dimension d increases, the approximate mixing time of PLMC and MYULA increases rapidly, showing a polynomial order with respect to d. Moreover, the dimension dependence of MLD and Algorithm 2 both indicate a linear growth trend, and MLD needs a few more steps than Algorithm 2 to reach the same error tolerance.
Figure 4.
Approximate mixing time with respect to dimension and error tolerance dependence of the four sampling algorithms. (a) Dimension dependence for fixed error tolerance. (b) Error tolerance dependence for fixed dimension.
Figure 4b presents the dependence of the approximate mixing time on the inverse of the error tolerance for the four sampling algorithms under . The regression analysis shows that the approximate mixing time of PLMC and MYULA increases in polynomial order of . When is relatively small, MLD and Algorithm 2 have similar approximate mixing time. With the increase in , the strength of Algorithm 2 gets more significant. For MLD, the linear regression for the approximate mixing time with respect to yields a slope of and R-squared , suggesting the error tolerance dependence of order .
It is noteworthy that the above analysis not only suggests significantly better dimension and error tolerance dependence of the constrained MALA but also partly verifies the theoretical convergence rates of the three methods for comparison.
5.2. Bayesian Regularized Regression
The regularized regression involves adding a penalty term on the objective function of the regression model, which helps to control the complexity of the model and prevent it from fitting the noise in the data. In this section, we validate the effectiveness of Algorithm 3 for constrained sampling involving the Bayesian regularized regression.
Given the independent and identically observations which follow from the Gaussian distribution with mean and covariance matrix , we consider the regression models where the parameter are obtain by minimizing the square of Euclidean norm of the residual subject to a norm-constraint on the regression parameter as follows:
for some universal constant , where is the design matrix, is the regression parameter, and is the -norm of . In Bayesian setting, many regularization techniques correspond to imposing certain prior distributions on model parameters. We then consider sampling from the distribution with density
and obtaining the parameter estimates via the maximum a posteriori probability (MAP) estimate, where . We use the diabetes data studied in [41], and set the burn-in period to be iterations and . Figure 5 presents the paths of the parameter estimates under different norm constraints, which demonstrate that Algorithm 3 can effectively handle the norm-constrained sampling problems.
Figure 5.
Bayesian regularized regression via Algorithm 3, where distinct colors represent various trajectories of parameter estimates for distinct variables. (a) —norm-constraint. (b) —norm-constraint. (c) —norm-constraint.
5.3. Truncated Multivariate Gaussian Distribution
The final comparison was made by examining the sampling performance of MYULA in [35] and Algorithm 4 in the setting of a more general truncated multivariate Gaussian distribution. We consider the same setup as in [35]. Specifically, the density of the target distribution is defined as follows:
where is a convex set and the origin 0 is on its boundary. Let , the covariance matrix with -th element given by , and . We generate samples for Algorithm 4, and set the burn-in period to be the initial iterations.
Table 3 presents the mean and covariance estimation results of the target distribution based on the samples generated by MYULA and Algorithm 4. For comparison purposes, the results of MYULA align with those reported in [35]. With the same number of iterations, Algorithm 4 outperforms MYULA in terms of the estimation results. This indicates that incorporating the Metropolis–Hastings step in Algorithm 4 leads to improvements in the mixing time.
Table 3.
The mean and covariance estimation results obtained by MYULA and Algorithm 4.
6. Discussion and Conclusions
In this article, we propose three sampling algorithms based on Langevin Monte Carlo with the Metropolis–Hastings steps to handle the distribution constrained within some convex body, and establish the mixing time bounds of these algorithms for sampling from strongly log-concave distributions. Under certain conditions, these bounds are sharper than existing algorithms in the literature. Furthermore, in comparison to existing algorithms, the suggested constrained sampling algorithms are simpler, more intuitive, and easier to operate in some cases.
Our results demonstrate that the sampling algorithm, enhanced with the Metropolis–Hastings step, offers an effective solution for tackling some constrained sampling problems. Numerical experiments fully illustrate the advantages of the proposed algorithms. Although we focus on the strongly log-concave distributions in the theoretical analysis, the proposed algorithm can be readily applied to weakly log-concave distributions or non-convex potential functions. Simultaneously, we recognize that there are various aspects of the sampling algorithms that can be further improved. For instance, potential enhancements could involve the multiple importance sampling methods or adaptive techniques. We leave the investigation of its theoretical properties under such scenarios for future work.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
The data used to support the findings of this study are included within the article.
Conflicts of Interest
The author declares no conflict of interest.
Appendix A. Some Markov Chain Basics
Consider the time-homogeneous (We say that a Markov chain is time-homogeneous in which the probability of any state transition is independent of time.) Markov chains defined on a measurable state space with a transition probability . The transition probability satisfies
The k-th step transition probability defined recursively as
For a distribution on , a Markov chain defined on is called -irreducible if for each with and each , there exists such that . A Markov chain defined on with transition probability : and stationary distribution is called reversible if it satisfies the detailed balance condition for any .
Smooth chain assumption. We say that the Markov chain satisfies the smooth chain condition if its transition probability can be expressed in the form
for any , where is the transition kernel satisfying for any , denotes the one-step probability of the chain to stay at its current state x, and is the Dirac-delta function at x.
Log-isoperimetric inequality. A distribution supported on with density is said to satisfy the log-isoperimetry inequality with some constant if
for any partition , , of , where and .
Conductance profile. Given a Markov chain with transition probability and stationary distribution with density , its stationary flow is defined as
for any . For any , the conductance profile is given by
Furthermore, the extended conductance profile is defined as
Appendix B. Proofs
Appendix B.1. Proof of Proposition 1
Proof of Proposition 1.
Denote by the transition probability of the Markov chain at determined by Algorithm 2. For any , let with the step size h. Write the density of as . For any , denote by the acceptance probability for any , where
Then, the transition probability of the associated Markov chain at has a probability mass . Define the transition kernel
for . Then, the transition probability satisfies
where is the Dirac-delta function at x. By the smooth chain condition given in Appendix A, we know the Markov chain with the transition probability is smooth.
Recall that is the distribution on with the density defined as (3). Since
for any , then for any . Together with (A5), for any , it holds that
with , which implies for any . Thus, is the stationary distribution of the Markov chain with the transition probability . Hence, such Markov chain is reversible.
Furthermore, by (A5), we have
for any and . For any with , due to , we know the Lebesgue measure of A is nonzero. Since and for some universal constant and , we know for any . If , . If , we know the Lebesgue measure of is also nonzero, which implies . Thus, the Markov chain with the transition probability is -irreducible. We complete the proof of Proposition 1. □
Appendix B.2. Proof of Proposition 2
Proof of Proposition 2.
Recall for some universal constant . Notice that the additional two steps are introduced in Algorithm 3 only for the purpose of establishing a one-to-one mapping between and , and they do not affect the properties of the Markov chain. Using the same arguments in the proof of Proposition 1, we can obtain the results of Proposition 2. □
Appendix B.3. Proof of Proposition 3
Proof of Proposition 3.
The proof is almost identical to that of Proposition 1. Recall the distribution with density
where with defined as (8). Let be the probability density function of the Gaussian distribution . We only need to replace which appeared in the proof of Proposition 1 by and all the arguments still hold. □
Appendix B.4. Proof of Lemma 1
Proof of Lemma 1.
We introduce some notation first. Denote by the density function of , and the space of square integrable functions defined on under the density , that is,
for any . The Dirichlet form associated with the transition probability is defined as follows:
For any , let
For a measurable non-empty subset , the spectral gap is defined as
where . Define the spectral profile as
for any . If the current state of a Markov chain admits the distribution with density p, we write as the distribution of its next state. The proof of Lemma 1 includes two steps. The first step is to show
The second step is to show that the spectral profile and the conductance profile defined in (A3) are related as
Notice that . Replacing the restricted conductance profile and restricted spectral gap in the proof of Lemma 1 in [33] by the conductance profile and spectral gap, respectively, and using the similar arguments in the proof of Lemma 1 in [33], we can obtain the results of the two steps. Then, Lemma 1 can be constructed immediately. □
Appendix B.5. Proof of Lemma 2
Proof of Lemma 2.
Denote by the density function of the distribution . For any measurable non-empty subset such that , we have , where . Given , we define the following sets
and , where is the transition probability of the considered Markov chain.
On the one hand, if , then . Thus,
Similarly, if , we have . By the detailed balance condition and the Fubini’s theorem, it holds that
Therefore, if or , we have
On the other hand, we consider the case with and . Notice that . By the definition of the total variation distance, for any and , we have
Since , we know , which implies . Recall . By (A8),
Since , and the sets partition , by the log-isoperimetry inequality given in (A1), it holds that
where the second inequality follows from the fact that is non-decreasing in . By (A9) and (A10), we have
Putting the two cases together, it holds that
for any measurable non-empty subset with . Due to , by the definition of the conductance profile given in (A9), we have
for any . We complete the proof of Lemma 2. □
Appendix B.6. Proof of Theorem 1
For any , let with the step size h. For with some universal constant and , without loss of generality, we set . Under Assumption 1, we know .
Lemma A1.
Let for some universal constant and , and Assumption 1 hold. For any step size with L specified in Assumption 1 , it holds that
for any . Furthermore, if and , for any , it holds that
for any step size h satisfying
with , where m is specified in Assumption 1, and is the one-step transition distribution of the associated Markov chain involved in Algorithm 2 at .
Proof of Lemma A1.
Firstly, we prove the first claim (A11) of this lemma. Recall with the step size h. For any , by the Pinsker’s inequality, we have
where is the Kullback–Leibler divergence between and . Under Assumption 1, by the Taylor expansion, it holds that
for some z lying on the jointing line between x and y. Since for some universal constant and is L-smooth and m-strongly convex on , by Theorems 2.1.6 and 2.1.11 of [42], we have . Due to , then
and
for all . Therefore, we can obtain , which implies that
for any . It yields the claim (A11).
Next, we will prove the second claim (A12) of this lemma. Write the density of as . Notice that the one-step transition distribution of the associated Markov chain at has a probability mass
and admits a transition kernel , where
By the definition of the total variation distance, we have
for any . By the Markov’s inequality, it holds that
for any . In the sequel, we will derive a lower bound for this tail probability.
Notice that
For the numerator of this exponent, we have
Since is L-smooth and m-strongly convex on , it holds that
for any . By the Cauchy–Schwarz’s inequality, triangle inequality, and Theorem 2.1.5 of [42], we know
for any . Since for some universal constant and , by Assumption 1, it holds that
for any . Thus,
for any . Since and , we have
and for some , which implies
if . Recall . Under Assumption 1, by Theorems 2.1.5, 2.1.9 and 2.1.10 of [42], it holds that
for any if . Recall . Select satisfying , which can be guaranteed by and . Then
for any . For such selected h, we have
Since and , by Lemma 1 of [43], for any given , we have
for any step size h satisfying
Together with (A14), it holds that
for any . Select in (A13). Due to , we have
which implies for any . Therefore, we have the result (A12). We complete the proof of Lemma A1. □
Lemma A2.
Proof of Lemma A2.
Let p denote the density of the Gaussian distribution , and let be a distribution with density , where q is a log-concave function supported on . From Lemma 16 in [33], it holds that
for any partition , , of .
We now prove that the target distribution with density defined as (3) satisfies the log-isoperimetry inequality defined as (A1). Notice that
where is m-strongly convex on . By Theorem 2.1.11 of [42], we know is convex on . Since the indicator function is log-concave on and the class of log-concave functions is closed under multiplication, then can be expressed as the product of a log-concave function and the density of the normal distribution . By (A15), the distribution satisfies the log-isoperimetry inequality defined as (A1) with constant . We complete the proof of Lemma A2. □
Proof of Theorem 1.
Let be the one-step transition distribution of the Markov chain determined by the -lazy version of Algorithm 2, at . Then we have
for any , where is the Dirac-delta function at and is the one-step transition distribution of the associated Markov chain determined by Algorithm 2, at . By the definition of lazy chain and Proposition 1, we know that the Markov chain with transition distribution is -lazy, -irreducible, smooth, and reversible with respect to the distribution with density defined as (3).
Recall is the proposal distribution involved in Algorithm 2 and the -lazy version of Algorithm 2. For any such that for some and the step size h satisfying and
with , by the triangle inequality and Lemma A1, it holds that
Recall for some universal constant and . Under Assumption 1, Lemma A2 implies that the distribution with density satisfies the log-isoperimetry inequality given in (A1) with constant . Using Lemma 2 with and , we have
for any , where is the conductance profile defined in (A3) for Markov chain with transition distribution . For the above selected u and h, define the function
for any . Recall that
for an error tolerance , where is the distribution of the Markov chain with transition distribution at the k-th step. Let
be the extended conductance profile of such Markov chain. By Lemma 1, it holds that
If and , it then holds that
which implies
Together with , we complete the proof of Theorem 1. □
Appendix B.7. Proof of Corollary 1
Proof of Corollary 1.
Recall for some universal constant . Since the additional two steps are introduced in Algorithm 3 only transforming the sampling from the norm-constrained region to the Euclidean ball , the convergence rate of the two processes remains consistent. Using the same arguments in the proof of Theorem 1 with and , we can obtain the results of Corollary 1. □
Appendix B.8. Proof of Theorem 2
Proof of Theorem 2.
Recall that the distribution with density
for a regularization parameter , where is defined as in (10), and the target distribution with density
for some potential function . Under Assumptions 1 and 2, if there exists a universal constant such that , by Proposition 4 in [35], we have
for with the error tolerance , where is specified in Assumption 2.
Notice that with defined as (7). Under Assumption 1, by (9) and Theorem 2.1.5 in [42], we know that the function is twice continuously differentiable, -smooth and m-strongly convex on . Given the initial distribution with and an error tolerance , by Theorem 5 of [33], the Markov chain determined by Algorithm 4 satisfies
with the step size
where is a universal constant. Together with (A16), by the definition of -mixing time and the triangle inequality, we have
with . Hence, we complete the proof of Theorem 2. □
References
- Gelfand, A.E.; Smith, A.F.; Lee, T.M. Bayesian analysis of constrained parameter and truncated data problems using Gibbs sampling. J. Am. Stat. Assoc. 1992, 87, 523–532. [Google Scholar] [CrossRef]
- Blei, D.M.; Ng, A.Y.; Jordan, M.I. Latent dirichlet allocation. J. Mach. Learn. Res. 2003, 3, 993–1022. [Google Scholar]
- Klein, J.P.; Moeschberger, M.L. Survival Analysis: Techniques for Censored and Truncated Data; Springer: New York, NY, USA, 2005; pp. 5–18. [Google Scholar]
- Johnson, V.E.; Albert, J.H. Ordinal Data Modeling; Springer: New York, NY, USA, 2006; pp. 126–157. [Google Scholar]
- Celeux, G.; El Anbari, M.; Marin, J.M.; Robert, C.P. Regularization in regression: Comparing Bayesian and frequentist methods in a poorly informative situation. Bayesian Anal. 2012, 7, 477–502. [Google Scholar] [CrossRef] [Scilit]
- Paisley, J.W.; Blei, D.M.; Jordan, M.I. Bayesian nonnegative matrix factorization with stochastic variational inference. In Handbook of Mixed Membership Models and Their Applications; Airoldi, E.M., Blei, D.M., Erosheva, E.A., Fienberg, S.E., Eds.; CRC Press: Boca Raton, FL, USA, 2014; pp. 205–224. [Google Scholar]
- Khodadadian, A.; Parvizi, M.; Teshnehlab, M.; Heitzinger, C. Rational design of field-effect sensors using partial differential equations, Bayesian inversion, and artificial neural networks. Sensors 2022, 22, 4785. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Noii, N.; Khodadadian, A.; Ulloa, J.; Aldakheel, F.; Wick, T.; François, S.; Wriggers, P. Bayesian inversion with open-source codes for various one-dimensional model problems in computational mechanics. Arch. Comput. Methods Eng. 2022, 29, 4285–4318. [Google Scholar] [CrossRef] [Scilit]
- Ma, Y.A.; Chen, Y.; Jin, C.; Flammarion, N.; Jordan, M.I. Sampling can be faster than optimization. Proc. Natl. Acad. Sci. USA 2019, 116, 20881–20885. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Mangoubi, O.; Vishnoi, N.K. Nonconvex sampling with the Metropolis-adjusted Langevin algorithm. In Proceedings of the 32nd Conference on Learning Theory, Phoenix, AZ, USA, 25–28 June 2019; pp. 2259–2293. [Google Scholar]
- Dyer, M.; Frieze, A. Computing the volume of convex bodies: A case where randomness provably helps. Probabilistic Comb. Its Appl. 1991, 44, 123–170. [Google Scholar]
- Rodriguez-Yam, G.; Davis, R.A.; Scharf, L.L. Efficient Gibbs sampling of truncated multivariate normal with application to constrained linear regression. In Technical Report; Unpublished Manuscript; Colorado State University: Fort Collins, CO, USA, 2004. [Google Scholar]
- Lovász, L.; Vempala, S. The geometry of logconcave functions and sampling algorithms. Random Struct. Algorithms 2007, 30, 307–358. [Google Scholar] [CrossRef] [Scilit]
- Chen, M.H.; Shao, Q.M.; Ibrahim, J.G. Monte Carlo Methods in Bayesian Computation; Springer: New York, NY, USA, 2012; pp. 191–212. [Google Scholar]
- Dyer, M.; Frieze, A.; Kannan, R. A random polynomial-time algorithm for approximating the volume of convex bodies. J. ACM 1991, 38, 1–17. [Google Scholar] [CrossRef] [Scilit]
- Lang, L.; Chen, W.S.; Bakshi, B.R.; Goel, P.K.; Ungarala, S. Bayesian estimation via sequential Monte Carlo sampling—Constrained dynamic systems. Automatica 2007, 43, 1615–1622. [Google Scholar] [CrossRef] [Scilit]
- Chaudhry, S.; Lautzenheiser, D.; Ghosh, K. An efficient scheme for sampling in constrained domains. arXiv 2021, arXiv:2110.10840. [Google Scholar]
- Lan, S.; Kang, L. Sampling constrained Continuous probability distributions: A review. arXiv 2021, arXiv:2209.12403. [Google Scholar] [CrossRef] [Scilit]
- Neal, R.M. MCMC using Hamiltonian dynamics. In Handbook of Markov Chain Monte Carlo; Brooks, S., Gelman, A., Jones, G., Meng, X.L., Eds.; CRC Press: Boca Raton, FL, USA, 2011; pp. 113–162. [Google Scholar]
- Pakman, A.; Paninski, L. Exact hamiltonian Monte Carlo for truncated multivariate gaussians. J. Comput. Graph. Stat. 2014, 23, 518–542. [Google Scholar] [CrossRef] [Scilit]
- Lan, S.; Shahbaba, B. Sampling constrained probability distributions using spherical augmentation. In Algorithmic Advances in Riemannian Geometry and Applications; Minh, H.Q., Murino, V., Eds.; Springer: New York, NY, USA, 2016; pp. 25–71. [Google Scholar]
- Brubaker, M.; Salzmann, M.; Urtasun, R. A family of MCMC methods on implicitly defined manifolds. In Proceedings of the Fifteenth International Conference on Artificial Intelligence and Statistics, La Palma, Canary Islands, Spain, 21–23 April 2012; pp. 161–172. [Google Scholar]
- Ahn, K.; Chewi, S. Efficient constrained sampling via the mirror-Langevin algorithm. In Proceedings of the Advances in Neural Information Processing Systems, Online, 6–14 December 2021; pp. 28405–28418. [Google Scholar]
- Parisi, G. Correlation functions and computer simulations. Nucl. Phys. B 1981, 180, 378–384. [Google Scholar] [CrossRef] [Scilit]
- Grenander, U.; Miller, M.I. Representations of knowledge in complex systems. J. R. Stat. Soc. Ser. B (Methodol.) 1994, 56, 549–581. [Google Scholar] [CrossRef] [Scilit]
- Roberts, G.O.; Tweedie, R.L. Exponential convergence of Langevin distributions and their discrete approximations. Bernoulli 1996, 2, 341–363. [Google Scholar] [CrossRef] [Scilit]
- Roberts, G.O.; Stramer, O. Langevin diffusions and Metropolis-Hastings algorithms. Methodol. Comput. Appl. Probab. 2002, 4, 337–357. [Google Scholar] [CrossRef] [Scilit]
- Dalalyan, A.S. Theoretical guarantees for approximate sampling from smooth and log-concave densities. J. R. Stat. Soc. Ser. B (Methodol.) 2017, 79, 651–676. [Google Scholar] [CrossRef] [Scilit]
- Durmus, A.; Moulines, E. Nonasymptotic convergence analysis for the unadjusted Langevin algorithm. Bernoulli 2017, 27, 1551–1587. [Google Scholar] [CrossRef] [Scilit]
- Cheng, X.; Bartlett, P. Convergence of Langevin MCMC in KL-divergence. In Proceedings of the Machine Learning Research, Lanzarote, Spain, 7–9 April 2018; pp. 186–211. [Google Scholar]
- Durmus, A.; Moulines, E. High-dimensional Bayesian inference via the unadjusted Langevin algorithm. Bernoulli 2019, 25, 2854–2882. [Google Scholar] [CrossRef] [Scilit]
- Dwivedi, R.; Chen, Y.; Wainwright, M.J.; Yu, B. Log-concave sampling: Metropolis-Hastings algorithms are fast. J. Mach. Learn. Res. 2019, 20, 1–42. [Google Scholar]
- Chen, Y.; Dwivedi, R.; Wainwright, M.J.; Yu, B. Fast mixing of Metropolized Hamiltonian Monte Carlo: Benefits of multi-step gradients. J. Mach. Learn. Res. 2020, 21, 3647–3717. [Google Scholar]
- Bubeck, S.; Eldan, R.; Lehec, J. Finite-time analysis of projected Langevin Monte Carlo. In Proceedings of the Advances in Neural Information Processing Systems, Montreal, QC, Canada, 7–12 December 2015; pp. 1243–1251. [Google Scholar]
- Brosse, N.; Durmus, A.; Moulines, É.; Pereyra, M. Sampling from a log-concave distribution with compact support with proximal Langevin Monte Carlo. In Proceedings of the 2017 Conference on Learning Theory, Amsterdam, The Netherlands, 7–10 July 2017; pp. 319–342. [Google Scholar]
- Hsieh, Y.P.; Kavis, A.; Rolland, P.; Cevher, V. Mirrored langevin dynamics. In Proceedings of the Advances in Neural Information Processing Systems, Montreal, QC, Canada, 3–8 December 2018; pp. 1–10. [Google Scholar]
- Roberts, G.O.; Rosenthal, J.S. General state space Markov chains and MCMC algorithms. Probab. Surv. 2004, 1, 20–71. [Google Scholar] [CrossRef] [Scilit]
- Tibshirani, R. Regression shrinkage and selection via the lasso. J. R. Stat. Soc. Ser. B (Methodol.) 1996, 58, 267–288. [Google Scholar] [CrossRef] [Scilit]
- Kannan, R.; Lovász, L.; Montenegro, R. Blocking conductance and mixing in random walks. Comb. Probab. Comput. 2006, 15, 541–570. [Google Scholar] [CrossRef] [Scilit]
- Lee, Y.T.; Vempala, S.S. Stochastic localization + Stieltjes barrier = tight bound for log-Sobolev. In Proceedings of the Annual ACM SIGACT Symposium on Theory of Computing, Los Angeles, CA, USA, 25–29 June 2018; pp. 1122–1129. [Google Scholar]
- Efron, B.; Hastie, T.; Johnstone, I.; Tibshirani, R. Least angle regression. Ann. Stat. 2004, 32, 407–499. [Google Scholar] [CrossRef] [Scilit]
- Nesterov, Y. Introductory Lectures on Convex Optimization: A Basic Course; Springer: New York, NY, USA, 2003; pp. 51–101. [Google Scholar]
- Laurent, B.; Massart, P. Adaptive estimation of a quadratic functional by model selection. Ann. Stat. 2000, 28, 1302–1338. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).




