{'fraction_non_alphanumeric': 0.028651949271958667, 'fraction_numerical': 0.013034288398309066, 'mean_word_length': 5.114142139267767, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The joint distribution of pin-point plant cover data : a reparametrized Dirichlet-multinomial distribution

A reparametrized Dirichlet-multinomial distribution is introduced, and the covariance matrix, as well as, the algorithm for calculating the PDF for n species are provided. The distribution is suited for modelling the joint distribution of pin-point cover data of spatially aggregated plant species, and the parametrization ensures that the degree of spatially aggregation is modelled by a parameter and the mean cover of the species is modelled by the other parameters. This last property is convenient for using the distribution in Bayesian hierarchical models where the mean cover of the different species typically is modelled as latent variables.


Introduction
The statistical treatment of whole plant communities with multiple species has traditionally relied on ordination methods that use ad hoc distance measures, e.g. Euclidian or Bray-Curtis distances, to reduce the species by sample abundance matrix into a vector of distances between samples. However, there is an increasing interest in the statistically modelling of species abundance matrices (e.g. Clark et al., 2014, Warton et al., 2015, Ovaskainen et al., 2017. Additionally, it has been suggested that in order to infer ecological processes from observed patterns of species abundance we need to investigate the covariance in species abundance (e.g. Brown et al., 2011) and, if possible, to compare the observed covariance to the expected covariance when spatially aggregated plants associate randomly .
When modelling multi-species pin-point plant cover data, it is important to account for the spatial aggregation that is typically found among plant species, and a reparametrized Dirichlet-multinomial distribution has been suggested for modelling such cover data (Damgaard, 2015, Damgaard & Irvine, Submitted).
The Dirichlet distribution is the conjugate prior of the multinomial distribution, and the Dirichletmultinomial distribution is a multivariate generalization of the beta -binomial distribution, which has been used with success previously to model pin-point cover data of spatially aggregated plant species (Damgaard, 2009, Damgaard, 2013. Previously the reparametrized Dirichlet-multinomial distribution has only been used when the number of species groups were fixed to either four or five aggregated species groups ecosystems (Damgaard, 2015, Damgaard et al., 2017, Damgaard, 2018, and then the general distribution properties and likelihood functions were determined for this a priori fixed number of species groups. However, it is interesting to be able to let e.g. phylogeny, traits, and the response to environmental factors determine the number and composition of species groups (Ovaskainen et al., 2017), and in this case it is necessary to know the properties of the proposed reparametrized Dirichlet-multinomial distribution and be able to calculate the likelihood function distribution function in the general n species case.
The aim of this study is to investigate the properties of the proposed reparametrized Dirichlet-multinomial distribution in the general n species case. More specifically, a graphical interpretations of the parameter that account for the spatial aggregation will be provided, as well as an expressions of the covariance matrix and an algorithm for calculating the probability distribution function in the general n species case.

Statistical model
The measurement of pin-point cover data is a binary event, where a pin in the pin-point frame either touches or does not touch a plant species. A discrete stochastic vector, = ( 1 , … , ), may be defined as the number of pins in a pin-point frame that hit one of n plant species. Typically, a pin will hit more than one species, and the sum of the stochastic vector Y may be larger than the number of pins in a frame. Since the individual plant species are spatially aggregated, the stochastic vector Y is assumed to be Dirichletmultinomial mixture distributed as where model the cover of species i. The parameters are probabilities, and and is defined in the interval ]0, 1[ . At the limit when → 0, the Dirichlet -multinomial distribution degenerate to the multinomial distribution.

Properties of the reparametrized Dirichlet-multinomial distribution
The rationale for using the above reparameterization of the Dirichlet distribution (eq. 1) is that it has the useful property that the mean cover of the species is a parameter in the model, and is a measure of the intra-plot correlation due to spatial aggregation of the plant species (Damgaard, 2015).
The × covariance matrix for the reparametrized Dirichlet distribution for n species is, Thus the effect of increasing the parameter is to increase the variation in cover relative to the multinomial distribution (Fig. 1), and this flexibility provided by the parameter is needed when modelling the cover distribution of spatially aggregated plant species (Damgaard, 2015). The Dirichlet -multinomial distributed model has been applied to model the vegetation dynamics in heathland ecosystems (Damgaard, 2015, Damgaard et al., 2017, Damgaard, 2018.

Algorithm for calculating the PDF
The PDF of the reparametrized Dirichlet -multinomial distribution for n species can be calculated using the following algorithm (written in the notation of a Mathematica function), The above algorithm for calculating the PDF of the Dirichlet -multinomial can easily be adopted into other programming languages, and the following example calculations is provided for check.  (Carpenter et al., 2017).

When fitting a linear model to the mean cover of several species
When a linear model with several independent explaining variables is fitted to the mean cover of several species, then the linear model has to satisfy the constraints that > 0 for all i, and ∑ < 1. In the single species case this is usually obtained by transforming the linear model with the inverse logit function.
However, when the mean cover of several species are modelled it may be an advantage to modify the inverse logit transformation so that (0) = 1/ instead of 0.5.
For example, when = 4, then ( ) = 0.322 0.33+Exp [− ] + 0.01 may be used instead of the standard the inverse logit function. This will ensure that the above mentioned constraints on are met, when the parameters in the linear model is initialized to zero, e.g. in the beginning of an MCMC sampling procedure.

Discussion
When modelling empirical plant abundance data it is critical to take the spatial aggregation, which is typically observed among plant species, into account (Damgaard & Irvine, Submitted), and in the suggested reparametrized Dirichlet -multinomial distribution this is done by the parameter , which increases with the within-site spatial variation in cover, i.e. the degree of spatial aggregation.
The parameters in the suggested reparametrized Dirichlet -multinomial distribution model the mean cover of species i. This is a convenient property when using hierarchical Bayesian models, where the mean cover of the different species typically is modelled as latent variables (Damgaard, 2015, Damgaard et al., 2017, Damgaard, 2018. Furthermore, the Dirichlet-multinomial distribution is the marginal joint posterior distribution of multinomial distributed categorical observations, where the multinomial probability parameters are integrated out, which makes it possible to construct relatively fast MCMC sampler, e.g. by using Gibbs sampling. The proposed parameterization of the Dirichlet distribution may be regarded as a null model for patchy and independently distributed plant species. However, it is possible to loosen the assumption of independence if plant abundance is modelled by common covariates, in which case within-plot positive covariation among species may be modelled (Hijazi & Jernigan, 2009).
When the mean cover of several species are modelled using a linear model it may be an advantage to choose initial parameter values so that the model effect is close to zero.
The presented results for the general n species case will enable the use of the reparametrized Dirichletmultinomial distribution in the interesting case when the number of species groups are determined by the phylogeny, traits, and the response to environmental factors of the observed plant communities (Ovaskainen et al., 2017).
It is the hope that this account will facilitate the application of the reparametrized Dirichlet-multinomial distribution.