scieee AI-readable full text Open interactive document viewer

Mixture of experts distributional regression: implementation using robust estimation with adaptive first-order methods

Rügamer, David,Pfisterer, Florian,Bischl, Bernd,Grün, Bettina

Abstract

EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.

Full text

Rügamer, David; Pfisterer, Florian; Bischl, Bernd; Grün, Bettina Article — Published Version Mixture of experts distributional regression: implementation using robust estimation with adaptive first-order methods AStA Advances in Statistical Analysis Provided in Cooperation with: Springer Nature Suggested Citation: Rügamer, David; Pfisterer, Florian; Bischl, Bernd; Grün, Bettina (2023) : Mixture of experts distributional regression: implementation using robust estimation with adaptive firstorder methods, AStA Advances in Statistical Analysis, ISSN 1863-818X, Springer, Berlin, Heidelberg, Vol. 108, Iss. 2, pp. 351-373, https://doi.org/10.1007/s10182-023-00486-8 This Version is available at: https://hdl.handle.net/10419/317996 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. http://creativecommons.org/licenses/by/4.0/ Vol.:(0123456789) AStA Advances in Statistical Analysis (2024) 108:351–373 https://doi.org/10.1007/s10182-023-00486-8 1 3 ORIGINAL PAPER Mixture ofexperts distributional regression: implementation using robust estimation withadaptive first‑order methods DavidRügamer1,2,3 · FlorianPfisterer1,3· BerndBischl1,3· BettinaGrün4 Received: 17 November 2022 / Accepted: 24 October 2023 / Published online: 15 November 2023 © The Author(s) 2023 Abstract In this work, we propose an efficient implementation of mixtures of experts distributional regression models which exploits robust estimation by using stochastic first-order optimization techniques with adaptive learning rate schedulers. We take advantage of the flexibility and scalability of neural network software and implement the proposed framework in mixdistreg, an R software package that allows for the definition of mixtures of many different families, estimation in high-dimen- sional and large sample size settings and robust optimization based on TensorFlow. Numerical experiments with simulated and real-world data applications show that optimization is as reliable as estimation via classical approaches in many different settings and that results may be obtained for complicated scenarios where classical approaches consistently fail. Keywords Mixture models· Deep learning· Structured additive regression· Neural networks * David Rügamer [email protected] Florian Pfisterer [email protected] Bernd Bischl bernd.bisc[email protected] Bettina Grün bettina.gr[email protected] 1 Department ofStatistics, LMU Munich, Munich, Germany 2 Department ofStatistics, TU Dortmund, Dortmund, Germany 3 Munich Center forMachine Learning, Munich, Germany 4 Institute forStatistics andMathematics, WU Vienna, Vienna, Austria 352 D.Rügamer et al. 1 3 1 Introduction Mixture models are a common choice to model the joint distribution of several subpopulations or subclasses on the basis of data from the pooled population where the subclass memberships are not observed (for an introduction see McLachlan and Peel 2004). Each subclass is assumed to follow a parametric probability distribution such that the pooled observations are from a mixture of these distributions. Many applications of mixture models aim at estimating the distributions of the latent subclasses and identifying subclass memberships of the observations (McLachlan etal. 2019). Mixture models have also been used in machine learning, e.g., for clustering (Viroli and McLachlan 2019), to build generative models for images (Van den Oord and Schrauwen 2014) or as a hybrid approach for unsupervised outlier detection (Zong etal. 2018). Different kinds of mixture models are used depending on the available data structure and the parametric model which is assumed for each subpopulation or subclass. In the following, we assume a supervised learning task and that regression models are used to model the subpopulations. This leads to mixture regression models which define a mixture of (conditional) models for the outcome of interest, where the mixture components are still unknown and thus considered latent variables. This model class is also referred to as mixtures of experts (Gormley and Frühwirth-Schn- atter 2019). Mixtures of experts allow for the inclusion of covariates when modeling the mixture components as well as for the mixture weights. In the following, we consider a mixture of experts model where the regression models do not only include the mean parameter but also other distributional parameters that may depend on the covariates or features. In addition, we assume that the subpopulation sizes vary with covariates (or features). This leads to the class of mixture of experts distributional regression models. 1.1 Mixture models andtheir estimation As for classical statistical regression models, the goal of mixtures of regressions or mixture regression models is to describe the conditional distribution of a response (or outcome), conditional on a set of covariates (or features). Mixtures of regressions have been first introduced by Quandt (1958) under the term switching regimes where only two-component mixtures of linear regression models were considered, i.e., the number of subclasses was fixed to two. This was extended to general mixtures of linear regression models by DeSarbo and Cron (1988) who referred to this approach as a model-based version of clusterwise regression (Späth 1979). The extension to mixtures of generalized linear regression models was proposed in Wedel and DeSarbo (1995). Aiming for a setting beyond mean regression (Kneib 2013), a distributional regression setting can be used such as generalized additive models for location, scale and shape (GAMLSS; Rigby and Stasinopoulos 2005) which also allow for nonlinear smooth relationships between covariates and the distributional parameter of interest (Stasinopoulos etal. 2018). 353 1 3 Mixture ofexperts distributional regression: implementation… Mixture models can be estimated using various techniques, with the expectation–maximization (EM) algorithm based on the maximum-likelihood principle being the most prominent one. Other approaches include Bayesian methods such as MCMC algorithms with data augmentation (Diebolt and Robert 1994). An alternative way of model specification and estimation was proposed by Bishop (1994) who introduced mixture density networks (MDNs). MDNs use a mixture of experts distributional regression model specification. But the relationship between the covariates (or features) and the mixture weights or the distributional regression models is learned using a neural network. The training of MDNs is done using highly optimized stochastic gradient descent (SGD) routines with adaptive learning rates and momentum. These procedures have proven to be very effective in the optimization of large neural networks with millions of parameters and complex model structures. While often MDNs are advantageous in terms of prediction performance, they lack interpretability as the relationship between inputs (features) and distribution parameters is modeled by a deep neural network. 1.2 Our contribution 1.2.1 Novel modeling approach In this work, we combine the ideas of interpretable mixtures of regression models and MDNs to allow for a mixture of experts distributional regression models in a very general setup. In particular, this approach enables modeling mixtures of subpopulations where the distribution of every subpopulation is modeled using a distributional regression. Predictors of every distribution parameter in every subpopulation can be defined by linear effects or (tensor product) splines and thereby allow not only for complex relationships between the features and the distributions’ mean but also for other distribution characteristics such as scale or skewness. Furthermore, the subpopulation sizes may vary with features in a flexible way using again a combination of linear effects as well as (tensor product) splines. 1.2.2 Robust estimation Estimating mixture regression models within a maximum-likelihood framework on the basis of the EM algorithm works well for smaller problems. However, higherdimensional settings where the number of parameters is similar to or exceeds the number of observations are often infeasible to estimate. In fact, the convergence and stability of classical algorithms are more and more adversely affected by an increase in model complexity. Maximum-likelihood estimation of distributional regression models itself induces a non-convex optimization problem in all but special cases. Thus, extending mixtures of mean regression models to mixtures of distributional regression models further complicates the optimization. In this work, inspired by MDNs, we suggest and analyze the usage of stochastic first-order optimization techniques using adaptive learning rate schedulers for (regularized) maximum-likelihood estimation. Our results show that this 354 D.Rügamer et al. 1 3 approach is as reliable as estimation via classical approaches in many different settings and even provides estimation results in complex cases where classical approaches consistently fail. 1.2.3 Flexible andscalable implementation Common implementations of EM optimization routines are limited in their flexibility to specify a mixture of (many) potentially different distributions but in general focus on the case where all components have a parametric distribution from the same distributional family. Another (computational) limitation of existing approaches is faced for large amounts of data (observations) as methods usually scale at least quadratic in the number of observations. On the other hand, SGD optimizers from the field of deep learning are trained on mini-batches of data allowing large dataset applications and the use in a generic fashion for all model classes. We take advantage of this flexibility and scalability and implement the fitting of the proposed model class using mixdistreg, an R (R Core Team 2022) software package based on the R package deepregression (Rügamer etal. 2023) that allows for the definition of mixtures with components from many different distributional families, estimation in high-dimensional and large sample size settings and robust optimization based on the deep learning platform TensorFlow (Abadi etal. 2015). In order to use TensorFlow within R, the package reticulate (Ushey etal. 2022) is used to connect R to Python (Van Rossum and Drake Jr 1995). 1.2.4 Summary ofour approach andoverview onthepaper structure Our framework unites neural density networks (Magdon-Ismail and Atiya 1998) with (distributional) regression approaches, extends MDNs by incorporating penalized smooth effects and comprises various frameworks proposed in the statistical community such as Leisch (2004); Grün and Leisch (2007); Stasinopoulos and Rigby (2007) to estimate mixtures of linear, generalized linear, generalized additive or distributional regression models. In contrast to many existing approaches, our framework further allows to estimate the mixture weights themselves on the basis of an additive structured predictor. We refer to this combination of the model class of mixtures of experts distributional regression with structured additive predictors and the estimation using neural network software as the neural mixture of experts distributional regression (NMDR) approach. The remainder of this paper is structured as follows. In Sect.2, we present our model definition. In Sect.3, we introduce the architecture for SGD-based optimization in neural networks and discuss penalized estimation approaches including mixture sparsification. We then demonstrate the framework’s properties using extensive numerical experiments in Sect.4 and its application to real-world data in Sect.5. We conclude with a discussion in Sect.6. 355 1 3 Mixture ofexperts distributional regression: implementation… 2 Methodology Our goal is to model the conditional distribution of Y∣x where Y is the univariate outcome (or response) of interest. We assume that Y∣x∼F , where F is a mixture of parametric distributions Fm,m∈{1, …,M} =∶ M . These distributions, in turn, depend on unknown parameters 𝜽m(x)∈ ℝ km that are influenced by a set of features (or covariates) x∈ℝp . Furthermore, the nonnegative mixture weights are also allowed to depend on features (or covariates) x∈ℝp such that 𝜋m(x) for all m=1, …,M with ∑M m=1 𝜋 m (x)= 1 . 2.1 Model definition For an observation y in (a suitable subset of) ℝ constituting the support from the conditional distribution of Y∣x , we define the conditional density by i.e., by a mixture of density functions fm of the distributions Fm . Each component density fm has its own km distribution parameters 𝜽m =(𝜃 m,1 ,…,𝜃 m,km ) ⊤ . 𝜋m∈[0, 1] are the mixture weights with ∑M m=1 𝜋 m = 1 . The vector 𝝑=(𝜽⊤ ,𝝅⊤)⊤∈ ℝ K+M with K = ∑M m=1 k m comprises all distribution parameters 𝜽=(𝜽1,…,𝜽M)⊤ and all mixture weights 𝝅=( 𝜋 1,…, 𝜋 M)⊤ . Each of the parameters 𝜗j in 𝝑 is assumed to depend on the features x through an additive predictor 𝜂j,j=1, …,K+M . For the distribution parameters 𝜽, a monotonic and differentiable function hj,j=1, …,K, is assumed to provide a map between the additive structured predictor and the distribution parameter, i.e., 𝜗j=hj(𝜂j(x)) . The parameter-free transformation function hj ensures the correct domain of each 𝜗j . For example, if 𝜗j represents a scale parameter the function, hj ensures that 𝜗j is positive while the additive predictor 𝜂j may take arbitrary values in ℝ . For the mixture weights, 𝝅 a single monotonic and differentiable function hK+1 is assumed to map the M additive predictors to the (M−1) -dimensional simplex, i.e., hK+1 maps ℝM → [0, 1]M under the condition that the sum of the weights is 1. This links the last M additive predictors 𝜼𝜋∶= ( 𝜂 K+1,…, 𝜂 K+M)⊤ to the set of mixture weights 𝝅 . The most common choice in this respect for hK+1 is the softmax function with (1) fY∣x(y∣𝝑(x)) = M ∑ m=1 𝜋m(x)fm(y∣𝜽m(x)) , hK+1(𝜼𝜋)=(softmax1(𝜼𝜋),…, softmaxM(𝜼𝜋)) softmax j(𝜼)= exp(𝜂 j ) ∑ M l=1 exp(𝜂 l ) . 356 D.Rügamer et al. 1 3 This implies Effects in the additive predictors 𝜂K+l,l=1, …,M , in (2) are not identifiable without further constraints. We do not enforce any constraints during model training. Model interpretation is still possible in relative terms (e.g., using a log-odds interpretation). However, some constraints would need to be imposed if identifiable regression coefficients for the additive predictors are to be obtained. For all parameters in 𝝑 , the additive structured predictors 𝜂j(x) ensure interpretability of the relationship between the parameter 𝜗j and the covariates. For example, if 𝜂K+M is a linear model, i.e., 𝜂K+M ( x )= x⊤𝜷 , the regression coefficients 𝜷 can be interpreted as linear contributions of each of the features to the logits of the mixture weight for the last mixture component M. 2.2 Additive predictor structure The model (1) relates all model parameters 𝝑 to features x through additive predictors 𝜂j,j=1, …,K+M . As different densities fm and also different parameters 𝜽m have potentially different influences on the conditional distribution of Y∣x , every parameter in 𝜽 is defined by its own additive structured predictor 𝜂j . Here we assume the additive predictors to have the following structure: where 𝛽0,j corresponds to the model intercept, 𝜷j are the linear effects for pre-defined covariates x L (j) with L(j)⊆{1, …,p}∪� being a subset of all possible predictors and 𝜙l,j are nonlinear smooth functions for one or more covariates in x with S(j) being a (potentially empty) set of indices indicating the covariates with nonlinear predictor effects. We assume that every 𝜙l,j(x) can be represented by (tensor product) basis functions Bl,j,o,o=1, …,O , taking one or several columns of x as input and mapping these onto the space spanned by the basis functions. Denoting zl,j ∶= B l,j (x)=(B l,j,1 (x),…,B l,j,O (x)) ⊤ ∈ℝ O , the nonlinear smooth terms can be written as 𝜙 l,j(x)=z ⊤ l,j 𝜸l, j where 𝜸l,j ∈ℝ O are the corresponding basis coefficients for zl,j . In principle, such a flexible specification may also be used for 𝜂K+1,…,𝜂K+M , i.e., for the additive structured predictors related to 𝝅 . While this is technically possible (using a different subnetwork for every 𝜋m ), these predictors are usually assumed to share one and the same additive structure, i.e., x L (j) and zl,j with l∈S(j) are the same for all j related to the M mixture weights. This further enables a straightforward interpretation of the predictor–mixture weight relationship, as sharing one additive predictor across all 𝜋m s resembles a multinomial logistic regression model. We will thus assume the same specification for all these predictors. We summarize all (2) 𝜋 m(xi)= exp(𝜂 K+m (x i )) ∑ M l=1 exp(𝜂 K+l (x i )) , for m∈M . (3) 𝜂 j=𝛽0,j+x⊤ L(j)𝜷j+ ∑ l∈ S (j) 𝜙l,j(x) , 357 1 3 Mixture ofexperts distributional regression: implementation… model coefficients of the linear terms by 𝜷 =(𝛽 0,1 ,𝜷 ⊤ 1 ,𝛽 0,2 ,𝜷 ⊤ 2 ,…,𝛽 0,K+M ,𝜷 ⊤ K+M ) ⊤ and all model coefficients for representing the nonlinear smooth functions by 𝜸 =(𝛾 0,1 ,𝜸 ⊤ 1 ,𝛾 0,2 ,𝜸 ⊤ 2 ,…,𝛾 0,K + M ,𝜸 ⊤ K+M ) ⊤ . In the following, we summarize these two parameter vectors as 𝝍=(𝜷⊤ ,𝜸⊤)⊤ . 2.3 Model log likelihood Based on model (1) and the structures imposed on the predictors in (3), the negative log likelihood of the model parameters 𝝍 for n independent observations y =( y1, … ,yn ) ⊤ ∈ℝ n and their corresponding n observed feature vectors x ∶= (x ⊤ 1 ,…,x ⊤ n ) ⊤ ∈ℝ n×p is given by the sum of the negative log-likelihood contributions 𝓁i(𝝍) of each observation i=1, …,n : The negative log likelihood can be rewritten as the negative sum of the exponentiated log likelihoods of both the mixture weights 𝜋m and the component densities fm using the log-sum-exp (LSE) function: In practice, formulation (5) is often preferred over (4) as it is less affected by under- or overflow problems. 2.4 Identifiability Identifiability is of concern for the mixture of experts distributional regression model because of the identifiability problems which could occur due to the mixture specification, due to the additive structured predictors and due to the softmax mapping to the mixture weights. 2.4.1 Mixture models For any mixture model, trivial identifiability problems may arise due to label switching and overfitting with either empty or duplicated components. In addition, also generic identifiability problems may occur for mixtures of distributions but also for mixtures of regressions. A detailed overview of identifiability problems in the finite mixture case is given in Frühwirth-Schnatter (2006). (4) 𝓁 (𝝍) ∶= n ∑ i=1 𝓁i(𝝍)=− n ∑ i=1 log { M ∑ m=1 𝜋m(xi)fm(yi∣𝜽m(xi)) }. (5) − n ∑ i=1 log { M ∑ m=1 exp [ log 𝜋m(xi)+log fm(yi∣𝜽m(xi)) ]}. 358 D.Rügamer et al. 1 3 2.4.2 Additive structured predictors The components of the additive model with predictor structures of the form (3) are in general only identifiable up to a constant and also require further restrictions if both linear and nonlinear smooth effects are defined for one and the same covariate. For example, 𝜂j=𝛽0,j+𝜙1,j(x1) can be equally represented by  𝛽0,j +  𝜙 1,j (x 1) by defining  𝛽0,j =𝛽 0,j + c and  𝜙1,j (x 1 )=𝜙 1,j (x 1 )− c with c∈ℝ , i.e., by adding and subtracting a constant c in both terms. We ensure the identifiability of nonlinear smooth terms 𝜙l,j by using sum-to-zero constraints for all nonlinear additive functions such as splines or tensor product splines. The identifiability of linear effects x𝛽 in the presence of a univariate nonlinear effect 𝜙(x) must also be ensured. In this case, several different options exist (see, e.g., Rügamer etal. 2023b). The most straightforward way is to use a nonlinear effect 𝜙(x) with a basis representation that includes the linear effect as null space (and hence, for enough penalization as discussed in Sect.3.3, results in a linear effect). In this case, L(j) only consists of variables that are only modeled using a linear component (e.g., categorical effects) and L(j)∩S(j)=� . 3 Model representation androbust estimation The observed data log likelihood is, in general, not concave and thus difficult to optimize. We suggest to use optimizers from the field of deep learning by framing our model as a neural network. This enables the fitting of the full model class of mixture of experts distributional regression models with additive structure predictors in a straightforward way. Numerical experiments confirm that this choice—when properly trained—is not only more flexible and robust than EM-based optimization but also makes large dataset applications feasible due to mini-batch training. 3.1 Neural network representation Models described in (1) and (3) can be represented as neural networks in the following way. An exemplary architecture is depicted in Fig.1. The network architecture implementing model (1) defines at most K subnetworks, where each subnetwork models one or more additive structured predictors 𝜂j of a distribution parameter 𝜃j . Using an appropriate parameter-free transformation function, these additive structured predictors are mapped to the distribution parameters and passed to a distribution layer (Dillon etal. 2017). Each distribution layer corresponds to a mixture component fm that is further passed to a multinomial or categorical distribution layer, modeling the mixture of all defined distributions. The mixture weights can either be directly estimated or also learned on the basis of input features using additive structured predictors in another subnetwork. A classical linear mixture regression combining M linear regressions would, e.g., be given by M subnetworks, each learning the expectation of a normal distribution and a mixture subnetwork that only takes a constant input (a bias) and learns the M mixture weights. The individual additive predictors for each subnetwork are, in most cases, fully connected layers with only 365 1 3 Mixture ofexperts distributional regression: implementation… replications for the two different mixture weights and the two number of noise variables settings. Results suggest that our approach leads to better predictions measured by the PLS, but is inferior in terms of LS. The smaller LS values are possibly due to fewer data points to fit the model because of the need for a validation set and due to the shrinkage induced by early stopping the procedure. The median performance of the clustering induced based on the estimated posterior probabilities is in general on par with the EM-based approach in terms of ARI and ACC with flexmix, while showing even slightly better performance in the Gaussian case. 4.5 Misspecified mixtures andsparsity In this simulation, we use a normal mixture with pm =10 fixed linear predictors for each distribution and distribution parameter (mean and variance), where all features are again drawn from a standard normal distribution and regression coefficients from a uniform U(−2, 2) -distribution. The data are then generated using M=2 actual mixture components with 𝜋1 drawn (independently of features) from a uniform distribution on the interval (0.06, 0.094) and 𝜋2=1−𝜋1 to ensure that the minimum value of both probabilities is at least 6%. We then evaluate the estimation of mixture probabilities by NMDR for n∈{300, 2500} when increasing the number of specified distributions M†∈{3, 5, 10} . To allow for sparsity in 𝝅 , we use the objective function 𝓁ent introduced in Sect.3.3. For each scenario, 10 replications are performed. ACC ARI PLS LS normal (2) normal (4) poisson (2)poisson (4) normal (2) normal (4) poisson (2)poisson (4) normal (2) normal (4) poisson (2)poisson (4) normal (2) normal (4) poisson (2)poisson (4) −10 −8 −6 −4 0.00 0.25 0.50 0.75 1.00 −8 −6 −4 −2 0.5 0.7 0.9 Value Method Oracle EM NMDR Fig. 3 Comparison of average PLS and LS as well as ACC and ARI of a state-of-the-art implementation (EM), an oracle varying coefficient model with known class memberships and our approach (NMDR) in different colors for the two distributions and two scales (x-axis). The boxplots contain the results for 10 replications over two settings for the mixture weights and two settings for the number of noise variables 366 D.Rügamer et al. 1 3 4.5.1 Results Results for various settings of the entropy penalty parameter 𝜉 are depicted in Fig.4. While setting 𝜉 to small values larger than zero can improve the predictive performance and even outperform the correctly specified model without 1 3 8 PLS RMSE Coef. RMSE Prob. 300/10 2500/10 300/10 2500/10 300/10 2500/10 −50 −40 −30 −20 −10 0 2 4 6 0.0 0.1 0.2 0.3 n / p Value Entropy Penalty 0 1e−05 0.001 0.01 0.1 0.3 correct model Fig. 4 Model quality for misspecified models with specified mixtures M†∈{3, 5, 10} (columns, counting the additional components) instead of actual M=2 mixtures and different goodness of fit measures (rows) for 10 replications (boxes). Colors correspond to different settings of 𝜉 or represent estimation results of the correct model (black) True Prob.:0.3923 True Prob.:0.6077 0.00 0.25 0.50 0.75 1.00 1e−051e−03 1e−01 Entropy Penalty Est. Prob. Fig. 5 Coefficient path (estimated mixture probabilities) for different entropy penalties. A value of around 1e-02 yields the best trade-off between sparsity and estimation performance 367 1 3 Mixture ofexperts distributional regression: implementation… additional distribution components, the bias induced by the penalty generally decreases the estimation performance. In practice, an appropriate amount of penalization can be found by running cross-validation along a grid of different 𝜉 values as, e.g., done for the Lasso (Tibshirani 1996). We additionally investigate the coefficient path obtained from varying values of the penalty parameter 𝜉 for one simulated example. Results for the n=2500, M†=5 setting are depicted in Fig.5. 𝜉 is varied between 0 and 1 on a logarithmic scale. The true model has two nonzero probabilities 0.6077 and 0.3923 while the other 3 entries in 𝝅 are 0. 5 Cell cycle‑regulated genes ofyeast In order to demonstrate the flexibility of our approach, we investigate its application to the yeast cell cycle dataset from Spellman etal. (1998). In this study, genomewide mRNA levels were measured for 6178 yeast open reading frames (ORFs) for 119min at 7-min intervals. We here analyze the subset of data where all 18 time points for the alpha factor arrest are available. The resulting longitudinal dataset consists of 80,802 observations of the standardized expression levels. A subset of this dataset was also analyzed using mixture models in Grün etal. (2011). 5.1 Distributional mixture regression As both the mean and standard deviation of the standardized expression levels of genes change over time, we apply a mixture of distributional regressions model where the mean 𝜇 and the standard deviation 𝜎 of the normally distributed mixture components depend on time, i.e., Yt ∼ ∑M m=1 𝜋 m N(𝜇 m,t ,𝜎2 m,t) for t∈[0, 119] . The additive structured predictors for these distribution parameters are defined as where the nonlinear smooth functions 𝜙 are modeled by thin-plate regression splines (Wood 2003). Previous approaches for modeling this dataset investigated the use of a mixture of mixed models, i.e., the inclusion of gene-specific random effects (Luan and Li 2003; Grün etal. 2011). We investigate here an alternative option for modeling this additional heterogeneity by allowing for time-varying standard deviations. We use M=6 which corresponds to the number of mixture components identified by Spellman etal. (1998). 5.2 Results In order to plot the estimated smooth effects together with the true observations, we first derive the component membership of every gene. As done in the E-step of mixture model approaches (see, e.g., Grün etal. 2011), we calculate the a posteriori h−1 (𝜇 m,t )=𝛽 0,m,1 +𝜙 m,1 (t)and h −1 (𝜎 m,t )=𝛽 0,m,2 +𝜙 m,2 (t) , 368 D.Rügamer et al. 1 3 probability for every gene to belong to component m and then take the maximum of all components 1, …,M=6 . For this application, observations were only assigned to 5 of the 6 assumed components. Note that due to the nature of our optimization routine, not all components necessarily contain at least one observation. Comparing the number of genes assigned to each cluster, one sees that the most common component in our results is cluster 6 with 39,078 observations. Cluster 4 contains 25,722 observations, cluster 1 9306 and cluster 5 6552 observations. Least number of observations is assigned to cluster 2 which contains only 144 observations. Figure6 visualizes the results obtained in a panel plot where in each panel the trajectories of the ORFs for all genes assigned to this cluster are shown together with the component-specific estimates of the time-varying means and standard deviations. The identified clusters clearly vary in showing either an initial decrease or increase in their means. In addition, one also sees that the standard deviations of the clusters vary over time with some clusters exhibiting a particularly large amount of heterogeneity at later time points. 6 Outlook We have introduced the class of mixtures of experts distributional regression with additive structural predictors and investigated its embedding into neural networks for robust model estimation. Overall this leads to the neural mixture of experts distributional regression (NMDR) approach. We show that popular first-order adaptive update routines are well suited for learning these mixture of experts (distributional) regression models and also highlight that the embedding into a neural network estimation framework allows for straightforward extensions of the 56 124 0255075 100 0255075100 0255075 100 −4 0 4 −4 0 4 Time Standardized expression level Fig. 6 Trajectories of ORFs (y-axis) for all 4489 genes (black lines) over the course of the 18 time points (x-axis) with the estimated mean trend (red solid line) per component (facets) and uncertainty visualized by two times the estimated (time-varying) standard deviation (shaded red area) 369 1 3 Mixture ofexperts distributional regression: implementation… general mixture model class and (regularized) maximum-likelihood estimation using optimization routines suitable also for big data applications due to minibatch training. Using the proposed architecture for mixture of experts distributional regression, a possible extension of our approach is therefore the combination with other (deep) neural networks. This allows learning both the distribution components and the mixture weights either by (a) a structured model, such as a linear or additive model, (b) a custom (deep) neural network or (c) a combination thereof. A similar approach has been investigated by Fritz etal. (2022) using a zero-inflated Poisson model (i.e., a mixture including a point mass distribution) which includes both additive effects and a graph neural network in the additive predictor. Appendix A: Optimization routines In order to provide insights into the various optimizers’ performance, we conduct a small benchmark study to assess the influence of the choice of an optimizer and to find a good default. Figure7 visualizes the comparison based on the ranks for each optimizer across all 48 settings from Sect.4.3. In all our experiments, we use the Glorot initializer to initialize weights (Glorot and Bengio 2010) (initialized differently for every optimizer and restart) a batch size of 50 and a maximum of 1500 epochs. Results Figure 7 indicates that convergence problems are primarily encountered for SGD with a substantial amount of runs diverging during optimization. An overall performance assessment based on ranks indicates that the RMSprop optimizer achieves the lowest overall rank. However, the figure highlights that in fact, no clear best optimizer emerges across all scenarios. The ranks obtained for the different optimizers also vary considerably with the performance criterion. Overall one might conclude that both the RMSprop optimizer and the Adam optimizer perform in general well, also when used with their default settings. We note, however, that tuning the optimizer and its learning rate would in general also be beneficial in terms of both predictive performance and estimation quality. A further speed-up for some of these routines can be achieved by additionally incorporating momentum, which also proved to be effective in the optimization of additive models using boosting (Schalk etal. 2022). Appendix B: Concomitant variables Finally, we compare our approach with flexmix in terms of estimation quality when the model includes concomitant variables. 370 D.Rügamer et al. 1 3 Data generating process We simulate a mixture regression model with M∈{2, 3} mixture components, each following a normal distribution with fixed variance, 𝜎2=1 , and mean defined by p=10 covariates that are drawn from a standard normal distribution and multiplied by fixed coefficient also generated from a standard normal distribution. In contrast to previous simulations, this numerical experiment is based on a data generating process that uses additional 2, 4 or 8 covariates to define the additive predictors RMSE Coef.RMSE Prob. PLSARI Prob. ACC Prob. Adadelta (0.01) Adadelta (0.01) w/ CLR Adadelta (0.1) Adadelta (0.1) w/ CLR Adadelta (1) Adam (0.01) Adam (0.01) w/ CLR Adam (0.1) Adam (0.1) w/ CLR Ranger (0.01) Ranger (0.01) w/ CLR Ranger (0.1) Ranger (0.1) w/ CLR RMSprop (0.01) RMSprop (0.01) w/ CL R RMSprop (0.1) RMSprop (0.1) w/ CLR SGD (0.01) SGD (0.01) w/ CLR SGD (0.1) SGD (0.1) w/ CLR 0% 25% 50% 75% 100% 0% 25% 50% 75% 100% 0% 25% 50% 75% 100% 0% 25% 50% 75% 100% 0% 25% 50% 75% 100% Percentage Rank 1234 or higher Fig. 7 Comparison of various optimizers (x-axis; with learning rate in brackets) ranked by performance for different metrics (different rows), potentially with additional cyclic learning rate schedule (CLR), across simulation settings studied in Sect.4.3. Ranks are computed on performance averaged over 3 repetitions. Bars from SGD runs do not sum up to 100% as some models diverged during optimization 371 1 3 Mixture ofexperts distributional regression: implementation… 𝜂K+1,…,𝜂K+M . In other words, we do not set the mixture probabilities to a fixed constant but make them covariate-dependent. The predictors 𝜂K+1,…,𝜂K+M are generated independently from predictors 𝜂1,…,𝜂K by drawing covariates and effects from a standard normal distribution and defining their effect to be linear. Experiment We set n=5000 and run the experiment 10 times to investigate the estimation performance of the two methods for all regression coefficients using the RMSE. mixdistreg is optimized using Adam with a learning rate 1e-3, batch size of 32, early stopping on a 10% validation data set and a patience of 250 epochs. Results Figure8 shows the resulting RMSE values for different values of M and the two additive predictor types (means and probabilities). Both approaches perform well with RMSE values in the range 0.01 to 0.02, which is comparably small compared to the true coefficient values which range from −2 to 1.5. As in previous studies, the estimation performance of the EM-based approach is slightly better than the one using SGD. 2 mixture components 3 mixture components Mean predictor Probability predictor 248248 0.02 0.03 0.04 0.01 0.02 0.03 Number of covariates (in mixture probability predictor) RMSE flexmix mixdistreg Fig. 8 Comparison of flexmix and mixdistreg estimation performance using the RMSE (visualized by boxplots summarizing the 10 different runs) for coefficients in the mean predictors of distribution members (top row) as well as additive predictor of mixture probabilities (bottom row) for a mixture of M∈{2, 3} distributions (columns) 372 D.Rügamer et al. 1 3 Funding Open Access funding enabled and organized by Projekt DEAL. Declarations Competing financial interests The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/ licenses/by/4.0/. References Abadi, M., Agarwal, A., Barham, P., etal.: TensorFlow: large-scale machine learning on heterogeneous systems (2015). https:// www. tenso rflow. org/ Bishop, C.M.: Mixture density networks. Aston University (1994) DeSarbo, W.S., Cron, W.L.: A maximum likelihood methodology for clusterwise linear regression. J. Classif. 5(2), 249–282 (1988) Diebolt, J., Robert, C.P.: Estimation of finite mixture distributions through Bayesian sampling. J. R. Stat. Soc.: Ser. B (Methodol.) 56(2), 363–375 (1994) Dillon, J.V., Langmore, I., Tran, D., et al.: TensorFlow distributions. (2017). https:// doi. org/ 10. 48550/ arXiv. 1711. 10604 Fritz, C., Dorigatti, E., Rügamer, D.: Combining graph neural networks and spatio-temporal disease models to improve the prediction of weekly covid-19 cases in Germany. Sci. Rep. 12(1), 1–18 (2022) Frühwirth-Schnatter, S.: Finite Mixture and Markov Switching Models. Springer, Berlin (2006) Gelfand, A.E., Dey, D.K.: Bayesian model choice: asymptotics and exact calculations. J. R. Stat. Soc.: Ser. B (Methodol.) 56(3), 501–514 (1994) Glorot, X., Bengio, Y.: Understanding the difficulty of training deep feedforward neural networks. In: Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, Proceedings of Machine Learning Research, vol.9, pp. 249–256. PMLR (2010) Gormley, I.C., Frühwirth-Schnatter, S.: Mixture of experts models. In: Frühwirth-Schnatter, S., Celeux, G., Robert, C.P. (eds.) Handbook of Mixture Analysis, pp. 271–307. Chapman & Hall/CRC Handbooks of Modern Statistical Methods, Chapman and Hall/CRC (2019) Grün, B., Leisch, F.: Fitting finite mixtures of generalized linear regressions in R. Comput. Stat. Data Anal. 51(11), 5247–5252 (2007) Grün, B., Scharl, T., Leisch, F.: Modelling time course gene expression data with finite mixtures of linear additive models. Bioinformatics 28(2), 222–228 (2011) Hinton, G., Srivastava, N., Swersky, K.: Neural networks for machine learning. Coursera, video lectures 264(1) (2012) Hubert, L., Arabie, P.: Comparing partitions. J. Classif. 2(1), 193–218 (1985) Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization (2014). https:// doi. org/ 10. 48550/ arXiv. 1412. 6980 Kneib, T.: Beyond mean regression. Stat. Model. 13(4), 275–303 (2013) Leisch, F.: FlexMix: A general framework for finite mixture models and latent class regression in R. J. Stat. Softw. 11(8), 1–18 (2004). https:// doi. org/ 10. 18637/ jss. v011. i08 Luan, Y., Li, H.: Clustering of time-course gene expression data using a mixed-effects model with B-splines. Bioinformatics 19(4), 474–482 (2003) Magdon-Ismail, M., Atiya, A.: Neural networks for density estimation. In: Advances in Neural Information Processing Systems (1998) 373 1 3 Mixture ofexperts distributional regression: implementation… McLachlan, G.J., Peel, D.: Finite Mixture Models. John Wiley & Sons, London (2004) McLachlan, G.J., Lee, S.X., Rathnayake, S.I.: Finite mixture models. Annu. Rev. Stat. Appl. 6(1), 355– 378 (2019) Quandt, R.E.: The estimation of the parameters of a linear regression system obeying two separate regimes. J. Am. Stat. Assoc. 53(284), 873–880 (1958) R Core Team: R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria (2022). https:// www.R- proje ct. org/ Rigby, R.A., Stasinopoulos, M.D.: GAMLSS: a distributional regression approach. J. R. Stat. Soc.: Ser. C (Appl. Stat.) 54(3), 507–554 (2005) Rügamer, D., Kolb, C., Fritz, C., etal.: deepregression: A flexible neural network framework for semistructured deep distributional regression. J. Stat. Softw. 105(1), 1–31 (2023a) Rügamer, D., Kolb, C., Klein, N.: Semi-structured distributional regression. Am. Stat. 1–12 (2023b) Schalk, D., Bischl, B., Rügamer, D.: Accelerated componentwise gradient boosting using efficient data representation and momentum-based optimization. J. Comput. Graph. Stat. 1–11 (2022) Späth, H.: Algorithm39 clusterwise linear regression. Computing 22(4), 367–373 (1979) Spellman, P.T., Sherlock, G., Zhang, M.Q., etal.: Comprehensive identification of cell cycle-regulated genes of the yeast Saccharomyces cerevisiae by microarray hybridization. Mol. Biol. Cell 9(12), 3273–3297 (1998) Stasinopoulos, D.M., Rigby, R.A.: Generalized additive models for location scale and shape (GAMLSS) in R. J. Stat. Softw. 23(7), 1–46 (2007) Stasinopoulos, M., Rigby, B.: gamlss.mx: Fitting Mixture Distributions with GAMLSS. R package version 4.3-5 (2016) Stasinopoulos, M.D., Rigby, R.A., Bastiani, F.D.: GAMLSS: a distributional regression approach. Stat. Model. 18(3–4), 248–273 (2018) Tibshirani, R.: Regression shrinkage and selection via the lasso. J. R. Stat. Soc.: Ser. B (Methodol.) 58(1), 267–288 (1996) Ushey, K., Allaire, J., Tang, Y.: reticulate: Interface to ‘Python’. https:// CRAN.R- proje ct. org/ packa ge= retic ulate, r package version 1.26 (2022) Vanden Oord, A., Schrauwen, B.: Factoring variations in natural images with deep Gaussian mixture models. In: Advances in Neural Information Processing Systems, pp. 3518–3526 (2014) Van Rossum, G., Drake Jr, F.L.: Python reference manual. Centrum voor Wiskunde en Informatica Amsterdam (1995) Viroli, C., McLachlan, G.J.: Deep Gaussian mixture models. Stat. Comput. 29(1), 43–51 (2019) Wedel, M., DeSarbo, W.S.: A mixture likelihood approach for generalized linear models. J. Classif. 12(1), 21–55 (1995) Wood, S.N.: Thin plate regression splines. J. R. Stat. Soc. Ser. B (Stat. Methodol.) 65(1), 95–114 (2003) Wood, S.N.: Generalized Additive Models: An Introduction with R. CRC Press (2017) Wood, S.N., Fasiolo, M.: A generalized Fellner–Schall method for smoothing parameter optimization with application to Tweedie location, scale and shape models. Biometrics 73(4), 1071–1081 (2017). https:// doi. org/ 10. 1111/ biom. 12666 Wright, L.: New deep learning optimizer, ranger: Synergistic combination of radam lookahead for the best of... Medium (2019) Zeiler, M.D.: ADADELTA: An adaptive learning rate method (2012). https:// doi. org/ 10. 48550/ arXiv. 1212. 5701 Zong, B., Song, Q., Min, M.R., et al.: Deep autoencoding Gaussian mixture model for unsupervised anomaly detection. In: International Conference on Learning Representations (2018) Publisher’s Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.