High-dimensional copula variational approximation through transformation
Michael Stanley Smith, Ruben Loaiza-Maya, David J. Nott

TL;DR
This paper introduces a novel variational approximation method using copula models with transformations like Yeo-Johnson, improving high-dimensional Bayesian inference accuracy with minimal additional computational cost.
Contribution
It proposes a new copula-based variational approximation framework that enhances accuracy in high-dimensional models without significant computational overhead.
Findings
Copula models outperform Gaussian and skew-normal approximations in accuracy.
The method is computationally efficient and scalable to high dimensions.
Successful application to three models with six real datasets.
Abstract
Variational methods are attractive for computing Bayesian inference for highly parametrized models and large datasets where exact inference is impractical. They approximate a target distribution - either the posterior or an augmented posterior - using a simpler distribution that is selected to balance accuracy with computational feasibility. Here we approximate an element-wise parametric transformation of the target distribution as multivariate Gaussian or skew-normal. Approximations of this kind are implicit copula models for the original parameters, with a Gaussian or skew-normal copula function and flexible parametric margins. A key observation is that their adoption can improve the accuracy of variational inference in high dimensions at limited or no additional computational cost. We consider the Yeo-Johnson and G&H transformations, along with sparse factor structures for the scale…
| Yeo-Johnson Transformation | Inverse G&H Transformation | |||
|---|---|---|---|---|
| Function | ||||
| Evaluated Numerically | Evaluated Numerically | |||
| Not Required | Not Required | |||
| Not Required | Not Required | |||
| Variational Approximation | # Parameters | Max. Lower Bound | Time (mins) |
|---|---|---|---|
| (A1) Mean Field Gaussian | 1018 | -923.08 | 0.85 |
| (A2) Mean Field YJ Transform | 1527 | -913.17 | 0.85 |
| (A3) Gaussian | 3553 | -918.24 | 1.99 |
| (A4) Skew-normal | 4062 | -923.16 | 2.28 |
| (A5) Gaussian Copula (YJ Transform) | 4062 | -908.33 | 2.00 |
| (A6) Skew-normal Copula (YJ Transform) | 4571 | -916.80 | 2.34 |
| (A7) Gaussian Copula (iGH Transform) | 4571 | -909.21 | 1.86 |
| (A8) Skew-normal Copula (iGH Transform) | 5080 | -924.01 | 2.15 |
| Example | Variational Approximation | |||||
|---|---|---|---|---|---|---|
| (A3) | (A4) | (A5) | (A6) | (A7) | (A8) | |
| Spam | -828.15 | -824.28 | -827.96 | -824.02 | -828.69 | -824.60 |
| Krkp | -386.39 | -386.68 | -386.86 | -384.98 | -390.33 | -386.80 |
| Iono | -103.98 | -100.39 | -104.39 | -100.95 | -106.26 | -102.46 |
| Mush | -126.31 | -124.06 | -127.93 | -124.21 | -132.15 | -129.15 |
| Computing | Computing | ||
| Computing | Computing | ||
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsBayesian Methods and Mixture Models · Gaussian Processes and Bayesian Inference · Machine Learning and Algorithms
High-dimensional Copula Variational Approximation through Transformation
Michael Stanley Smith, Rubén Loaiza-Maya & David J. Nott
Michael Stanley Smith is Chair of Management (Econometrics) at Melbourne Business School, University of Melbourne; Rubén Loaiza-Maya is a Postdoctoral Fellow at the Department of Econometrics and Business Statistics, Monash University; and, David J. Nott is Associate Professor of Statistics, National University of Singapore. Correspondence should be directed to Michael Smith at [email protected].
Acknowledgments: The authors would like to thank Dr. Linda Tan for providing the MCMC output for the examples in Section 4, and Prof. Richard Gerlach and the review team for comments that helped improve the paper.
High-dimensional Copula Variational Approximation through Transformation
Abstract
Variational methods are attractive for computing Bayesian inference when exact inference is impractical. They approximate a target distribution—either the posterior or an augmented posterior—using a simpler distribution that is selected to balance accuracy with computational feasibility. Here we approximate an element-wise parametric transformation of the target distribution as multivariate Gaussian or skew-normal. Approximations of this kind are implicit copula models for the original parameters, with a Gaussian or skew-normal copula function and flexible parametric margins. A key observation is that their adoption can improve the accuracy of variational inference in high dimensions at limited or no additional computational cost. We consider the Yeo-Johnson and inverse G&H transformations, along with sparse factor structures for the scale matrix of the Gaussian or skew-normal. We also show how to implement efficient re-parametrization gradient methods for these copula-based approximations. The efficacy of the approach is illustrated by computing posterior inference for three different models using six real datasets. In each case, we show that our proposed copula model distributions are more accurate variational approximations than Gaussian or skew-normal distributions, but at only a minor or no increase in computational cost.
Key Words: Factor variational approximation, inverse G&H transformation, Implicit copula, Skew-normal copula, Yeo-Johnson transformation.
1 Introduction and Literature Review
Variational methods are an increasingly popular tool for computing posterior inferences for models with large numbers of parameters and/or large datasets; see Ormerod and Wand (2010) and Blei et al. (2017) for overviews. Unlike conventional Monte Carlo methods, which are able in principle to estimate quantities of interest with any desired precision, variational methods are approximate. However, they are often substantially faster, and can be used to estimate models where exact inference is impractical. Key to the success of variational inference is the selection of an approximation that balances accuracy with computational viability. In this paper we suggest a general approach to variational inference for a high-dimensional target distribution using Gaussian or skew-normal copula-based approximations. They are formed by using Gaussian or skew-normal distributions for an element-wise parametric transformation of the target. Parsimonious factor parametrizations of the scale matrix of these distributions are used to make the computations feasible. For the transformations, we consider the Yeo-Johnson (Yeo and Johnson, 2000) and inverse G&H families (Tukey, 1977). They allow for skewness and more complex features in the marginal densities of the copula model, without requiring a large number of additional variational parameters– which is important for maintaining computational efficiency in high dimensions. We also show how efficient re-parameterization gradient methods can be used for the copula models, including for the skew-normal by making use of its latent Gaussian structure. We show in a number of examples that our Gaussian and skew-normal copula models are more accurate approximations than the corresponding Gaussian and skew-normal distributions. Importantly, this increase in accuracy usually comes at only a minor increase in computational time, while in some instances the copula models are actually faster to calibrate.
Variational inference methods for Bayesian computation approximate a target posterior or augmented posterior distribution using another distribution which is more tractable. The form of the approximation is commonly derived either from an assumed factorization of the density, or the adoption of some convenient parametric family. In the current work, we consider parametric families of approximations, for which a Gaussian is the most common choice. Important early work on Gaussian approximations can be found in Opper and Archambeau (2009), where they considered models having a Gaussian prior and factorizing likelihood, and showed that in this class of models the number of variational parameters does not proliferate with increasing dimension. Challis and Barber (2013) discussed Gaussian approximations for models where the posterior could be expressed in a certain form, and show an equivalence between local variational methods and Kullback-Leibler divergence minimization methods in their setup. They also considered various parametrizations of the covariance matrix based on the Cholesky factor for the optimization. More recent work on Gaussian approximations has focused on stochastic gradient methods which largely remove any restriction on the kind of models to which the methodology applies. Key references here are papers by Kingma and Welling (2014) and Rezende et al. (2014) who introduced efficient variance reduction methods for stochastic gradient estimation in the variational optimization. These methods will be discussed further later. Some similar ideas were developed independently about the same time in Titsias and Lázaro-Gredilla (2014) and Salimans et al. (2013). The latter authors also consider methods for Gaussian approximation able to use second derivative information from the log posterior, as well as methods for forming non-Gaussian approximations by making use of hierarchical structures or mixtures of Gaussians. Kucukelbir et al. (2017) consider an automatic differentiation approach to Gaussian variational approximation which considers both diagonal and dense Cholesky parametrizations of the covariance matrix and the use of fixed marginal transformations of parameters. Their approach is implemented in the statistical package Stan (Carpenter et al., 2017).
A key difficulty with Gaussian approximations is the way that the number of covariance parameters increases quadratically with the number of model parameters, making Gaussian variational approximation impractical unless more parsimonious parametrizations of the covariance matrix are adopted. While assuming a diagonal covariance matrix is one possibility, this leads to the inability to represent the posterior dependence. Work on structured approximations for covariance matrices in Gaussian approximation applicable to high-dimensional problems includes the work of Challis and Barber (2013) mentioned above, and Tan and Nott (2018), who parameterize the covariance matrix in terms of a sparse Cholesky factor of the precision matrix. Related methods for time series models are developed in Archer et al. (2016). Miller et al. (2016) and Ong et al. (2018) consider factor parametrizations of covariance matrices, with the former authors also considering mixture approximations, with Gaussian component covariance matrices having the factor structure. Earlier approaches which used a one factor approximation to the covariance or precision matrix were considered by Seeger (2000) and Rezende et al. (2014). Quiroz et al. (2018) consider combining factor parametrizations for state reduction with sparse precision Cholesky factors for capturing dynamic dependence structure in high-dimensional state space models. Guo et al. (2016) consider similar “variational boosting” mixture approximations to Miller et al. (2016), although they use different approaches to the specification of mixture components and to the optimization.
The references above relate to different approaches to variational inference based on Gaussian or mixtures of Gaussians approximations. However, there is also a large literature on other approaches to developing flexible variational families. Most pertinent to the present work are methods based on copulas. Tran et al. (2015) use vine copulas, but these can be too slow to evaluate in high dimensions, and selection of the appropriate vine structure and component pair-copulas is difficult in general. Han et al. (2016) also employ element-wise transformations to construct a Gaussian copula model, and their work is most closely related to ours. They consider dense Cholesky factor parametrizations for the covariance matrix in the copula, and employ approximations to the posterior marginals based on flexible Bernstein polynomial transformations. Our work differs from theirs in the focus on approximations that can be calibrated in high dimensions. In particular, we use parsimonious factor parametrizations for the copula scale matrix which are feasible to implement for a high-dimensional model parameter vector, as well as parametric transformations which are computationally efficient and do not employ too many variational parameters. We also go beyond Gaussian copula approximations by investigating skew-normal copulas as well. Skew-normal variational families are considered in Ormerod (2011), who considers application to models which have a structure where the lower bound can be computed using one-dimensional quadrature. However, Ormerod (2011) does not consider skew-normal copulas.
Apart from copulas, there are many other ways to specify rich variational families. These include normalizing flows (Rezende and Mohamed, 2015), Stein variational gradient descent (Liu and Wang, 2016), real-valued non-volume preserving transformations (Dinh et al., 2016), methods based on transport maps (Spantini et al., 2018), implicit variational approximations where the variational family is specified through a generative process without a closed form density (Huszár, 2017) and hierarchical variational models (Ranganath et al., 2016). Some of these approaches attain their flexibility through using compositions of transformations of an initial density, but they do not fit into the copula framework discussed here.
The rest of the paper is organized as follows. Section 2 gives a brief introduction to variational inference methods, followed by a general description of our proposed implicit copula approach. Sections 3 and 4 consider Gaussian copula and skew-normal copula approximations, respectively. They illustrate our approach in six examples, where the approximations are more accurate than the corresponding Gaussian approximations, but at limited or no computational cost. Section 5 gives some concluding discussion and directions for future work. MATLAB code to implement our approach is described in the Online Appendix.
2 Variational Inference
In this section we first provide a short overview of variational inference. We then outline the implicit copulas formed through transformation that we employ as variational approximations.
2.1 Approximate Bayesian inference
We consider Bayesian inference with data having density p(\text{\boldmathy}|\text{\boldmath\theta}), where \text{\boldmath\theta}=(\theta_{1},\dots,\theta_{m})^{\top} is either a parameter vector, or a parameter vector augmented with some additional latent variables. The prior and posterior densities are denoted by p(\text{\boldmath\theta}) and p(\text{\boldmath\theta}|\text{\boldmathy})\propto p(\text{\boldmath\theta})p(\text{\boldmathy}|\text{\boldmath\theta})=g(\text{\boldmath\theta}), respectively. We will consider variational inference methods, in which a member q_{\lambda}(\text{\boldmath\theta}) of some parametric family of densities is used to approximate p(\text{\boldmath\theta}|\text{\boldmathy}), where \text{\boldmath\lambda}\in\Lambda is a vector of variational parameters. For example, for the Gaussian family would consist of the distinct elements of the mean vector and covariance matrix. Approximate Bayesian inference is then formulated as an optimization problem, where a measure of divergence between q_{\lambda}(\text{\boldmath\theta}) and p(\text{\boldmath\theta}|\text{\boldmathy}) is minimized with respect to . The Kullback-Leibler divergence
[TABLE]
is typically used, and we employ it here. If p(\text{\boldmathy})=\int p(\text{\boldmath\theta})p(\text{\boldmathy}|\text{\boldmath\theta})d\text{\boldmath\theta} denotes the marginal likelihood, then it is easily shown (see, for example, Ormerod and Wand (2010)) that
[TABLE]
where \mathcal{L}(\text{\boldmath\lambda}) is called the variational lower bound. Because \log p(\text{\boldmathy}) does not depend on , minimization of the Kullback-Leibler divergence above with respect to is equivalent to maximizing the variational lower bound \mathcal{L}(\text{\boldmath\lambda}).
The lower bound takes the form of an intractable integral, so it seems challenging to optimize. However, notice that from (1) it can be written as an expectation with respect to as
[TABLE]
which allows easily application of stochastic gradient ascent (SGA) methods (Robbins and Monro, 1951, Bottou, 2010). In SGA we start from an initial value \text{\boldmath\lambda}^{(0)} for and update it recursively as
[TABLE]
where \text{\boldmath\rho}_{i}=(\rho_{i1},\dots,\rho_{im})^{\top} is a vector of step sizes, ‘’ denotes the element-wise product of two vectors, and \widehat{\nabla_{\lambda}\mathcal{L}(\text{\boldmath\lambda}^{(i)})} is an unbiased estimate of the gradient of \mathcal{L}(\text{\boldmath\lambda}) at \text{\boldmath\lambda}=\text{\boldmath\lambda}^{(i)}. For appropriate step size choices this will converge to a local mode of \mathcal{L}(\text{\boldmath\lambda}). Adaptive step size choices are often used in practice, and we use the ADADELTA method of Zeiler (2012).
To implement SGA unbiased estimates of the gradient of the lower bound are required. These can be obtained directly by differentiating (2), and evaluating the expectation in a Monte Carlo fashion by simulating from . However, variance reduction methods for the gradient estimation are often also important for fast convergence and stability. One of the most useful is the ‘reparametrization trick’ (Kingma and Welling, 2014, Rezende et al., 2014). In this approach, it is assumed that an iterate can be generated from by first drawing from a density which does not depend on , and then transforming by a deterministic function \text{\boldmath\theta}=h(\text{\boldmath\varepsilon},\text{\boldmath\lambda}) of and . From (2), the lower bound can be written as the following expectation with respect to :
[TABLE]
Differentiating under the integral sign in (3) gives
[TABLE]
and approximating the expression (4) by Monte Carlo using one or more random draws from gives an unbiased estimate of \nabla_{\lambda}\mathcal{L}(\text{\boldmath\lambda}). An intuitive reason for the success of the re-parameterization trick is that it allows gradient information from the log-posterior to be used, by moving the variational parameters inside g(\text{\boldmath\theta}) in (3). Xu et al. (2018) show how the trick reduces the variance of the gradient estimates when is a Gaussian with diagonal covariance matrix (the so-called ‘mean field’ Gaussian approximation). We employ the re-parameterization trick, and specify a function , for a skew-normal copula in Section 4.
2.2 Variational approximations through transformations
Let be a family of one-to-one transformations onto the real line with parameter vector . To construct our variational approximation, we transform each parameter as and adopt a known distribution function F(\text{\boldmath\psi};\text{\boldmath\pi}), with vector of parameters , for \text{\boldmath\psi}=(\psi_{1},\ldots,\psi_{m})^{\top} . For example, if is a Gaussian distribution function, then \text{\boldmath\pi}=(\text{\boldmath\mu}_{\psi}^{\top},\mbox{vech}(\Sigma_{\psi}))^{\top}, where \text{\boldmath\mu}_{\psi} and are the mean and covariance matrix. If p(\text{\boldmath\psi};\text{\boldmath\pi})=\frac{\partial^{m}}{\partial\psi_{1}\cdots\partial\psi_{m}}F(\text{\boldmath\psi};\text{\boldmath\pi}), then the density of the approximation can be recovered by computing the Jacobian of the element-wise transformation from to , so that
[TABLE]
where the variational parameters are \text{\boldmath\lambda}^{\top}=(\text{\boldmath\gamma}_{1}^{\top},\ldots,\text{\boldmath\gamma}_{m}^{\top},\text{\boldmath\pi}^{\top}) and . Moreover, if has known marginal distribution functions F_{i}(\psi_{i};\text{\boldmath\pi}_{i}) and densities p_{i}(\psi_{i};\text{\boldmath\pi}_{i}) for , with \text{\boldmath\pi}_{i}\subseteq\text{\boldmath\pi}, the marginal densities of the approximation are
[TABLE]
with \text{\boldmath\lambda}_{i}^{\top}=(\text{\boldmath\gamma}_{i}^{\top},\text{\boldmath\pi}_{i}^{\top}) a sub-vector of \text{\boldmath\lambda}^{\top}.
The density at (5) can also be represented using its copula decomposition as follows. If is the distribution function of , then
[TABLE]
where \text{\boldmathu}=(u_{1},\ldots,u_{m})^{\top}, and is an -dimensional copula density with parameter vector \tilde{\text{\boldmath\pi}}. In much of the existing copula modeling literature, a parametric copula is selected for . When this is combined with pre-specified margins, this results in a flexible distributional form for ; for example, in the variational inference literature Tran et al. (2015) use a vine copula. However, in this paper the copula is instead derived directly from (5) and (6) by inverting Sklar’s theorem, with copula density
[TABLE]
and copula function
[TABLE]
determined by . Such a copula is called an ‘inversion copula’ (Nelsen, 2006, pp.51–52) or an ‘implicit copula’ (McNeil et al., 2005). In general, the copula parameters \tilde{\text{\boldmath\pi}} are given by , but with additional constraints to ensure they are identifiable in the copula; see Smith and Maneesoonthorn (2018) for examples. However, here the elements of are also parameters of the margins at (6), and this identifies in without any additional constraints.
The most popular choice for is a Gaussian distribution, resulting in the Gaussian copula (Song, 2000). More recently, there has been growing interest in selecting other distributions, such as the skew-t distribution (Demarta and McNeil, 2005, Smith et al., 2012) or those arising from state space models (Smith and Maneesoonthorn, 2018). These can produce distributional families for that are more flexible in their dependence structures. Later, we will illustrate our approach with sparse Gaussian and skew-normal distributions for , but note that other parametric distributions can also be used.
We observe that the expression at (5) is much easier to employ in variational inference than that at (7) for three reasons. First, as mentioned above, the constraints on required to identify \tilde{\text{\boldmath\pi}} do not need to be elucidated as is fully identified in (5). Second, evaluating (7) requires repeated computation of the vector \text{\boldmathu}=(Q_{\lambda_{1}}(\theta_{1}),\ldots,Q_{\lambda_{m}}(\theta_{m}))^{\top} which involves numerical integrations, whereas evaluating (5) does not. Third, optimizing the lower bound with respect to \tilde{\text{\boldmath\pi}} proves more difficult than the unconstrained ; an observation made previously by Han et al. (2016) for Gaussian copula variational approximation.
2.3 Two transformations
Key to the success of our approach is the choice of an appropriate family of transformations . Because has distribution function , which is either Gaussian or skew-normal in our paper, we consider two choices that have proven successful in transforming data to near normality or symmetry. The first is the single parameter transformation of Yeo and Johnson (2000) (YJ hereafter), which extends the Box-Cox transformation to the entire real line. For , it is given by
[TABLE]
The second is based on the two parameter (monotonic) G&H transformation of Tukey (1977), an overview of which can be found in Headrick et al. (2008). This is used to transform a standard Gaussian variable to another, which can be asymmetric and heavy-tailed (Peters et al., 2016). Thus, the G&H transformation is one from normality, so that we use it for . For , set
[TABLE]
then can be obtained by numerical inversion. We bound because it corresponds to a G&H transformation from a standard Gaussian to another random variable with a first moment that exists; see (Peters et al., 2016, Sec.5.1).
For both transformations, , so that if a parameter is constrained we first transform it to the real line; for example, with a scale or variance parameter we set to its logarithm. Interestingly, when implementing SGA is not evaluated, but is repeatedly. Table 1 provides these, along with expressions for derivatives with respect to the model and variational parameters that are required to implement the SGA algorithm. For both transformations these are all fast to compute.
3 Gaussian Copula Variational Approximation
3.1 Gaussian copula factor specification
The simplest implicit copula is the Gaussian copula, where F(\text{\boldmath\psi};\text{\boldmath\pi})=\Phi_{m}(\text{\boldmath\psi};\text{\boldmath\mu}_{\psi},\Sigma_{\psi}) is a Gaussian distribution function with mean \text{\boldmath\mu}_{\psi} and covariance matrix . In constructing a Gaussian copula, it is usual to also set \text{\boldmath\mu}_{\psi}=(\mu_{\psi,1},\ldots,\mu_{\psi,m})^{\top}=\bm{0} and because these parameters are unidentified in the Gaussian copula function; for example, see the discussion in Song (2000). However, we do not need to do so here because these parameters are fully identified in the density at (5) as they are also parameters of its margins, with \text{\boldmath\pi}_{i}=(\mu_{\psi,i},\sigma^{2}_{\psi,i})^{\top} at (6). To illustrate, Figure 1 plots for the YJ transformation, showing that this density can capture both positive or negative skew. Moreover, the direction and level of skew can differ in each margin, depending on , making a substantially more flexible approximation than a Gaussian.
When is of higher dimensions, we follow Ong et al. (2018) and adopt a factor structure for as follows. Let be an matrix with . For identifiability reasons it is assumed that the upper triangle of is zero. Let be a vector of parameters with , and denote by the diagonal matrix with entries . We assume that
[TABLE]
so that the number of parameters in grows only linearly with if is kept fixed. We note that this copula is equivalent to the Gaussian factor copula suggested by Murray et al. (2013) and Oh and Patton (2017) to model data, although they do not use it as a variational approximation. The Gaussian random vector has the generative representation \text{\boldmath\psi}=\text{\boldmath\mu}+B\text{\boldmathz}+D\text{\boldmath\epsilon}, where \text{\boldmathz}=(z_{1},\dots,z_{k})^{\top}\sim N(0,I_{k}) and \text{\boldmath\epsilon}\sim N(0,I_{m}). By setting \text{\boldmath\varepsilon}^{\top}=(\text{\boldmathz}^{\top},\text{\boldmath\epsilon}^{\top}), h(\text{\boldmath\varepsilon},\text{\boldmath\lambda})=(t_{\gamma_{1}}^{-1}(\psi_{1}),\ldots,t_{\gamma_{m}}^{-1}(\psi_{m}))^{\top}, and \text{\boldmath\pi}=(\text{\boldmath\mu}_{\psi}^{\top},\mbox{vech}(B)^{\top},\text{\boldmathd}^{\top}), the closed form re-parameterization gradients in a Gaussian variational approximation with factor covariance structure given in Ong et al. (2018) can be used.111Here the ‘vech’ operator is the half-vectorization of a rectangular matrix, defined for an matrix with as with for .
3.2 Application: ordinal time series copula model
3.2.1 The model and extended likelihood
To illustrate our proposed variational approximation we use it to estimate a complex model with a complex augmented posterior, where its greater flexibility may increase the accuracy of inference compared to simpler approximations. We consider the copula time series model for an ordinal-valued random vector proposed by Loaiza-Maya and Smith (2019). These authors use a -dimensional parsimonious copula with density c^{DV}(\text{\boldmathv}), where \text{\boldmathv}=(v_{1},\ldots,v_{T})^{\top}, to capture serial dependence in (this is not to be confused with the use of another copula for the variational approximation). The time series is assumed to be stationary with marginal distribution function , which is estimated non-parametrically in an initial step using the empirical distribution function.
The time series copula employed is a parsimonious drawable vine (D-vine) of Markov order , as given in Smith (2015), and defined as follows. Let be a stochastic process with , so that is marginally uniform. For , denote222Note that is the distribution function of evaluated at , and is the distribution function of evaluated at . , and , then the D-vine copula density is the product
[TABLE]
of bivariate copula densities called ‘pair-copulas’ (Aas et al., 2009), each with individual parameter vector \text{\boldmath\eta}_{k}. This D-vine copula therefore has parameter vector \text{\boldmath\eta}=(\text{\boldmath\eta}_{1}^{\top},\ldots,\text{\boldmath\eta}_{p}^{\top})^{\top}, and is parsimonious because |\text{\boldmath\eta}| does not increase with . To capture the heteroskedasticity that exists in most ordinal-valued time series Loaiza-Maya and Smith (2019) use a five parameter mixture copula for , which we also use here and is outlined in Part A of the Online Appendix, leading to a total of |\text{\boldmath\eta}|=5p model parameters. Given , the arguments of the pair-copulas in (9) are computed using the recursive Algorithm 1 in Smith (2015).
It is widely known (Song, 2000, Genest and Nešlehová, 2007) that the mass function p(\text{\boldmathy}|\text{\boldmath\eta}) of this discrete-margined copula model is computationally intractable, so we use the extended likelihood of Smith and Khaled (2012) instead. This employs the vector , such that the joint mass function of is
[TABLE]
with the indicator function if is true, and zero otherwise. It is straight-forward to show that the margin in of (10) is the required mass function p(\text{\boldmathy}|\text{\boldmath\eta}). Evaluating the extended likelihood at (10) avoids the computational burden of evaluating p(\text{\boldmathy}|\text{\boldmath\eta}) directly.
3.2.2 The variational approximation
We follow Loaiza-Maya and Smith (2019) and estimate the model by setting \text{\boldmath\theta}=(\text{\boldmath\eta}^{\top},\text{\boldmathv}^{\top})^{\top} and approximating the augmented posterior p(\text{\boldmath\theta}|\text{\boldmathy})\propto p(\text{\boldmathy},\text{\boldmathv}|\text{\boldmath\eta})p(\text{\boldmath\eta}), which uses the extended likelihood and a proper uniform prior p(\text{\boldmath\eta}). The target distribution therefore has dimension m=|\text{\boldmath\theta}|=5p+T. These authors use the variational approximation q_{\lambda}(\text{\boldmath\theta})=q_{\lambda^{a}}(\text{\boldmath\eta})q_{\lambda^{b}}(\text{\boldmathv}), assuming independence between and , and a Gaussian distribution with a factor covariance structure for . However, because each is constrained to , it is transformed to the real line as , where is the distribution function of a standard Gaussian, and independent Gaussians used as approximations for .
Loaiza-Maya and Smith (2019) label this approximation ‘VA2’, and we extend it as follows. For we use a Gaussian copula formed through the YJ transformation with a factor structure, so that \text{\boldmath\lambda}^{a} has elements (the unique elements in the factor decomposition plus the YJ transformation parameters). For each we use a normal approximation after a YJ transformation, so that \text{\boldmath\lambda}^{b} has elements (the means and variances of the Gaussians, plus the YJ transformation parameters). The full set of variational parameters are \text{\boldmath\lambda}=(\text{\boldmath\lambda}^{a},\text{\boldmath\lambda}^{b})^{\top}. They are calibrated using Algorithm 1 of Loaiza-Maya and Smith (2019), which employs SGA with control variates and the analytical gradient ; the latter of which is given in Appendix A for our copula approximation outlined here.
3.2.3 Empirical illustration: monthly counts of attempted murder
We fit the time series model in Section 3.2.1 to monthly counts of Attempted Murder in New South Wales, Australia. Plots of the time series and the empirical distribution function used for margin can be found in (Loaiza-Maya and Smith, 2019, Fig.1). The parsimonious D-vine in (9) has Markov order , and the target density is complex with dimension . We fit three parsimonious variational approximations: (i) the Gaussian copula outlined above with factors, (ii) a Gaussian distribution with factor covariance and factors, and (iii) a fully mean field Gaussian. Note that (ii) is equivalent to our copula approximation but with all YJ parameters set to (ie. an identity transformation), as is (iii) but with the additional constraint that is diagonal. Figure 2 plots lower bound values against step number for all three methods using the same SGA algorithm, and the copula approximation clearly dominates.
To assess the accuracy of the three variational approximations, we also estimate the posterior using the (slow, but exact) data augmentation MCMC method of Smith and Khaled (2012). Figure 3 depicts the accuracy of the first three marginal posterior moments of the variational approximations. The panels provide scatterplots of the true moments against their approximations, with a blue scatter for the proposed copula approximation, and a red scatter for the Gaussian approximation. The left-hand panels give results for and the right-hand panel for . More accurate variational approximations result in scatters that lie closer to the 45 degree line, and we make two observations. First, panels (e,f) show that the true posteriors are skewed, and that the copula approximation does a very good job of estimating the skew. Second, panel (c) reveals that by capturing the third moment in the augmented vector \text{\boldmath\theta}=(\text{\boldmath\eta},\text{\boldmathv}), the posterior standard deviation of is also estimated more accurately. Figure 4 compares the marginal densities for the four parameters which exhibit the most skew, and the tails are more accurately estimated using the copula approximation.
4 Skew-Normal Copula Approximation
4.1 Copula specification
An alternative implicit copula that we consider is based on the skew-normal distribution of Azzalini and Dalla Valle (1996) and Azzalini and Capitanio (2003). In this case, the transformed parameters are assumed to have joint density
[TABLE]
where denotes an -dimensional Gaussian density, , and is the ith diagonal element of . The parameters \text{\boldmath\alpha}_{\psi} determine the level of skew in the marginals of , and when \text{\boldmath\alpha}_{\psi}=\bm{0} the distribution reduces to a Gaussian. As noted in Section 2.2, the parameters are fully identified in the representation of at (5), whereas they are not if (11) is used only for the construction of the copula.
Demarta and McNeil (2005), Smith et al. (2012) and Yoshiba (2018) show that implicit copulas constructed from skew-elliptical distributions are more flexible than elliptical copulas because they allow for asymmetric dependence.333This is not to be confused with asymmetry of the marginal distributions . Here, we focus on the skew-normal copula because it is typically faster and easier to calibrate than the skew-t copula. When \text{\boldmath\alpha}_{\psi}\neq\bm{0} it captures asymmetric dependence, making it more flexible than the Gaussian copula considered in Section 3, although the same factor structure discussed in Section 3.1 is adopted for the scale matrix . Therefore, the approximation q_{\lambda}(\text{\boldmath\theta}) to the target p(\text{\boldmath\theta}|\text{\boldmathy}) has variational parameters , where and are as defined in Section 3.1.
In our empirical examples, we employ the re-parametrization trick to reduce the variance of the gradient estimate. This uses a simple generative representation of in terms of standardized random components. Using the properties of the skew-normal distribution (Azzalini and Dalla Valle, 1996), the following generative representation for can be derived (see Part B of the Online Appendix for details). If , and , then
[TABLE]
where , , , , is distributed skew-normal with density at (11). Setting \text{\boldmath\varepsilon}^{\top}=(r,\varepsilon_{0},\text{\boldmathz}^{\top},\text{\boldmath\epsilon}^{\top}) and h(\text{\boldmath\varepsilon},\text{\boldmath\lambda})=(t_{\gamma_{1}}^{-1}(\psi_{1}),\ldots,t_{\gamma_{m}}^{-1}(\psi_{m}))^{\top}, the gradient at (4) can be evaluated by first drawing from an distribution, and computing the derivatives analytically; see Appendix B for details.
4.2 Examples
To illustrate the use of a skew-normal copula as a variational approximation, we employ it to approximate the posterior of several logistic regressions examined previously in Ong et al. (2018).
4.2.1 Mixed logistic regression
The first uses the polypharmacy longitudinal data in Hosmer et al. (2013), which features data on 500 subjects over 7 years. The logistic regression is specified fully in Ong et al. (2018), and it includes 8 fixed effects (including an intercept), plus one subject-based random effect. The following approximations are fitted to the augmented posterior of , which comprises , the 8 fixed effect coefficients, and the 500 random effect values:
- (A1)
Mean Field Gaussian: independent univariate Gaussians
- (A2)
Mean Field YJ Transform: independent univariate distributions with densities at (6), where p_{i}(\psi_{i};\text{\boldmath\pi}_{i})=\phi_{1}(\psi_{i};\mu_{\psi_{i}},\sigma^{2}_{\psi_{i}}) is a Gaussian density and is a YJ transform
- (A3)
Gaussian: as in Ong et al. (2018)
- (A4)
Skew-normal
- (A5)
Gaussian Copula: as outlined in Section 3.1, with a YJ transform
- (A6)
Skew-normal Copula: as outlined in Section 4.1, where is a YJ transform
- (A7)
Gaussian Copula: as outlined in Section 3.1, with an inverse G&H transform
- (A8)
Skew-normal Copula: as outlined in Section 4.1, where is an inverse G&H transform
In approximations A3–A8, a factor structure with factors is used for the variance (A3) or scale matrix (A4) of the distribution, or the copula parameter matrix (A5–A8). Thus, A4 extends the approximation of Ormerod (2011) to include a factor scale matrix, while A5 and A7 extend the approximation of Han et al. (2016) to have a factor copula parameter matrix and parametric margins constructed from the two transformations. For each approximation Table 2 lists the number of variational parameters , average lower bound value over the last 1000 steps of the SGA algorithm, and the time to complete 1000 steps using MATLAB on a standard laptop. Comparing the lower bound values for A2 and A1, it can be seen that allowing for asymmetry in the margins improves the approximation markedly; although using the skew-normal A4 is not as effective. The most accurate approximations are the Gaussian copulas A5 and A7. The time to complete 1000 SGA steps for the copula models is almost the same as the non-copula models (e.g. A5 and A7 are only 0.5% and 1.5% slower than A3) making them attractive choices.
To judge the approximation accuracy, the exact augmented posterior is computed using MCMC with data augmentation. Figure 5 plots the first three posterior moments of the approximations (vertical axes) against their true values (horizontal axes). Results are given for the approximations A3 (panels a,e,i), A4 (panels b,f,j), A5 (panels c,g,k) and A6 (panels d,h,l). All four identify the means well, but the striking result is that the two copula approximations capture the (Pearsons) skew coefficients remarkably well in panels (k,l). By doing so, the estimates of the second moment in panels (g,h) are also improved. Figure 6 illustrates further by plotting the exact posterior densities for the nine model parameters (excluding the random effects), along with those of approximations A1, A3, A5, and that obtained using INLA (Rue et al., 2009) with the same priors. Ignoring the dependence between parameters using A1 greatly understates the posterior standard deviation, which is well-known. However, adopting the Gaussian copula A5 improves the density estimates compared to the Gaussian A3 – particularly for in panel (i). The latter is likely due to the skew in the posteriors of many random effect values, which is captured by the copula. Last, INLA approximates the near symmetric marginal posteriors of the fixed effects well, but has an inaccurate estimate for in panel (i), thereby understating the level of heterogeneity in the data compared to all VB estimators.
4.2.2 Logistic regression
To illustrate the trade-off between speed and approximation accuracy, we consider the Spam, Ionosphere, Krkp and Mushroom test datasets considered in Ong et al. (2018). These have sample sizes and , respectively, and are used to fit logistic regressions with 104, 111, 37 and 95 covariates. We use the same prior on the linear coefficients of the covariates as these authors, and fit the six correlated approximations A3–A8 using factors throughout. Table 3 reports the average lower bounds over the last 1000 steps. By this metric, the skewed approximations A4, A6 and A8 are the most accurate, although the differences between these three are small. However, the copula models can have a substantial speed advantage. Figure 7 compares the calibration speed by plotting the lower bound against time to implement the SGA algorithm (in MATLAB on a standard laptop). This shows that for the Krkp and Mushroom test data the copula models were much faster to calibrate than either the Gaussian or skew-normal. This can also be an important consideration when using variational inference in big data problems.
5 Discussion
In this paper we show how to employ copula model approximations in variational inference using element-wise transformations of the parameter space. This type of copula is called an ‘implicit copula’, and is obtained from the choice of distribution for the transformed parameters . We suggest using parametric transformations that are known to be effective in transforming data to near normality, and illustrate with the power transformation of Yeo and Johnson (2000) and the inverse G&H transformation of Tukey (1977). The implied margins of such transformations are available in closed form, and depend on both the transformation selected and the marginals of . While, in principle, any distribution can be selected for , elliptical and skew-elliptical (Genton, 2004) distributions are good choices for two reasons. First, they give rise to implicit copulas which have been shown previously to be effective; for example, see Fang et al. (2002), Demarta and McNeil (2005) and Smith et al. (2012). Second, by employing a factor decomposition for the scale matrix of , the number of copula parameters only increases linearly with .
The approximation provides a balance between computational viability and accuracy. We illustrate here using Gaussian and skew-normal copulas of dimensions up to , although higher dimensions can also be considered. Our empirical work shows that the Yeo-Johnson transformation is particularly effective and is quickly calibrated using SGA; in most cases, faster than calibrating the elliptical or skew-elliptical distributions themselves on the parameter vector. The approach of defining the copula approximation using element-wise transformations simplifies the computations required to implement variational inference by using (5). In contrast, selecting a high-dimensional copula function—such as a vine copula (Tran et al., 2015)—and marginals separately, uses (7) which is slower. Han et al. (2016) make a similar observation for a Gaussian copula, and we show this applies generally to all implicit copulas. Another important observation is that constraints on the parameters of usually employed to identify the implicit copula (for example, see Smith and Maneesoonthorn (2018)) are not required because they are identified through the margins .
Last, we comment on possible extensions to our work. One interesting possibility is to consider other flexible multivariate models for constructing the implicit copula. Truncated Gaussian graphical models (Su et al., 2016) are one interesting possibility here, since they include the skew-normal distribution as a special case, and similar to the skew-normal they have a latent Gaussian structure which may be amenable to implementation of re-parametrization methods for gradient estimation in the optimization. Another interesting idea is to use the copula Bayesian network of Elidan (2010) as an approximation, where the local copulas are implicit copulas constructed through transformation as recommended in our paper. It would also be interesting to implement our copula approximations in other challenging settings, such as when some of the parameters are discrete, or in likelihood-free inference applications. Here gradient estimation for the optimization becomes more challenging, as straightforward re-parameterization techniques do not immediately apply.
Appendix A
This appendix derives the gradient needed to implement the example in Section 3.2.1. In this example, , where are the model parameter and the vector of auxiliary variables. The approximation to the augmented posterior of is
[TABLE]
with \text{\boldmath\psi}^{a}=\left(\psi_{1}^{a},\dots,\psi_{m}^{a}\right)^{\top}, , \text{\boldmath\psi}^{b}=\left(\psi_{1}^{b},\dots,\psi_{T}^{b}\right)^{\top}, , , \text{\boldmath\lambda}^{a}=((\bm{\pi}^{a})^{\top},(\bm{\gamma}^{a})^{\top})^{\top}, , , . It follows then that
[TABLE]
For we use a Gaussian copula, so that p_{a}\left(\text{\boldmath\psi}^{a};\bm{\pi}_{a}\right)=\phi_{m}\left(\text{\boldmath\psi}^{a},\bm{\mu},BB^{\top}+D^{2}\right) and with and . Following Ong et al. (2018) and Loaiza-Maya and Smith (2019), it is straightforward to show that the elements of the gradient
[TABLE]
are
[TABLE]
with .
For \text{\boldmath\psi}^{b} we assume an independent Gaussian approximation p_{b}\left(\text{\boldmath\psi}^{b};\bm{\pi}_{b}\right)=\prod_{t=1}^{T}\phi_{1}\left(\psi^{b}_{t};\zeta_{t},\exp{\left(2c_{t}\right)}\right), where , and . The implied approximation for is
[TABLE]
The gradient is with elements
[TABLE]
where .
Appendix B
This appendix provides details on the implementation of variational inference using the skew-normal approximation proposed in Section 4. Notice that by multiplying (11) by the Jacobian of the transformation from to , the approximating density is
[TABLE]
where \text{\boldmath\psi}=(\psi_{1},\ldots,\psi_{m})^{\top} and . The complete vector of variational parameters for this approximation is , where is the vectorization of omitting the zero upper triangular elements. As discussed in Section 2, to implement SGA using the re-parameterization trick, the gradient
[TABLE]
needs approximating. This is undertaken by drawing an iterate of \text{\boldmath\varepsilon}=(r,\varepsilon_{0},\text{\boldmathz}^{\top},\text{\boldmath\epsilon}^{\top})^{\top} from a distribution, and then computing the derivatives inside (12) analytically. Below, we write \text{\boldmath\theta}=h(\text{\boldmath\varepsilon},\text{\boldmath\lambda}) as for clarity. To derive the derivatives, note that the gradient can be broken up into sub-vectors
[TABLE]
where
[TABLE]
the derivative with respect to above is computed by ignoring elements on right hand side of the equation that correspond to the upper triangle of . The term is model specific and needs to be derived on a case-by-case basis. Expressions for the remaining terms can be computed in closed form. First,
[TABLE]
where the elements are computed using the formulas given in Table 1 for either the YJ or G&H transformations. Expressions for the remaining four derivatives are provided in Table 4, which are derived in the Online Appendix. MATLAB routines that evaluate these derivatives are in the Supplementary Material.
Supplementary Materials
Supplementary materials contain:
smith_loaiza_maya_nott_webappend.pdf
An online appendix in two parts. Part A specifies the pair-copula used in Section 3.2; Part B derives the four derivatives in Appendix B.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Aas et al. (2009) Aas, K., Czado, C., Frigessi, A., and Bakken, H. (2009). Pair-copula constructions of multiple dependence. Insurance: Mathematics and Economics , 44(2):182 – 198.
- 2Archer et al. (2016) Archer, E., Park, I. M., Buesing, L., Cunningham, J., and Paninski, L. (2016). Black box variational inference for state space models. ar Xiv:1511.07367.
- 3Azzalini and Capitanio (2003) Azzalini, A. and Capitanio, A. (2003). Distributions generated by perturbation of symmetry with emphasis on a multivariate skew t-distribution. Journal of the Royal Statistical Society: Series B (Statistical Methodology) , 65(2):367–389.
- 4Azzalini and Dalla Valle (1996) Azzalini, A. and Dalla Valle, A. (1996). The multivariate skew-normal distribution. Biometrika , 83(4):715–726.
- 5Blei et al. (2017) Blei, D. M., Kucukelbir, A., and Mc Auliffe, J. D. (2017). Variational inference: A review for statisticians. Journal of the American Statistical Association , 112(518):859–877.
- 6Bottou (2010) Bottou, L. (2010). Large-scale machine learning with stochastic gradient descent. In Lechevallier, Y. and Saporta, G., editors, Proceedings of the 19th International Conference on Computational Statistics (COMPSTAT’2010) , pages 177–187. Springer.
- 7Carpenter et al. (2017) Carpenter, B., Gelman, A., Hoffman, M., Lee, D., Goodrich, B., Betancourt, M., Brubaker, M., Guo, J., Li, P., and Riddell, A. (2017). Stan: A probabilistic programming language. Journal of Statistical Software, Articles , 76(1):1–32.
- 8Challis and Barber (2013) Challis, E. and Barber, D. (2013). Gaussian Kullback-Leibler approximate inference. The Journal of Machine Learning Research , 14(1):2239–2286.
