Full text
properties of a square root transformation regression model J. L. Scealy1and A. H. Welsh1 1Centre for Mathematics and its Applications- Australian National University, Australia [email protected] We consider the problem of modelling the conditional distribution of a response given a vector of covariates xwhen the response is a compositional data vector u. That is, uis defined on the unit simplex ∆p−1={(u1, u2, . . . , up)T:ui≥0 (i= 1,2, . . . , p), p X i=1 ui= 1}. This definition of the unit simplex differs subtly from that of Aitchison (1982), as we relax the condition that the components of umust be strictly positive. Under this scenario, use of the ratio (or logratio) to compare different compositions is not ideal since it is undefined in some instances, and subcompositional analysis is also not appropriate due to the possibility of division by zero. It has long been recognised that the square root transformation y=√u= (√u1,√u2,...,√up)T transforms compositional data (including zeros) onto the surface of the (p−1)-dimensional hypersphere (see for example Mardia and Jupp (2000), page 160) and that this opens the possibility of using distributions for directional data to model compositional data. One advantage of this approach over the logratio approach is that zero components are catered for naturally in the models. Stephens (1982) modelled yby a p-dimensional von Mises-Fisher distribution and Wang et. al. (2007) recently described an ad hoc approach to modelling y. Scealy and Welsh (2011) proposed the Kent distribution to model yand the advantage of this approach is that unlike the von Mises-Fisher distribution, the Kent distribution has a sufficiently general covariance structure. In this talk we first summarise the additive and multiplicative Kent regression models for compositional data proposed by Scealy and Welsh (2011) and describe some of the properties of these models. The two Kent regression models are named ‘additive’ and ‘multiplicative’ because in these models the square root of the additive and multiplicative logistic transformations (Aitchison, 1986, pages 113 and 131) is respectively applied to link the mean direction of the Kent distribution with p−1 linear functions of x. We then compare the logratio approach with the square root transformation approach and show that in certain cases the analysis based on the Kent distribution will work better than the logistic normal compositional models of Aitchison (1986), even when there are no zero components in u. In summary, the additive Kent regression model has a permutation equivariance property and the multiplicative Kent regression model has an asymptotic (large concentration) amalgamation property similar to Aitchison (1986, Property 6.12(a), page 132). The square root transformation method can therefore lead to models with nice properties, and similar to Aitchison’s logratio transformations, the square root transformation is also scale invariant. 1 The Kent Distribution We begin by summarising the Kent distribution and its properties. For further details see Kent (1982) and Mardia and Jupp (2000). Let Sp−1={y∈Rp:kyk= 1}denote the unit hypersphere in Rp. The Kent distribution for general p≥3 is defined by the density f(y) = c(κ, β)−1exp[κµTy+β2{γT 2y}2+. . . +βp−1{γT p−1y}2−(β2+. . . +βp−1){γT py}2], for y= (y1, y2, . . . , yp)T∈Sp−1, which contains a total of p(p−1) 2location parameters and p−1 scalar shape parameters. In total the Kent distribution contains the same number of parameters as the p−1 dimensional normal distribution. We assume κ > 0 is a shape parameter specifically describing the concentration and β= (β2, . . . , βp−1)T∈Rp−2are also shape parameters, but defined according to κ 2> β2≥β3≥. . . ≥βp−1≥ −(β2+β3+. . . +βp−1).(1) 1 Proceedings of the 4th International Workshop on Compositional Data Analysis (2011) Egozcue, J.J., Tolosana-Delgado, R. and Ortego, M.I. (eds.) ISBN: 978-84-87867-76-7 1
The normalising constant in the density is denoted by c(κ, β), which is a function of the shape parameters only. The p(p−1) 2location parameters are associated with a p×porthogonal matrix Γ= (µ,γ2,...,γp), where µ∈Sp−1is the mean direction and the vectors γ2,γ3, . . . γpare the set of principal axes orthogonal to µ. It is useful to further parametrise Γby writing Γ=HK = (µ,H∗K∗), where H= (µ,H∗) and K=10T 0K∗ are both p×porthogonal matrices. The matrix His a function of µonly and the (p−1) ×(p−1) matrix K∗is a function of (p−1)(p−2)/2 scalar parameters. The transformation y∗=ΓTyis called the population standardising transformation because its density is a function of the shape parameters only and hence y∗= (y∗ 1, y∗ 2, . . . , y∗ p)T∈Sp−1can be regarded as a standardised form of the Kent distribution. For the Kent distribution, E (y) = µE (y∗ 1) and E (yyT) = Γdiag E (y∗2 1),E (y∗2 2), ..., E (y∗2 p)ΓT,(2) where diag(w) is the diagonal matrix with the vector won the diagonal and hence µcan be interpreted as the mean direction. 2 Regression Models In this section we summarise the Kent regression models that were proposed by Scealy and Welsh (2011). Suppose we have vector responses {yi∈Sp−1:i= 1, . . . , n}associated with a set of covariates {xi∈Rq:i= 1, . . . , n}. It is assumed that the responses are conditionally independent given the covariates and are distributed according to the Kent distribution. In a regression setting we could have all or only a subset of the model parameters dependent on x. The models of Scealy and Welsh assume µ=µ(x) is a function of xonly, with the remaining parameters κ,βand K∗being constant and not dependent on x. Note that this is arguably the most natural and straight forward approach and is analogous in a sense to modelling the mean of a multivariate normal vector as a function of x and assuming the covariance matrix is constant. 2.1 The Additive Kent Regression Model The additive Kent regression model links µto p−1 linear functions of xby using the square root of the additive logistic transformation. That is, µi(x) = 1 + Pp−1 j=1 exp aT jx−1 2i= 1 exp aT i−1x 21 + Pp−1 j=1 exp aT jx−1 2i= 2,3, ..., p, (3) where µi(x) is the ith component of µ(x) and a=aT 1,aT 2,...,aT p−1Tis a q(p−1) dimensional vector of regression coefficients defined on Rq(p−1). In a regression context H=H(x), and a symmetric choice of H(x) is H(x) = µ1µL(x)T µL(x)H∗ L(x)=µ1(x)µL(x)T µL(x)1 1+µ1(x)µL(x)µL(x)T−Ip−1,(4) where Ip−1is the (p−1) ×(p−1) identity matrix and µL(x) = (µ2(x), µ3(x), ..., µp(x))T. As proved by Scealy and Welsh (2011), this choice of H(x) is unique in the sense that it is the only possible Proceedings of the 4th International Workshop on Compositional Data Analysis (2011) Egozcue, J.J., Tolosana-Delgado, R. and Ortego, M.I. (eds.) ISBN: 978-84-87867-76-7 2
symmetric orthogonal matrix with first column µ(x) and with a symmetric non-indefinite value of H∗ L(x). The additive Kent regression model is defined using (3) and (4). As Scealy and Welsh (2011) proved, this model has a permutation equivariance property. That is, let A=a1a2··· ap−1T and let y(C)=Cy be a permutation of ythat leaves y1fixed (only (y2, y3, ..., yp)Tgets permuted). Then y(C)follows an additive Kent regression model with Aand K∗both permuted, and unchanged shape parameters. 2.2 The Multiplicative Kent Regression Model The multiplicative Kent regression model links µto p−1 linear functions of xby using the square root of the multiplicative logistic transformation. That is, µi(x) = exp aT ix 2Qi j=1 1 + exp aT jx−1 2i= 1,2, ..., p −1 Qp−1 j=1 1 + exp aT jx−1 2i=p. (5) or equivalently µi(x) = cos {α1(x)}i= 1 Qi−1 j=1 sin {αj(x)}cos {αi(x)}i6= 1, i6=p−1, i6=p Qp−2 j=1 sin {αj(x)}cos {αp−1(x)}i=p−1 Qp−2 j=1 sin {αj(x)}sin {αp−1(x)}i=p, (6) where αj(x) = arctan exp −(aT jx) 2!! for j= 1,2, . . . , p −1, and the arctan function is defined on −π 2,π 2. For the multiplicative Kent regression model, H(x) is defined using a non-symmetric matrix as follows. Let Rij (α) be a p×pplane rotation matrix, that is Rij (α) is the p×pidentity matrix with the (i, i), (i, j), (j, i) and (j, j) elements replaced by cos α, −sin α, sin αand cos αrespectively. Then let H(x) = R(p−1)(p)(αp−1(x)) R(p−2)(p−1) (αp−2(x)) ···R12 (α1(x)) .(7) The advantage of this choice is that it contains the smallest number of plane rotation matrix products resulting in first column equal to µ(x) from (5). The multiplicative Kent regression model has an asymptotic (large κ) amalgamation property similar to Aitchison (1986, Property 6.12 (a), page 132). That is, assume that yfollows a p−dimensional multiplicative Kent regression model, then for large κthe amalgamation ya= (y1, y2, ..., yq,qy2 q+1 +... +y2 p)T is distributed the same as a (q+ 1)-dimensional multiplicative Kent regression model. See Scealy and Welsh (2011) for further details about asymptotic large κproperties of the Kent regression models. 3 Comparing the Square Root and the Logratio Transformation Approaches The logratio transformation approach is one of the most widely used techniques for analysing compositional data. In particular, the additive logratio transformation defined by ˘yj= log uj+1 u1 , j = 1,2, . . . , p −1,(8) Proceedings of the 4th International Workshop on Compositional Data Analysis (2011) Egozcue, J.J., Tolosana-Delgado, R. and Ortego, M.I. (eds.) ISBN: 978-84-87867-76-7 3
where ˘ y= (˘y1,˘y2,...,˘yp−1)T∈Rp−1, is often applied. The standard approach is to then assume ˘ y has a p−1 dimensional normal distribution, which results in uhaving an additive logistic normal distribution (Aitchison, 1986, page 113) and estimation of model parameters is straightforward. The square root transformation y=√utransforms compositional data onto the unit hypersphere in Rpand we assume uhas a squared Kent distribution. One advantage of this approach is that it handles zeros, however there are two issues which are pointed out by Scealy and Welsh (2011): (a) The normalising constant c(κ, β) does not exist in a convenient form and involves multidimensional integrals which are difficult to evaluate when pis not small. (b) The square root transformation maps compositional data directly onto the positive orthant of the hypersphere only. When the components of uare distributed close to the boundaries, the fitted Kent model may have significant support outside the positive orthant. To overcome issue (b), we could instead assume √ufollows a folded Kent distribution on the positive orthant (i.e. if yhas a Kent distribution, then |y|= (|y1|,|y2|, ..., |yp|)Thas a folded Kent distribution). However, the folded Kent distribution in p−dimensions is difficult to work with. As Scealy and Welsh (2011) mentioned, in many applications we expect the majority of the data to be distributed away from the boundaries 0 and 1, and as a consequence the concentration parameter κwill also be at least moderately large. This justifies the use of large κapproximations to address issues (a) and (b). That is, for large κthe folding can be effectively ignored in estimation and an approximation for the normalising constant is also available (see Scealy and Welsh (2011) for further details). We now demonstrate a particular situation where the squared Kent distribution will work better than the logistic normal distribution. Suppose we have a compositional data sample and we observe that a component √u1appears to have a mean close to zero with only a small amount of folding present (the distribution is roughly symmetric looking). In this situation the square root transformation coupled with the Kent distribution will be a reasonable approach and from the large κresults in Scealy and Welsh (2011), it follows that √u1is approximately normal with small mean and variance. We now undertake a simulation study to compare the logratio approach with the square root transformation approach under this scenario. First, we simulate 10,000 √u1observations from the folded normal distribution with mean 0.03 and standard deviation 0.01. Plots 1 and 2 in Figure 1 contain a histogram and boxplot of √u1. We then apply the logratio transformation ˘y1= log 1−u1 u1and plots 3 and 4 contain the resulting histogram and boxplot of ˘y1. The treatment of ˘y1as normal is not sensible here since the distribution is highly skewed. The problem is that values of u1near zero which are close to each other on the original scale, are quite far apart on the logratio scale. We now consider the scenario where u1is not distributed close to zero and repeat the above simulation but use a mean of 0.1 instead of 0.03. Figure 2 contains the resulting histograms and boxplots of √u1and ˘y1. In this case, both distributions look roughly symmetric and either the logratio or the square root transformation may be appropriate. The differences between the two approaches becomes more apparent when the data is distributed closer to the boundaries. The square root transformation has some nice properties and as we will show, adheres to two out of the three principles of compositional data analysis described by Egozcue (2009). Consider the following definition of the simplex (in the abstract we set c= 1) ∆p−1={(u1, u2, . . . , up)T:ui≥0 (i= 1,2, . . . , p), p X i=1 ui=c},(9) where c > 0 is a known constant. In this case the square root transformation is y=1 √u1+u2+... +up√u1,√u2, ..., √upT, which is always defined since cis assumed greater than zero. This transformation is permutation invariant (see Egozcue (2009) for a definition) and it is also scale invariant since y(λu) = y(u) for λ > Proceedings of the 4th International Workshop on Compositional Data Analysis (2011) Egozcue, J.J., Tolosana-Delgado, R. and Ortego, M.I. (eds.) ISBN: 978-84-87867-76-7 4
plot 1 Frequency 0.00 0.02 0.04 0.06 0100 200 300 400 0.00 0.02 0.04 0.06 plot 2 plot 3 Frequency 510 15 20 0500 1500 2500 510 15 20 plot 4 Figure 1: Histograms and boxplots of simulated √u1and ˘y1values for mean 0.03. plot 1 Frequency 0.06 0.08 0.10 0.12 0.14 0200 400 600 800 0.06 0.08 0.10 0.12 plot 2 plot 3 Frequency 4.0 4.5 5.0 5.5 0200 400 600 800 4.0 4.5 5.0 5.5 plot 4 Figure 2: Histograms and boxplots of simulated √u1and ˘y1values for mean 0.1. Proceedings of the 4th International Workshop on Compositional Data Analysis (2011) Egozcue, J.J., Tolosana-Delgado, R. and Ortego, M.I. (eds.) ISBN: 978-84-87867-76-7 5
0. The square root transformation therefore satisfies two of the compositional data analysis principles. The third principal called compositional coherence is violated due to the fact that subcompositions are not compatible with our definition of the simplex given at (9). That is, suppose u1= 0 and u2= 0, then the subcomposition u1 u1+u2 ,u2 u1+u2T is undefined and is not in ∆1since u1+u2= 0 (recall that c > 0 in definition (9)). For predictive purposes it is of interest to estimate the quantity E (u). In the case of the squared Kent distribution, it follows from (2) that E (u) = Γ2Ey∗2, where the squared operation on the above matrix and vector is a component wise square. This expectation can be estimated directly by plugging in estimates of the model parameters (see Scealy and Welsh (2011) for further details). However, in the case of the logistic normal distribution, estimation of E (u) is not so straightforward. Suppose we apply the additive logratio transformation (8) and assume ˘ y∼Np−1(b,Σ) and let ˆ band ˆ Σbe estimates of the mean band covariance matrix Σrespectively. Then, to avoid backtransformation bias, we need to compute the following integrals E (u1) = ZRp−1 1 1 + Pp−1 m=1 exp (˘ym)f(˘ y)d˘ y, and for j= 2,3, ...p E (uj) = ZRp−1 exp (˘yj−1) 1 + Pp−1 m=1 exp (˘ym)f(˘ y)d˘ y, where f(˘ y) is the multivariate normal density of ˘ y. Note that an estimate of E (u) is obtained by plugging in ˆ band ˆ Σin f(˘ y). These multidimensional integrals are difficult to evaluate when pis not small, and we need to use for example Monte Carlo methods to compute these which is a disadvantage. One other major issue with the logratio transformation is that it does not allow any zero components in the compositions. To apply the logratio approach in this case, we could adopt one of the strategies suggested by Aitchison (1986, pages 266-274), namely collapsing categories, modelling zeros separately or replacing zeros by small positive values. In general collapsing categories is not ideal due to the fact that information is lost during this process. Aitchison and Kay (2004) considered modelling zeros separately, but as these authors stated the computations needed are awkward (for example, some multidimensional integrals need to be computed using a MCMC approach). Zero replacement strategies for rounded zeros have been considered by various authors (for example, see Fry et. al. (2000), Mart´ın-Fern´andez et. al. (2003) and Palarea-Albaladejo et. al. (2007)). These zero replacement strategies are imputation methods and the drawback is that by treating the zeros as missing values, imputation variance is introduced which will ultimately affect estimates of both band Σ. Notice that E (u) in the logistic normal distribution case is a function of both band Σ, and the estimator of E (u) relies on having good estimates of both band Σavailable. 4 An Example We now compare the logratio approach with the square root transformation approach using Data 34 from Appendix D of Aitchison (1986). Aitchison (1986) used this dataset to demonstrate a zero replacement strategy since 5 out of 30 observations contained a zero component. Bacon-Shone (1992), Mart´ın-Fern´andez et. al. (2003) and Scealy and Welsh (2011) also analysed this dataset and used it to compare different methodologies. This dataset consists of foraminifer, a marine micro-organism, at 30 different depths and contains p= 4 components. Figure 3 contains plots of √u1,√u2,√u3and √u4versus depth (the ordering of the components is the same as given in Appendix D of Aitchison (1986)). Interestingly, there appears to be an outlier for √u4(observation 24 appears to be far away from the rest of the data). Scealy and Welsh (2011) Proceedings of the 4th International Workshop on Compositional Data Analysis (2011) Egozcue, J.J., Tolosana-Delgado, R. and Ortego, M.I. (eds.) ISBN: 978-84-87867-76-7 6
0510 15 20 25 30 0.65 0.75 0.85 N. atlantica depth u1 0510 15 20 25 30 0.3 0.4 0.5 0.6 0.7 N.pachyderma depth u2 0510 15 20 25 30 0.0 0.1 0.2 0.3 0.4 0.5 G. obesa depth u3 0510 15 20 25 30 0.0 0.1 0.2 0.3 0.4 0.5 G. triloba depth u4 Figure 3: Plots of √u1,√u2,√u3and √u4versus depth. also identified this observation as an outlier, but Aitchison (1986), Bacon-Shone (1992) and Mart´ın- Fern´andez et. al. (2003) did not. We suspect that the G. obsea and G. triloba proportions may have been swapped by mistake for observation 24. If we make this swap, then there appears to be a relationship between √u4and depth (√u4appears to decrease with depth). Both √u3and √u4are distributed close to zero and the distributions look roughly symmetric about the means, implying that the square root transformation methodology of Scealy and Welsh (2011) is reasonable for this dataset. Scealy and Welsh (2011) applied the multiplicative Kent regression model to this example dataset and showed that the model appeared to fit the data well. Here we apply the additive Kent regression model instead and we model the mean direction µ(x) using µ1(x) = 1 1 + P3 j=1 exp (aj1+aj2x)1 2 , µ2(x) = exp a11+a12x 2 1 + P3 j=1 exp (aj1+aj2x)1 2 , µ3(x) = exp a21+a22 x 2 1 + P3 j=1 exp (aj1+aj2x)1 2 ,and µ4(x) = exp a31+a32 x 2 1 + P3 j=1 exp (aj1+aj2x)1 2 , where xrepresents depth and a11,a12,a21,a22,a31 and a32 are six scalar regression coefficients. We estimate the parameters associated with this additive Kent regression model by applying the estimation techniques in Scealy and Welsh (2011). Note that before fitting the model we corrected the suspected typo in observation 24. After fitting the model, a22 did not appear to be significant and so it was removed, and then the model was refitted with the remaining five regression coefficients only. Figure 4 contains plots of the observed values of uversus depth and the lines on the plots are the estimates of E (u|x) (the correction to observation 24 has also been implemented in the plots). The estimates of E (u|x) are very similar to those obtained by Scealy and Welsh (2011) in the case of the multiplicative Kent regression model and therefore the additive Kent regression model also appears to fit this data. An alternative approach is to fit linear models to the additive logratio transformed data, however in order to apply this approach we need to somehow eliminate the zeros first. To do this we apply the multiplicative zero replacement strategy suggested by Mart´ın-Fern´aadez et. al. (2003), page 262 and Proceedings of the 4th International Workshop on Compositional Data Analysis (2011) Egozcue, J.J., Tolosana-Delgado, R. and Ortego, M.I. (eds.) ISBN: 978-84-87867-76-7 7
0510 15 20 25 30 0.4 0.5 0.6 0.7 0.8 N. atlantica depth u1 0510 15 20 25 30 0.1 0.2 0.3 0.4 0.5 N. pachyderma depth u2 0510 15 20 25 30 0.00 0.10 0.20 0.30 G. obesa depth u3 0510 15 20 25 30 0.00 0.04 0.08 0.12 G. triloba depth u4 Figure 4: Plots of u1,u2,u3and u4versus depth. 0510 15 20 25 30 -2.0 -1.0 0.0 depth logratio 1 0510 15 20 25 30 -8 -6 -4 -2 0 δj=0.005 depth logratio 2 0510 15 20 25 30 -8 -6 -4 -2 0 depth log ratio 3 0510 15 20 25 30 -2.0 -1.0 0.0 depth logratio 1 0510 15 20 25 30 -8 -6 -4 -2 0 δj=0.001 depth logratio 2 0510 15 20 25 30 -8 -6 -4 -2 0 depth log ratio 3 0510 15 20 25 30 -2.0 -1.0 0.0 depth logratio 1 0510 15 20 25 30 -8 -6 -4 -2 0 δj=1e-04 depth logratio 2 0510 15 20 25 30 -8 -6 -4 -2 0 depth log ratio 3 Figure 5: Plots of ˘y1, ˘y2, ˘y3versus depth. Proceedings of the 4th International Workshop on Compositional Data Analysis (2011) Egozcue, J.J., Tolosana-Delgado, R. and Ortego, M.I. (eds.) ISBN: 978-84-87867-76-7 8
hence we replace uby r= (r1, r2, ..., rp) using rj=(δj,if uj= 0, (1 −Pk|uk=0 δk)uj,if uj>0. If we assume that the zero’s are a result of rounding error and are not essential zeros, then each δjis in the range (0,0.005). Figure 5 contains plots of the additive logratios versus depth for three different choices of δj(i.e. δj= 0.005, δj= 0.001 and δj= 0.0001). If δjis in the range [0.001,0.005] and if we correct observation 24, then the following linear model is plausible (˘y3appears to roughly decrease linearly with depth) ˘y3=b31 +b32x+3,(10) where 3∼N(0, σ2) and b31 and b32 are scalar regression coefficients. However, the assumption that each δj≥0.001 is very strong and it is still plausible that the correct values of δjare in the range [0,0.001]. That is, some of the five zero components may represent a complete absence or near absence of the species at the depth measured. If this is the case, then model (10) should not be fitted. The advantage of the Kent regression model approach over the logratio approach is that it does not lead to introducing additional uncertainties by having to impute δj. 5 Conclusion As we have shown, the square root transformation approach has some nice properties and will work better than the logratio approach in certain situations such as when the compositional data is distributed close to the boundaries of the simplex. As we demonstrated, the square root transformation model fit the example dataset well and by comparison, the logratio approach was much more problematic to implement due to the presence of zeros. Future research will involve exploring the folding issue further and to extend the Kent regression model to other scenarios such as the case where we have correlated compositional data or where κ,β and K∗also depend on x. References Aitchison, J. (1982). The Statistical Analysis of Compositional Data (with discussion). Journal of the Royal Statistical Society Series B 44, 139–177. Aitchison, J. (1986). The Statistical Analysis of Compositional Data. Monographs on Statistics and Applied Probability. Chapman & Hall Ltd., London (UK). Aitchison, J. and Kay, J. W. (2004). Possible solutions of some essential zero problems in compositional data analysis. In: Thi´o-Henestrosa S, Mart´ın-Fern´andez JA (eds). Compositional data analysis workshop, Girona, Spain. http://ima.udg.es/Activitats/CoDaWork03/. Bacon-Shone, J. (1992). Ranking methods for compositional data. Applied Statistics 41:3, 533-537. Egozcue, J. J. (2009). Reply to “On the Harker Variation Diagrams;...” by J. A. Cort´es. Math Geosci 41, 829–834. Fry, J. M., Fry, T. R. L. and McLaren, K. R. (2000). Compositional data analysis and zeros in micro data. Applied Economics. 32:8, 953-959. Kent, J. T. (1982). The Fisher-Bingham Distribution on the Sphere. Journal of the Royal Statistical Society Series B 44, 71–80. Mardia, K. V. and Jupp, P. E. (2000). Directional Statistics. John Wiley & Sons, LTD. Proceedings of the 4th International Workshop on Compositional Data Analysis (2011) Egozcue, J.J., Tolosana-Delgado, R. and Ortego, M.I. (eds.) ISBN: 978-84-87867-76-7 9