A comparison of computational approaches for maximum likelihood estimation of the Dirichlet parameters on high-dimensional data
Abstract
Likelihood estimates of the Dirichlet distribution parameters can be obtained only through numerical algorithms. Such algorithms can provide estimates outside the correct range for the parameters and/or can require a large amount of iterations to reach convergence. These problems can be aggravated if good starting values are not provided. In this paper we discuss several approaches that can partially avoid these problems providing a good trade-off between efficiency and stability. The performances of these approaches are compared on high-dimensional real and simulated data.
Full text
Statistics & Operations Research Transactions SORT 39 (1) January-June 2015, 109-126 Statistics & Operations Research Transactions c Institut d’Estadstica de Catalunya [email protected] ISSN: 1696-2281 eISSN: 2013-8830 www.idescat.cat/sort/ A comparison of computational approaches for maximum likelihood estimation of the Dirichlet parameters on high-dimensional data Marco Giordan and Ron Wehrens1 Abstract Likelihood estimates of the Dirichlet distribution parameters can be obtained only through numerical algorithms. Such algorithms can provide estimates outside the correct range for the parameters and/or can require a large amount of iterations to reach convergence. These problems can be aggravated if good starting values are not provided. In this paper we discuss several approaches that can partially avoid these problems providing a good trade off between efficiency and stability. The performances of these approaches are compared on high-dimensional real and simulated data. MSC: 62F10, 65C60 Keywords: Levenberg-Marquardt algorithm, re-parametrization, starting values, metabolomics data. 1. Introduction The Dirichlet distribution has multiple applications. It is well known for being the conjugate prior of the multinomial distribution and can be therefore used to get Bayesian estimates of the multinomial parameters. It is the basis for complicated models such as Dirichlet Processes and mixture distributions based on the Dirichlet distribution. In addition, it is interesting in its own right. It can be used to analyse positive continuous data that sum up to one, i.e. compositional data. Such kinds of data can arise in many situations. For example, when the data in each unit are represented by an intensity signal it can be of interest to normalize them through the total intensity of that unit. In this way 1Biostatistics and Data Management. IASMA Research and Innovation Centre. [email protected], [email protected] Received: April 2014 Accepted: February 2015
110 A comparison of computational approaches for maximum likelihood estimation of... the data from different units are comparable and the final data can be analysed using the Dirichlet distribution. Another possible application is in the analysis of taxonomic assignements. For each unit the percentages of the microbial composition of the unit are assigned to the specific taxonomies. These data can be easily produced with Next Generation Sequencing (NGS) technologies. Many other examples of the use of the Dirichlet distribution are provided in the paper of Wicker et al. (2008). The use of the Dirichlet distribution has been criticized due to the strong independence properties associated to this distribution (Aitchison, 1986). In the literature some generalizations have been proposed to overcome these limits, see for example Con- nor and Mosiman (1969) and Rayens and Srinivasan (1994). In this paper we only marginally discuss this point giving a case where the application of the Dirichlet distribution to high-dimensional compositional data leads to reliable conclusions. The focus of paper is related to the comparison of the computational performances of different methods to get maximum likelihood estimates of the Dirichlet distribution. There is no closed form solution of the maximum likelihood equations, therefore numerical methods must be employed. At the moment, commonly adopted methods are rather unstable. Final estimates can be outside the correct range for the parameters and the algorithms can fail to reach convergence in a reasonable amount of time. Wicker et al. (2008) reported many convergence failures in their simulation studies. Strategies to improve stability have been studied by many authors. Many proposals are focused on the choice of good starting values for the optimization algorithms. Useful references for these problems and the study of Dirichlet maximum likelihood estimation are the papers of Dishon and Weiss (1980), Ronning (1989), Narayanan (1991a), and Narayanan (1991b). In this work we compare eight different algorithms and four different initialisation methods on real and simulated data. As an application, we consider the analysis of metabolomics data. We consider the Newton-Raphson algorithm as the reference algorithm. A fixed-point algorithm, shown in literature to have very good performance, is taken into account as well. Moreover, a novel and more stable algorithm based on Levenberg-Marquardt ideas (Levenberg, 1944; Marquardt, 1963) will be employed to get the final maximum likelihood estimates. In the appendix we give a proof of the convergence to the optimum for this algorithm. Finally, to avoid the problem of estimates outside the admissible parameter space, a simple re-parametrization of the Dirichlet parameters and an algorithm with box constraints are considered. The re-parametrization will be used together with the Newton-Raphson algorithm and the Levenberg-Marquardt algorithm, but not with the FPI algorithm because this does not suffer from the problem of a constrained parameter space (see Huang, 2005). The re-parametrization and the algorithm with box-constraints are straightforward but have not been considered in the literature before.
Marco Giordan and Ron Wehrens 111 2. Dirichlet likelihood In this section we introduce notation and we summarize useful results from literature (see Minka, 2000). If y= (y1,...,yK)Tis Dirichlet distributed with vector parameter α= (α1,...,αK)Tthen its density is Γ(∑kαk) ΠkΓ(αk)Πkyαk−1 k where αk>0, yk>0, k=1,...,Kand ∑kyk=1. The log-likelihood for Nindependent observations can be written as f(α) = NlnΓ ∑ k αk!−N∑ k lnΓ(αk)+N∑ k (αk−1)1 N∑ i lnyik.(1) The gradient of the log-likelihood with respect to one αkis: [∇f(α)]k=N Ψ(∑ k αk)−Ψ(αk)+ 1 N∑ i lnyik!(2) where Ψdenotes the digamma function. In what follows the arguments of a function (e.g. the parameters αfor the function f(·)in equation (2)) can be suppressed in the notation when this does not generate confusion. The Hessian can be written in matrix form as H=Q+11Tz(3) qjk =−NΨ′(αk)δ(j−k)(4) z=NΨ′(∑ k αk)(5) where Ψ′denotes the trigamma function and δis the Dirac function (zero on the real line, except at the origin where it is one). Let us note that the diagonal form of Qassures the existence of its inverse when the diagonal elements are different from zero. This is exactly the present case because the trigamma function is positive for positive real arguments. 2.1. Some preliminary considerations The number of available algorithms to maximize a function is huge and its impossible to summarize all of them in a meaningful way. In this work we have focused our
112 A comparison of computational approaches for maximum likelihood estimation of... attention on algorithms suggested by the literature about the Dirichlet distribution and on a modification of the Levenberg-Marquardt algorithm for which we are able to provide a theoretical result related to the properties of the Dirichlet distribution. In the literature the algorithms studied and suggested are mainly two: the Newton- Raphson algorithm and the Fixed Point Iteration algorithm (see Minka, 2000; Huang, 2005). We include them in our comparison and we describe them briefly in the following sections. Other algorithms, like BFGS (Ronning, 1989) or Gradient Ascent (Huang, 2005), had a poor performance in the literature and are therefore disregarded here. The Levenberg-Marquardt algorithm is an algorithm to find least-squares estimates. In the appendix we give a theoretical result of convergence for a modification of the Levenberg-Marquardt algorithm with a fixed damping parameter when we apply its adaptation to find maximum likelihood estimates. We study its performance in the paper through simulations and real data. Finally, to avoid the problem of estimates outside the allowed space, we consider a re-parametrization of the Dirichlet distribution and an implementation of the BFGS algorithm with bounding box constraints, L-BFGS-B (see Byrd et al., 1995). In this work the efficiency of the algorithms will be compared essentially by the number of iterations required to reach convergence. This number does not depend on the implementation of the code and in this sense it is objective. We will see that the Levenberg-Marquardt approach can be thought as a penalized version of the Newton- Raphson algorithm and therefore it is expected to be slightly slower. However in general the iteration time for different algorithms can vary substantially and the algorithm with fewest iterations for convergence can require the largest amount of time. This can be the case when we want to compare Levenberg-Marquard, FPI and L-BFGS-B, therefore for these algorithms we provide also a comparison on time. 2.2. Newton-Raphson algorithm The Newton-Raphson (NR) algorithm is used to solve the maximum likelihood equations [∇f(α)] = 0. It can be summarized by the following equations: αnew =αold −H−1∇f(αold)(6) H−1=Q−1−Q−111TQ−1 1 z+1TQ−11(7) H−1∇f(α)k=[∇f(α)]k−b qkk (8) b=1TQ−1∇f(α) 1 z+1TQ−11=∑j[∇f(α)]j/qj j 1/z+∑j1/qj j .(9)
Marco Giordan and Ron Wehrens 113 When Qis invertible the inversion of the matrix His always guaranteed by the use of the Sherman-Morrison formula. However the equations (8) and (9) highlight that the algorithm does not require the storage and the computation of the inverse of H. This is a great advantage, especially when the number of variables is high. The Newton-Raphson algorithm is expected to converge to the global optimum because the Dirichlet distribution belongs to the exponential family and is therefore concave. However, the convergence can be very slow and the final estimates can be outside the admissible range for the parameters. Good starting values for the algorithm can partially avoid these problems. Finally let us note that using the relationship (7) is easy to build marginal confidence intervals based on the observed Fisher information at the maximum-likelihood estimate. 2.3. Fixed Point Iteration algorithm A fixed point iteration (FPI) scheme was considered initially by Minka (2000) and later by Huang (2005) to get the maximum likelihood estimates of the Dirichlet distribution. It is based upon minorize maximize (MM) algorithms (see Lange, 2010) and in our case the minorizing function of the log-likelihood employs an inequality of the gamma function. Specifically the log-likelihood can be bounded as follows 1 Nf α)≥(∑ k αk!Ψ ∑ k αold k!−∑ k lnΓ(αk)+∑ k (αk−1)1 N∑ i lnyik +C where C is a constant. This leads to the following equation that must be solved: Ψ(αnew k) = Ψ(∑ k αold k)+ 1 N∑ i lnyik.(10) To get αnew kwe need to invert the digamma function and this is done using another iterative algorithm; therefore the whole procedure can be slow. 2.4. Starting values The Newton-Raphson method is based upon a Taylor approximation and therefore good convergence properties are guaranteed only if the initial starting value is in a neighbourhood of the true parameter. In the literature there are many suggestions to find good starting values. We review four of them that will be used throughout the paper. We use the following notation: ¯yk=1 N∑N i=1yik, ¯y(2) k=1 N∑N i=1y2 ik and s2 k=¯y2 k−(¯yk)2. The four initialisations will be indicated as:
114 A comparison of computational approaches for maximum likelihood estimation of... moments. Matching the first two moments of the Dirichlet with the empirical moments provides the useful initialisation: [αstart]k=¯yk ¯yk−¯y(2) k s2 k .(11) Such initialisation employs only the marginal distributions and therefore its use of the information can be inefficient. Ronning. Ronning (1989) proposed an initialisation to guarantee parameters in the correct range after the first iteration of the Newton-Raphson algorithm. There is however no warranty that the final estimates are in the correct range. Such initialisation gives the same value to all the parameters and unlike the moments method uses all the available data for initialising each parameter: [αstart]k=min i∈1,...,N,k∈1,...,Kyik.(12) Dishon. Following a suggestion of Dishon and Weiss (1980), Ronning (1989) proposed a modification to the method of moments using information from all the marginals. Each parameter is estimated through: [αstart]k=ˆ α0¯yk(13) ˆ α0=ΠK−1 k=1(¯yk(1−¯yk) s2 k −1)1/(K−1) .(14) This initialisation can give parameters outside the admissible region. Wicker. Recently Wicker et al. (2008) proposed an initialisation based on an asymptotic approximation of the likelihood. This approximation uses the limiting behaviour of the digamma function when its real argument goes to zero or infinity. Such situations are met when the number of parameters goes to infinity, i.e. for high-dimensional data. However in their simulation study Wicker et al. (2008) considered only a five-dimensional setting. Their initialisation is given by [αstart]k=ˆ α0¯yk(15) ˆ α0=N(K−1)Ψ(1) N∑K k=1¯ykln ¯yk−∑K k=1¯yk∑N i=1lnyik .(16)
Marco Giordan and Ron Wehrens 115 3. A re-parametrization An algorithm producing estimates outside the correct range is useless. In the case of the Dirichlet distribution this problem can be avoided using a simple re-parametrization. The idea is to see the parameters αas functions of other parameters free to vary on the real line: in the log-likelihood we replace αkwith exp(βk). In what follows we will indicate with expNR the use of the NR algorithm applied to this re-parametrization. This way, the range of βkis the real line and exp(βk)is in the correct range for αk. With these replacements the log-likelihood f(β)is f(α)with α=exp(β) = (exp(β1),...,exp(βK))T. The gradient can now be expressed as: [∇f(β)]k= [∇f(α)]kexp(β) exp(βk). The Hessian has a form similar to the original one: H=Q+exp(β)exp(β)Tz(17) qjk = ([∇f(β)]k−exp(βk+βj)Ψ′(exp(βk)))δ(j−k)N(18) z=NΨ′ ∑ k exp(βk)!(19) As before, the diagonal form of the square matrix Qand the Sherman-Morrison formula are sufficient to guarantee that the inverse of Hexists if the diagonal elements of Qare non zero. However, after the re-parametrization the problem is not necessarily concave in the new parameters. Therefore we cannot say that the inequalities of the previous section hold true also now. For the re-parametrization the elements in the diagonal of Qare strictly negative in a neighbourhood of the point of maximum. Indeed at the maximum the gradient is zero and therefore qkk =−exp(2βk)Ψ′(exp(βk))N<0. Within such neighbourhood we have: H−1=Q−1−Q−1exp(β)exp(β)TQ−1 1 z+exp(β)TQ−1exp(β)(20) H−1∇f(β)k=1 qkk ([∇f(β)]k−exp(βk)b)(21) b=exp(β)TQ−1∇f(β) 1 z+exp(β)TQ−1exp(β)(22) =∑jexp(βj)[∇f(β)]j/qj j 1/z+∑jexp(2βj)/qj j .(23)
116 A comparison of computational approaches for maximum likelihood estimation of... Equations (21), (22) and (23) assure an easy way to implement the Newton-Raphson algorithm avoiding explicit matrix inversion. With these new quantities the Newton- Raphson iteration is again: βnew =βold −H−1∇f(βold). As starting values for the algorithm we can consider the logarithms of the starting values previously described. 4. A stable algorithm The Levenberg-Marquardt algorithm (Levenberg, 1944; Marquardt, 1963) was originally proposed to solve non-linear least-squares minimization problems. The idea is to use a function of Hinstead of Hitself. With an appropriate choice the iterations of the algorithm can take into account the curvature of the function being optimized. For the optimization of the Dirichlet log-likelihood we propose an iteration algorithm similar to the Levenberg-Marquardt one (LM): αnew =αold −{H+γdiagH}−1∇f(αold)(24) where γis a positive constant or a positive function not depending on the parameters. The effect of the damping parameter γis that of shortening the steps of NR algorithm, providing in this way prudent steps in the iterations. The same algorithm can be applied to the re-parametrization (expLM): βnew =βold −{H+γdiagH}−1∇f(βold).(25) Let us note that a similar approach is backtracking. In backtracking the matrix approximating the Hessian is multiplied by a damping parameter that is eventually shrunken to assure an ascent step. The damping parameter influences the step length. The rational of this approach is related to the Taylor expansion of the gradient calculated at the new parameter. We prefer instead the Levenberg-Marquardt approach because the damping parameter can influence both the direction and the size of the step (Madsen et al., 2004). Let us denote with xthe parameters of interest (αor βin the previous cases); working on the iteration map M(x)defined by M(x) = x−{H(x)+γdiagH(x)}−1∇f(x)(26) we show in the appendix that both algorithms (24) and (25) converge to the maximum.
Marco Giordan and Ron Wehrens 117 Similarly to what we have seen in the previous sections for the Newton-Raphson algorithm, we show how to rearrange the quantities involved in this version of the Levenberg-Marquardt algorithm using expressions without an explicit use of inverse matrices. Equations (24) and (25) can be rewritten with the following quantities {H(x)+γdiagH(x)}−1=D−L(27) D={Q(x)+γdiagH(x)}−1(28) where for the original parametrization L=D11TD 1 z+1TD1 (29) [(D−L)∇f(α)]k=[∇f(α)]k−b qkk(1+γ)+γz(30) b=1TD∇f(α) 1 z+1TD1 (31) =∑k[∇f(α)]k/(qkk(1+γ)+γz) 1/z+∑k1/(qkk(1+γ)+γz)(32) while for the re-parametrization L=Dexp(β)exp(β)TD 1 z+exp(β)TDexp(β)(33) [(D−L)∇f(β)]k=[∇f(β)]k−exp(βk)b qkk(1+γ)+γzexp(2βk)(34) b=exp(β)TD∇f(β) 1 z+exp(β)TDexp(β)(35) =∑k exp(βk)[∇f(β)]k (qkk(1+γ)+γzexp(2βk)) 1 z+∑k exp(2βk) (qkk(1+γ)+γzexp(2βk)) .(36) All the equalities are valid when we can apply the Sherman-Morrison formula, see Sections 2 and 3. In such cases, as for the described Newton-Raphson algorithms, there is no need to store and invert the Hessian matrix.
124 A comparison of computational approaches for maximum likelihood estimation of... properties for a fixed damping parameter γ. If this parameter can be made adaptive, as in the original Levenberg-Marquardt algorithm, it is not unreasonable to expect a higher stability and a lower mean number of iterations for convergence. Appendix In what follows the notation refers to the quantities previously introduced in the paper. Lemma 1 At the point of maximum, ˆ x, the differential of the iteration map (26) is given by dM(ˆ x) = I−{H(ˆ x)+γdiagH(ˆ x)}−1H(ˆ x). Proof. We treat γas a positive constant, but the proof holds even if γis a positive function that does not depend on x. Let us denote by G(x)the matrix {H(x)+γdiagH(x)}−1. We know from Section 4 that G(x)is well defined for every xin the original parametrization and at least in a neighbourhood of the maximum for the re-parametrization. For such cases the elements of G(x)∇f(x)can be written as ∑jgi j(x)∇fj(x). To prove the lemma we have to show that the partial derivatives of this expression are well defined. Using the product rule it is patent that the difficult part is to prove that the partial derivatives of the elements gi j(x) are well defined. If we are able to prove that the li j and the elements of the diagonal matrix Dare derivable it follows that also the gi j are derivable and therefore the lemma easily follows. Using standard rules for derivation we see that these terms are derivable if the trigamma function is derivable. For positive reals the trigamma function can be expressed as a positive series dominated by ∑n−2. Therefore by the Weierstrass M-test there is uniform convergence and the trigamma function is derivable. Moreover, the series form assures that the trigamma function is strictly decreasing for positive reals. We can summarize the results in matrix form. At the point of maximum ∇f(ˆ x) = 0 and therefore we get dM(ˆ x) = I−G(ˆ x)H(ˆ x) = I−{H(ˆ x)+γdiagH(ˆ x)}−1H(ˆ x). Theorem 1 The proposed Levenberg-Marquardt algorithms based upon equations (24) and (25) are locally attracted to the maximum ˆ xat a linear rate equal to the spectral radius of I−{H(ˆ x)+γdiagH(ˆ x)}−1H(ˆ x) or at a better rate. Proof. The point of maximum for f(x)is a fixed point for M(x). According to Proposition 15.3.1 in Lange (2010), it suffices to show that all eigenvalues of the differential
Marco Giordan and Ron Wehrens 125 dM(ˆ x)lie on the open interval (0,1). By Lemma 1 the following equalities hold: dM(ˆ x) = I−{H(ˆ x)+γdiagH(ˆ x)}−1H(ˆ x) ={H(ˆ x)+γdiagH(ˆ x)}−1{H(ˆ x)+γdiagH(ˆ x)−H(ˆ x)} ={H(ˆ x)+γdiagH(ˆ x)}−1{γdiagH(ˆ x)}. The maximum and minimum eigenvalues of dM(ˆ x)are determined by the maximum and minimum values of the Rayleigh quotient (v6=0): R(v) = vT[γdiagH(ˆ x)]v vT[H(ˆ x)+γdiagH(ˆ x)]v =1−vTH(ˆ x)v vT[H(ˆ x)+γdiagH(ˆ x)]v. If the quantities H(ˆ x)and γdiagH(ˆ x)are definite negative then also H(ˆ x)+ γdiagH(ˆ x) is definite negative and it follows that 0 <R(v)<1. For the original parametrization we can show that γdiagH(x)is always definite negative. We use the parametric form of Hfor the Dirichlet distribution. We have vTγdiagH(x)v=γ∑v2 ihii where hii =N(Ψ′(∑αj)−Ψ′(αi)).We have seen that for positive reals the trigamma function is strictly decreasing and therefore hii <0. Therefore vTγdiagH(x)v<0. Being f(·)concave His semi-definite negative, but His also invertible and therefore is definite negative. For the re-parametrization we cannot assure that the Hessian matrix is negative definite for every x. However, to apply Proposition 15.3.1 in Lange (2010) we need only to prove that this is true at ˆ x. For the diagonal matrix we observe that: [λdiagH(ˆ x)]kk =λqkk +λexp(2βk)NΨ′ ∑ k exp(βk)!(37) =λN[∇f(β)]k(38) +λexp(2βk)N"Ψ′(∑ k exp(βk))−Ψ′(exp(βk))#.(39) By the properties of the trigamma function Ψ′(∑kexp(βk)) −Ψ′(exp(βk)) <0 and therefore at ˆ xthe matrix λdiagHis negative definite. Moreover at ˆ xthe Hessian of the re-parametrization is semi-definite negative and invertible and therefore is definite negative.
126 A comparison of computational approaches for maximum likelihood estimation of... Acknowledgement The authors thank Federico Vaggi for useful comments on an earlier version of the manuscript. References Aitchison, J. (1986). The Statistical Analysis of Compositional Data. Monographs on statistics and applied probability. Chapman and Hall. Byrd, R. H., Lu, P., Nocedal, J. and Zhu, C. (1995). A limited memory algorithm for bound constrained optimization. SIAM J. Scientific Computing, 16, 1190–1208. Connor, R. J. and Mosiman, J. E. (1969). Concepts of independence for proportions with a generalization of the Dirichlet distribution. Journal of the American Statistical Association, 64, 194–206. Dishon, M. and Weiss, G. (1980). Small sample comparison of estimation methods for the beta distribution. Journal of Statistics Computation and Simulation, 11, 1–11. Franceschi, P., Masuero, D., Vrhovsek, U., Mattivi, F. and Wehrens, R. (2012). A benchmark spike-in data set for biomarker selection in metabolomics. Journal of Chemometrics, 26, 16–24. Huang, J. (2005). Maximum likelihood estimation of Dirichlet distribution parameters. http://www.stanford. edu/ jhuang11/research/dirichlet/, Robotics Institute, Carnegie Mellon University. Lange, K. (2010). Numerical Analysis for Statisticians. Springer, second edition. Levenberg, K. (1944). A method for the solution of certain non-linear problems in least squares. Quarterly of Applied Mathematics, 2, 164–168. Madsen, K., Nielsen, H. B. and Tingleff, O. (2004). Methods for Non-Linear Least Squares Problems (2nd ed.). Informatics and Mathematical Modelling, Technical University of Denmark, DTU. Marquardt, D. (1963). An algorithm for least-squares estimation of nonlinear parameters. SIAM Journal on Applied Mathematics, 11, 431–441. Minka, T. P. (2000). Estimating a Dirichlet distribution. http://research.microsoft.com/ en-us/um/people/ minka/papers/, M.I.T. Narayanan, A. (1991a). Algorithm AS266: maximum likelihood estimation of parameters of the Dirichlet distribution. Applied Statistics, 40, 365–374. Narayanan, A. (1991b). Small sample properties of parameter estimation in Dirichlet distribution. Communications in Statistics Simulations and Computation, 20, 647–666. Nielsen, H. B. (1998). Damping Parameter in Marquardt’s Method. Technical Report IMM-REP-1999-05. Department of Mathematical Modelling, DTU. Rayens, W. S. and Srinivasan, C. (1994). Dependence properties of generalized Liouville distributions on the Simplex. Journal of the American Statistical Association, 89, 1465–1470. Ronning, G. (1989). Maximum likelihood estimation of Dirichlet distributions. Journal of Statistics Computation and Simulation, 32, 215–221. Wehrens, R. and Franceschi, P. (2012). Meta-statistics for variable selection: the R package BioMark. Journal of Statistical Software, 51, 1–18. Wicker, N., Muller, J., Kalathur, R. K. R. and Poch, O. (2008). A maximum likelihood approximation method for Dirichlet’s parameter estimation. Computational Statistics and Data Analysis, 52, 1315– 1322.