Skip to Content
StatsStats
  • Article
  • Open Access

18 April 2026

19 Pages

Assessing the Accuracy of Bootstrap-Based Standard Errors in Regression Models with Unobserved Heterogeneity

and
1
Population Health Sciences Institute, Newcastle University, Ridley Building 1, Newcastle Upon Tyne NE1 7RU, UK
2
Department of Mathematical Sciences, Durham University, Upper Mountjoy Campus, Durham City DH1 3LE, UK
*
Author to whom correspondence should be addressed.
†
These authors contributed equally to this work.
This article belongs to the Section Statistical Theory and Methods

Abstract

When the data at hand are suspected to stem from several latent subpopulations, Statisticians commonly speak of “unobserved heterogeneity”. While the presence and importance of this phenomenon is commonly acknowledged, there is relatively little guidance on how to carry out correct inferences under unobserved heterogeneities, even in relatively simple scenarios such as the linear regression model. In this work, bootstrap algorithms for the computation of standard errors are investigated in the context of a mixture-based regression approach which accounts for the clustered nature of the data. Of interest is both the accuracy of the standard errors (evidenced by confidence interval coverage rates) and the relative reduction in standard errors achieved in comparison to a naïve linear model fit. Simulations and a real data example are provided.

1. Introduction

The presumably most popular model in Statistics is the multiple linear regression model
y i = β 0 + x i T β + ϵ i = x ˜ i T β ˜ + ϵ i , i = 1 , … , n ,
where x i ∈ R p is a p-variate vector of predictors, β 0 ∈ R is an intercept parameter, β = ( β 1 , … , β p ) T ∈ R p is a p-dimensional parameter vector, x ˜ i T = ( 1 , x i T ) , and β ˜ T = ( β 0 , β T ) . Besides the predictor configuration as given in (1), a full specification of the model also requires a distributional statement on the errors, typically
ϵ i ∼ i . i . d N ( 0 , σ 2 )
implying normality, homoscedasticity, and independence of errors.
While in some rare occasions a model without the intercept β 0 may be considered, as discussed in some detail in [1], the much more common situation is the one involving an intercept. Since this exposition focuses solely on models with an intercept, we have chosen to make this notationally explicit in the model formulation (1), and hence we will mostly be using the notation β 0 + x i T β rather than its slightly more common counterpart, which integrates the intercept parameter β 0 into β ˜ .
While the specification of the multiple linear regression model is usually considered complete as stated above, the model actually implies another, rather strong assumption, namely that of population homogeneity. Specifically, one assumes that data { ( x i , y i ) , i = 1 , … , n } stem from the same population of individuals (items, elements, animals, whatever the unit of interest), and that it is reasonable to postulate that the parametric relationship β 0 + x i T β holds for that entire population.
However, this assumption may at many occasions be violated. In fact, complete homogeneity is usually elusive, and the observed sample will naturally be composed of several subgroups. If we think of individuals, these might be older or younger, bigger or smaller, heavier or lighter, or being from different geographical areas or different socioeconomic groups. Similar statements could be made for, say, industrial items.
In the presence of such heterogeneity, several questions can be asked: (1) Does the heterogeneity matter? For instance, in a study on the effectiveness of advertising a new type of smartphone, the height and weight of the exposed individual are unlikely to be relevant, while gender appears more likely to be relevant. If the heterogeneity is in terms of a variable which is not relevant, then it will not have implications for the model, and it does not need to be further considered. If one is in doubt, it should be considered relevant. (2) Is the heterogeneity observed? For instance, in a medical study, height and weight are likely observed, and hence can simply be included as a covariate into the model (1), on top of the treatment variable and other covariates of interest. The more interesting case is when the heterogeneity is not observed. For instance, educational trials often find that certain subgroups of pupils tend to perform similarly even though they do not seem to share measurable characteristics [2]. Components resulting from manufacturing processes tend to show minor unexplained differences in quality, such as relating to the number of faults in batches [3]. When such unobserved heterogeneities occur, one option is to account for them in the modelling. A common approach is to postulate that the overall population decomposes into K non-overlapping subpopulations, indexed k = 1 , … , K , each of which is associated with its own intercept parameter γ k which is attained with probability π k , where ∑ k = 1 K π k = 1 . In summary this yields a mixture model
y i = z i + x i T β + ϵ i i = 1 , … , n .
where z i is considered a random variable such that
P ( z i = γ k ) = π k
(and 0 otherwise), and ϵ i is Gaussian white noise with mean zero and variance σ 2 . In the case that K = 1 , one has γ 1 ≡ β 0 , coinciding with the multiple linear regression model (1). For later reference, we would like to clarify that, when we speak in this paper of “model (2)” without further specification, we always mean “model (2) along with mechanism (3)”. More complex variants of this model are possible, such as considering regression parameters β = β ( k ) ∈ R p which depend on the subpopulation, but we do not consider these in this exposition. Models which capture heterogeneity of this type are discussed in Section 9.6 of [3].
While, conceptually, it is clear that, under the presence of unobserved heterogeneity, model (2) is the more correct model specification than (1), in practice it is not so clear when and if one should actually enact on embarking on a mixture model. While the linear model may be formally incorrect in such cases, it is based on the established least squares technique which is well underpinned by theory and inferential devices, and for which accessible and computationally efficient implementations exist. The mixture model, on the other hand, requires more complex estimation strategies, usually via the expectation-maximization algorithm [4] which results in a technique which is commonly referred to as nonparametric maximum likelihood (NPML) [3]. This raises questions on the improvement in accuracy of the parameter estimates observed, but also on their precision. Furthermore, there is the important question of how to estimate this precision in terms of standard errors which is a notoriously difficult question in the context of the expectation-maximization algorithm. While some bootstrap-type approaches have been suggested in the literature, the accuracy of these in the context of model (2) has not been evaluated yet in any reasonably systematic way. Hence, the objective of the current work is to investigate the following research question:
RQ. 
Do bootstrap-based techniques allow an accurate assessment of the uncertainty of the NPML regression estimator β ^ for the mixture model (2)?
We will address the RQ through simulation studies. We will initially compare accuracy and precision of estimates arising from simulation runs under both EM-based and least squares estimation routines, implicitly evidencing that mixture-based estimators can be beneficial in terms of bias and variance of β ^ , when compared to the usual linear regression estimator. We will then proceed with investigating coverage properties of the confidence intervals resulting from the standard errors of the bootstrap procedures.
The remainder of the paper is structured as follows. In Section 2, we recall the nonparametric maximum likelihood technique for estimation of the parameters of the mixture model (2), as well as the bootstrap techniques considered for estimating its uncertainty. In Section 3, we carry out simulation studies to answer the research question of this manuscript. In Section 4 we illustrate the methods through a real data example. We discuss the findings thoroughly in Section 5 before we conclude the paper in Section 6.

2. Methodology

2.1. Nonparametric Maximum Likelihood Estimation

For the estimation of parameters from model (2), the natural first step is to establish the likelihood function
L ( β , π 1 , … , π K , γ 1 , … , γ K , σ | y ) = ∏ i = 1 n ∑ k = 1 K π k ϕ ( y i ; γ k + x i T β , σ 2 )
where ϕ ( · ; μ , σ 2 ) denotes the density of a Gaussian random variable with real-valued mean μ and variance σ 2 , and the dependence of L on the response vector y = ( y 1 , … , y n ) T has been made notationally explicit. For each involved parameter, one can in principle set up its score equation by producing the respective partial derivative of the logarithm of (4) and equating it to 0. This process does not yield closed form expressions of the parameter estimates, due to the terms resulting from the differentiation of the bulky expressions log ∑ k = 1 K π k ϕ ( y i ; γ k + x i T β , σ 2 ) featuring in the log-likelihood. However, the score equation for β can be shown to be just a weighted version of the “single-component” score equation for the Gaussian regression model, that is
∂ log ( L ) ∂ β = ∑ i = 1 n ∑ k = 1 K w i k x i ( y i − γ k − x i T β ) = ! 0 ,
where
w i k = π k ϕ ( y i ; γ k + x i T β , σ 2 ) ∑ l = 1 K π l ϕ ( y i ; γ l + x i T β , σ 2 ) .
Similar equations, involving the weights w i k , can be derived for the other parameters [3]. This motivates the implementation of an EM algorithm, where the membership of one of the classes { 1 … K } constitutes the missing information. Under this framework, Equation (6) corresponds exactly to the E-step, being just the “posterior” probability that observation i belongs to component k. A formal execution of this approach via formulation of the complete likelihood, and computation of its partial derivative w.r.t. β , re-establishes Equation (5) as the M-step of the EM algorithm (similarly true for the other parameters). EM theory implies that iteration of E and M steps will converge to the maximum likelihood estimates of the model parameters. This is precisely the estimation procedure which is implemented in the R function alldist of the R package npmlreg [5].
It is noted that, while this procedure is entirely parametric, it was coined as “Nonparametric maximum likelihood estimation” by [6], the reason being that z i can be interpreted as a random effect, which, when, represented by a discrete mixture (3), can be considered to be modelled “nonparametrically” as compared to the usually assumed Gaussian distribution.
A useful by-product of the EM machinery is contributed by the weights w i k . After convergence of the EM algorithm, when the estimated model parameters are used in the right-hand side of (6), one obtains a matrix of estimated weights, referred to as { w ^ i k } , where the ( i , k ) th element is the estimated posterior probability that case i stems from component k. These weights will play a role in one of the bootstrap algorithms that we are going to consider.
As with all EM-based approaches, direct computation of standard errors is usually not possible, hence motivating the development of bootstrap routines as outlined in the next subsection. Another approach for the calculation of standard errors is Louis’ method [7], which is based on the observed information matrix derived from the EM algorithm framework. We summarize Louis’ method, which will be considered for comparative purposes in the application studies in this paper, briefly in Appendix A.

2.2. Bootstrapped Standard Errors

The nonparametric maximum likelihood estimation approach, implemented via the EM algorithm, does not provide standard errors for the estimated parameter coefficients β ^ . Therefore, we consider the bootstrap procedure to obtain standard errors. The use of the bootstrap in the context of mixture models is well established, reaching back to [8], who presented a parametric bootstrap to estimate the standard errors of Gaussian mixture mean estimates, and a more general formulation in [9] covering, at least conceptually, standard errors of parameters of a wide range of multivariate mixture models. Nonparametric bootstrap approaches, where bootstrap replicates are resampled from the data rather than generated from the fitted model, have also been considered but have generally been found to perform less stably as the resamples may lead to empty or spurious clusters [9,10]. As far as the parametric bootstrap is concerned, most developments focused on multivariate Gaussian mixtures [11], including powerful implementations [12]. There have also been several contributions employing the bootstrap in order to test for the number of mixture components, rather than the estimation of standard errors [13,14]. With the exception of [3], who however again focused on component numbers rather than standard errors, the bootstrap tailored to the regression model under heterogeneity (2) has not yet received much attention. Here we explore the use of a parametric bootstrap method for this model, using two different strategies for sampling the mass points γ k , and compare whether the choice of sampling method affects the results. The first approach, to which we will refer as Algorithm 1, can be considered as a transcription of [9]’s original approach adapted to the context of model (2). Algorithm 2 is a variant of this approach which bases sampling of the mass points on the posterior probabilities w i k rather than π k itself, resulting in a method similar to the “NPML-bootstrap” suggested in [15] (where the focus was on obtaining confidence intervals for the posterior intercepts ∑ k w i k γ k , rather than β ).
Algorithm 1: Parametric bootstrap (default mixture-bootstrap)  
Given: Covariates x i ∈ R p and estimated parameter vector β ^ , estimated mass points γ ^ 1 , … , γ ^ K and mixture probabilities π ^ 1 , … , π ^ K , variance parameter σ ^ 2 .
(i)
For i = 1 , … , n , use γ ^ k , π ^ k , k = 1 , … , K to choose z i according to mechanism (3).
(ii)
For b = 1 , … , B , use x i , z i , β ^ , and σ ^ 2 to generate new data sets y i b , i = 1 , … , n according to model (2).
(iii)
Fit model (2) to each of these B data sets to obtain B estimated parameter coefficients β ^ * b .
(iv)
The standard error S E ( β ^ ) of β ^ is then (element-wise) calculated as the standard deviation of these β ^ * b , b = 1 , … , B .
Algorithm 2: Parametric bootstrap (NPML-bootstrap)
Given: Covariates x i ∈ R p and estimated parameter vector β ^ , estimated mass points γ ^ 1 , … , γ ^ K and mixture probabilities π ^ 1 , … , π ^ K , estimated posterior probability matrix { w ^ i k } , variance parameter σ ^ 2 .
(i)
For i = 1 , … , n , choose z i by selecting with probability w ^ i k from the γ ^ k ,
k = 1 , … , K .
(ii)
For b = 1 , … , B , use x i , z i , β ^ , and σ ^ 2 to generate new data sets y i b , i = 1 , … , n according to model (2).
(iii)
Fit model (2) to each of these B data sets to obtain B estimated parameter coefficients β ^ * b .
(iv)
The standard error S E ( β ^ ) of β ^ is then (element-wise) calculated as the standard deviation of these β ^ * b , b = 1 , … , B .
Accordingly, 1 − α confidence intervals for the true β can be computed, based on the bootstrapped standard errors, in either case as β ^ ± z α / 2 S E ( β ^ ) , where z α / 2 = 1.96 for α = 0.05 . For vector-valued β , this operation is again understood element-wise. In the following section, to assess the quality of the bootstrapped standard errors for the estimated parameter coefficients, we examine the coverage properties of these confidence intervals.

3. Simulations

3.1. Simulation Setup

In this section, we conduct simulations to evaluate the precision of bootstrapped standard errors for parameter estimation in linear regression models with unobserved heterogeneity, by assessing the coverage property of standard errors obtained through Algorithms 1 and 2, in comparison with those obtained from Louis’ method [7] for the same fitted mixture model, and from standard linear models ignoring the heterogeneity.
We consider two different simulation settings, with “true” parameter configurations as follows:
(I)
p = 2 , K = 2 , with x 1 ∼ N ( 0 , 0.3 ) and x 2 ∼ U ( 0 , 1 ) , β = ( 0.5 , 0.7 ) T , ( z 1 , z 2 ) = ( − 1.363 , 0.734 ) , ( π 1 , π 2 ) = ( 0.35 , 0.65 ) , and ε i ∼ N ( 0 , 0.09 ) .
(II)
p = 2 , K = 4 , with x 1 ∼ U ( 0 , 1 ) and x 2 ∼ N ( 0.2 , 1 ) , β = ( 2 , 0.5 ) T , ( z 1 , … , z 4 ) = (−1.396, −0.837, 0.015, 1.542), ( π 1 , … , π K ) = ( 0.1 , 0.3 , 0.35 , 0.25 ) and ε i ∼ N ( 0 , 1 ) .
Within each setting (I) and (II), we consider four simulation scenarios: Scenario (A) corresponds just to a direct simulation from the discrete mixture (2) specified by the respective setting. In scenarios (B), (C), and (D), the discrete mixtures are replaced by Gaussian mixtures with the same point masses ( π k ) and mixture centres ( γ k ), but non-zero, increasing variances. Hence, from (B) to (D), the discreteness is increasingly “diluted” until the heterogeneity has almost (but not fully) disappeared in scenario (D).
We summarize the mixture standard deviations σ 1 , … σ K used across settings and scenarios in Table 1. The corresponding column for scenario (A) has been omitted from this table since here all σ k would be trivially equal to zero. We note that, taken strictly, the assumptions underlying both the discrete mixture model (2) and the ordinary linear regression model are violated in scenarios (B) to (D). However, in practice, the data analyst needs to make a model choice, without full knowledge of the nature of the heterogeneity. Hence, how both the NPML and the OLS techniques perform in this spectrum of scenarios is a relevant question.
Table 1. Gaussian mixture standard deviations ( σ 1 , … , σ K ) for scenarios B to D in simulation settings (I) and (II).
Under any setting and scenario, for a single, simulated data set ( x i , y i ) , i = 1 , … , n , the alldist function from the R package npmlreg [5] is used to compute the nonparametric maximum likelihood estimators β ^ , γ ^ 1 , … , γ ^ K , π ^ 1 , … , π ^ K , and σ ^ 2 according to Section 2.1. From this fitted model, the bootstrap procedures in Algorithms 1 and 2 are carried out to obtain bootstrapped standard errors and confidence intervals. The fitted model is also used to compute standard errors without bootstrapping, using Louis’ method. Furthermore, a linear model is fitted directly with ordinary least squares (OLS) to the simulated data set, and the standard errors of these estimates are also recorded.
This entire process is carried out L times, enabling us, for each of the four inferential methods, to compute the coverages, i.e., the proportion of 95% confidence intervals that contain the true parameter values. We focus on the β parameters for this evaluation. In our simulations, we use L = 200 and B = 200 throughout. The sample size of all generated data sets ( x i , y i ) 1 ≤ i ≤ n is n = 500 . The set of x i s is generated only once and then kept constant across all Monte Carlo (L) and bootstrap (B) iterations. Besides the raw coverages resulting directly from the obtained confidence intervals, we also report bias-corrected coverage values which give additional insight into whether any deviation of the reported coverage from the nominal level may be due to estimation bias rather than incorrect standard error estimates. See also Appendix B for details on the bootstrap bias resulting from the simulations.

3.2. Variance Decomposition

Considering the data-generating process (DGP) y i = x i T β + z i + ϵ i , it is helpful to understand the relative scale on which the components of the model operate. For instance, whether or not a random effect z i which features a certain degree of heterogeneity actually makes an impact on the generated data will depend on its size relative to the scale of the x i T β and the error variance. Hence, for the purpose of this consideration, we will consider the predictor variables x i as random variables, with variance according to their data-generating process, even though all inferences are conditional on the initially simulated x i . We will also assume that x i , z i and ϵ i are independent realizations of random variables X, Z, and ϵ , which are also independent of each other.
With this, the variance of the DGP can be decomposed into the following three components:
Var ( y i ) = β ⊤ Var ( x i ) β + Var ( z i ) + Var ( ε i ) .
In the case of a discrete distribution of the random effects z i , that is, in the case that we are working strictly with model (2), where P ( z i = γ k ) = π k , it is clear from the definition of the variance that one has
Var ( z i ) = ∑ k = 1 K π k γ k 2 − ∑ k = 1 K π k γ k 2 .
In the case that the z i follows a mixture of Gaussian distributions,
z i ∼ ∑ k = 1 K π k f k ,
where f k ∼ N ( γ k , σ k 2 ) , one can show that the variance is calculated as the following:
Var ( z i ) = ∑ k = 1 K π k ( σ k 2 + γ k 2 ) − ∑ k = 1 K π k γ k 2 ,
clearly reducing to (8) if all σ k ≡ 0 . The resulting variance decompositions across simulation settings and scenarios are provided in Table 2.
Table 2. Variance decompositions of the DGP y i = x i T β + z i + ϵ i for all considered settings and scenarios.
This table gives insight into the relative scale of the predictor, random effect, and error term. It provides some intuition that, for Setting I, we would expect NPML to perform well: The two discrete mass points account for the overwhelming majority of the variation in the data. For Setting II, where we have four mass points, the variances of the three model components are much more balanced so that we would expect the ordinary linear regression model to be more competitive here.

3.3. Results

Firstly, we consider Setting I, where the estimated values of the β 1 and β 2 parameters are summarized for all scenarios in Table 3, through means and standard deviations of the estimates across all simulation runs. We initially observe that, across all scenarios, the true parameters β 1 = 0.5 and β 2 = 0.7 have been recovered reasonably well by both OLS and NPML estimation. As expected, NPML outperforms OLS in terms of accuracy in the more discrete scenarios (A) and (B), but this advantage fades as the discreteness is lowered in (C) and (D). For scenarios (A) and (B), the empirical standard deviations from the NPML fit are considerably lower than for the OLS fit, with the gap reducing in scenario (C) and vanishing in scenario (D).
Table 3. For Setting I, means and standard deviations of the L = 200 estimates of β 1 and β 2 .
It is emphasized that, so far, the methods for calculation of standard errors from Section 2.2 have not been used. The standard deviations reported in the 5th and 6th columns of Table 3 are computed entirely empirically from the coefficient estimates across simulation runs, and hence are considered as a true reflection of the variability of the estimates of β 1 and β 2 , against which the estimated standard errors obtained using the various techniques can now be benchmarked. Table 4 reports, in the 3rd and 4th columns, the means of the standard errors arising from the OLS fit as well as three ways of calculating standard errors for the NPML technique: Louis’ method, Algorithm 1, and Algorithm 2. These hence need to be compared with the 5th and 6th columns of Table 3.
Table 4. For Setting I, average standard errors and resulting confidence interval coverages for estimates of β 1 and β 2 . Note that Louis’ method as well as Algorithms 1 and 2 are based on an NPML model fit. Bias-corrected coverage values are provided in brackets.
We find that for all scenarios, the standard errors produced by OLS as well as Algorithms 1 and 2 match well their empirical counterparts from Table 3. Comparing between the two bootstrap methods, Algorithm 1 appears to match the empirical standard deviations closer than Algorithm 2. The standard errors from Louis’ method tend to occupy a middle ground between the OLS and bootstrap standard errors, but this behavior is not consistently observed.
The coverage values in the last two columns of Table 4 indicate that standard errors from the NPML method in conjunction with Algorithms 1 and 2 lead to reasonable coverages across all scenarios, which tend to improve when employing the bias correction, which is plausible in the light of the slight estimation biases reported in Table 3. The bias-corrected coverages for Algorithm 1 are comparable to those from the OLS method (in terms of closeness to the target confidence level of 0.95). The good performance of the OLS methodology, despite the non-normality of errors, may be surprising, especially in scenario (A). The standard errors from Louis’ method lead to somewhat fluctuating results, which sometimes imply reasonable coverage values, but appear not very reliable overall.
Additional insights are provided by the histograms in Figure 1 and Figure 2 which provide the full distributions of standard errors S E ( β ^ 1 ) and S E ( β ^ 2 ), respectively, obtained from the four methods across simulation runs. The figures are organized in a similar way as in Table 4, with rows representing scenarios and columns representing the OLS, Louis’ method, and Algorithms 1 and 2. In other words, the means over the distribution of each histogram from Figure 1 and Figure 2 will correspond exactly to the values given in the third and fourth columns of Table 4.
Figure 1. For Setting I, the distribution of standard errors of β ^ 1 across simulation runs. The rows correspond, from top to bottom, to scenarios (A) to (D). The columns correspond, from left to right, to the results for OLS, Louis’ method, and Algorithms 1 and 2. The sample standard deviations according to Table 3, which serve as benchmark of true estimation variability, are highlighted through thin red bars.
Figure 2. For Setting I, the distribution of standard errors of β ^ 2 across simulation runs. The rows correspond, from top to bottom, to scenarios (A) to (D). The columns correspond, from left to right, to the results for OLS, Louis’ method, and Algorithms 1 and 2. The sample standard deviations according to Table 3 are highlighted through thin red bars.
From the histograms of the standard errors of β ^ 1 , in Figure 1, we observe that the OLS-based standard errors show little spread across simulation runs, especially for scenarios (A) and (B). Algorithms 1 and 2 match this behaviour to some extent, even though their spread increases stronger for scenarios (C) and (D). Louis’ method shows significantly increased spread, especially for the fully discrete scenario (A).
A similar behaviour of the various standard errors is echoed for the estimation of β ^ 2 in Figure 2, even though Louis’ method has performed more stably here, and shows a similar spread of standard errors as the bootstrap algorithms in scenarios (B) and (C).
We proceed with the analysis of Setting II, which can be considered as a situation of relatively “mild” unobserved heterogeneity, where, according to Table 2, the variance component of the random effect term is of a similar magnitude as the variance inherent to the regression predictors and the errors. We firstly observe from Table 5 that, also under this setting, all parameters have been estimated well. There are no visible differences in estimation accuracy between scenarios or estimators. However, we again detect the previously observed pattern that, under scenarios (A) and (B), the variability of the OLS estimates is considerably higher than that of the NPML estimates. For scenarios (C) and (D), this effect is still present but less pronounced.
Table 5. For Setting II, means and standard deviations of the L = 200 estimates of β 1 and β 2 .
From Table 6, we find that the standard errors of the OLS method are generally accurate. Algorithm 1 estimates the NPML-based standard errors accurately throughout. Algorithm 2 falls a bit behind in performance, underestimating the true variability by about 10–15% on average. While Louis’ method behaves again a bit inconsistently, it does broadly match the results from Algorithm 1 for the standard errors of β 2 .
Table 6. For Setting II, average standard errors and resulting confidence interval coverages for estimates of β 1 and β 2 . Note that Louis’ method as well as Algorithms 1 and 2 are based on an NPML model fit. Bias-corrected coverage values are provided in brackets.
These results translate into confidence interval coverages as reported in the 5th and 6th columns of Table 6. The OLS-based coverages come generally close to the target level of 0.95, but do exceed this level in scenario (D). It is noted that, while over-overage might be considered less detrimental than under-coverage, it is still not desired since it will imply larger confidence intervals than necessary, and hence a reduction in test power from an inferential point of view. Algorithm 1 again achieves the best coverage values overall, being consistently close to 0.95 (with a single slight exception for β 2 in scenario (C) where it overshoots the target level). Algorithm 2 tends to produce coverage values below 0.95, which is related to the smaller standard errors observed for this method. The coverages from Louis’ method are mostly good for β 2 but poor for β 1 . As could be expected from the small estimation biases in Table 5, the bias correction of the coverage values did make less difference under this setting.
Histograms of the distributions of standard errors, S E ( β ^ 1 ) and S E ( β ^ 2 ) , across simulation runs are provided in Figure 3 and Figure 4, respectively. The observations from these histograms are similar to the previous setting, but with some interesting nuances. The distributions of standard errors from the OLS fit and Algorithms 1 and 2 are again very sharp (albeit disagreeing) in scenarios (A) and (B), while showing more variation for scenario (D). For scenario (C), the OLS-based standard errors are much more localized, but also much larger, than those produced by Algorithms 1 and 2. Louis’ method now produces distributions of standard errors which are much sharper than in the previous setting, but still of smaller values than one would expect. For this setting, the distributions of the standard errors of β ^ 1 (Figure 3) appear generally more dispersed than those for β ^ 2 (Figure 4), which may have to do with the design distribution (uniform for x 1 and normal for x 2 ), even though this behavior has not been observed to this extent for Setting I.
Figure 3. For Setting II, the distribution of standard errors of β ^ 1 across simulation runs. The rows correspond, from top to bottom, to scenarios (A) to (D). The columns correspond, from left to right, to the results for OLS, Louis’ method, and Algorithms 1 and 2. The sample standard deviations according to Table 5 are highlighted through thin red bars.
Figure 4. For Setting II, the distribution of standard errors of β ^ 2 across simulation runs. The rows correspond, from top to bottom, to scenarios (A) to (D). The columns correspond, from left to right, to the results for OLS, Louis’ method, and lgorithms 1 and 2. The sample standard deviations according to Table 5 are highlighted through thin red bars.

4. Real Data Example

We consider the faithful dataset available in the R package datasets [16], which consists of two variables: waiting time and eruption duration of the Old Faithful geyser in Yellowstone National Park, Wyoming, USA. We treat waiting time as the response variable and eruption duration as the predictor. We fitted the data using a simple linear model via lm() and the model (2) with K = 2 , K = 3 and K = 4 , with standard errors estimated using Algorithms 1 and 2, and Louis’ method. The results are shown in Table 7. We firstly observe that among the considered models, the one with K = 3 yields the best result in terms of AIC, with an estimate of β ^ which is about 2 / 3 of a standard error smaller than those for the K = 1 (linear model) and K = 2 . The standard errors of the NPML-based estimates are smaller than the OLS standard error for all models and algorithms considered, with the ones by Algorithm 1 being generally larger than those from Algorithm 2 and Louis’ method. In doubt, the ones from Algorithm 1 should be considered the most reliable.
Table 7. For the Old Faithful data, estimates of β and their standard errors. Note that K = 1 is just equivalent to a linear model, and that Louis’ method and Algorithms 1 and 2 are based on an NPML model fit.
To allow for contextualization of these results in terms of the variance decompositions discussed in Section 3.2, we also provide, in Table 8, these decompositions for the fitted NPML models according to Table 7. Note that, here we have only one covariate, so that β ^ T Var ( x i ) β ^ = β ^ 2 S D 2 ( x i ) . The estimates of Var ( z i ) and σ 2 = Var ( ϵ i ) are available directly from the alldist summary output of the fitted models.
Table 8. For the Old Faithful data, estimated variance decompositions into fixed effect, random effect, and error terms.
We observe from this outcome that the relative magnitude of the variance components for the random effect and the residual error is similar to the one observed in Setting II. Hence we may also expect a similar behavior of the standard error estimates as obtained in Setting II, with a mild improvement of the NPML-based standard errors as compared to the OLS ones. This is indeed what is observed in Table 7. As far as the variance components of the fixed effects are concerned, the values observed in the second column of Table 7 are considerably larger in relation to the other variance components than in any of the simulation settings discussed. The large variance of the fixed effect term can be explained partly by the circumstance that the predictor variable (here eruption duration) is clustered itself [11]. From the results observed in this example, we tentatively conclude that this predictor-level clustering does not seem not to be a detriment to the performance of the studied methods. However, deeper investigation could be considered at this point.

5. Discussion

In the Introduction, this paper set out the RQ of whether bootstrap-based approaches accurately quantify the standard errors of the mixture-based estimators.
Our simulations provided initially some evidence that mixture-based estimators carry an advantage over plain OLS fits in the presence of unobserved heterogeneity. Across both investigated simulation settings, the NPML-based mixture estimators outperformed the linear models when heterogeneity was present. For both settings, this was very clearly visible in terms of the sample standard deviations of the observed estimates which were much smaller than those from the linear model fits in the more discrete scenarios (A) to (C), and for Setting II, even under the almost-homogeneous scenario (D). For Setting I, the estimates from the NPML fit additionally demonstrated reduced bias in scenarios (A) and (B). This clearly evidences that there are situations where an NPML fit of the mixture-based model (2) is preferable over a plain linear model fit. These results, concurring with well-established evidence from the literature (such as [3]), provided reassurance that the RQ is well-posed and practically relevant.
In order to answer the RQ, we considered standard errors from competing bootstrap approaches for NPML estimation. The only difference between these bootstrap techniques is the way that the component-specific intercepts, also called mass points, are resampled: in the first variant, these are drawn from the overall mixture estimates π ^ k resulting from the NPML fit, while in the second case these are taken from the matrix of posterior probabilities { w ^ i k } which is delivered as a by-product of the EM machinery. These techniques were contrasted with Louis’ method, as a historically important reference method for the computation of standard errors for EM-based inference, and the ones arising from the naïve OLS fits.
Perhaps at this point a conceptual remark is in order. Some readers may feel that for each problem there is only one “true” standard error and hence that all estimators should ideally uncover this value. This would however be an incorrect presumption. There is no reason why the OLS and NPML fits should have equal standard errors: It is entirely plausible for any inferential approach yielding smaller or larger standard errors than the other, if it better accounts for the nature of the data. We are aiming, of course, for a method yielding smaller standard errors, but we need assurance that these are actually estimated correctly. This last point is the core of the considered RQ.
In this respect, the obtained picture was very clear, in that the standard errors by both the OLS technique and Algorithm 1 were generally accurate. This was reflected in generally very good coverage results which closely matched the target confidence levels of the approaches. Notably, the performance of these standard errors (as a measure of the true variation of the respective estimates) was not impacted by a correct or incorrect model choice: The OLS-based standard errors were still correct even under strong heterogeneity, and the bootstrapped standard errors (according to Algorithm 1) were still correct in the quasi-continuous scenarios. But it remains the case, of course, that, under heterogeneity, the standard errors from the plain linear model fit are much larger than necessary (even if correctly estimated).
The second bootstrap technique, Algorithm 2, did overall perform reasonably, but it tended to fall slightly short on the standard errors and hence on the resulting coverage levels. Since the application of Algorithm 1 is in practice easier than that of Algorithm 2, we suggest Algorithm 1 for the use in general practice. Louis’ method, at least according to our implementation, behaved temperamentally in all examples considered.
Further insights were obtained by investigating the full distributions of standard errors across simulation settings and scenarios. Generally, the standard error estimates across Monte Carlo runs, using any of OLS or the bootstrap approaches, were quite sharply localized and centered at the “true” standard deviations, raising confidence in the robustness of these measures of uncertainty. In most scenarios, the OLS standard errors tended to form slightly narrower distributions of standard errors (albeit positioned at higher values) than the bootstrap approaches. This relative widening of the spread of the bootstrap-based standard errors tended to be a bit larger for the coefficients of uniform, rather than normally, distributed covariates. The reasons for this effect are unclear.
A real data example, involving the Old Faithful geyser data which are very familiar to a statistical audience, underscored the previous outcomes: The NPML technique is the appropriate choice under unobserved heterogeneity, in this example evidenced by the Akaike information criterion which settled on K = 3 . While three-cluster solutions have previously been identified for this data set in the literature [12], to our knowledge no such result has been reported in the regression context yet. Hence we can infer that waiting times fall into three latent subpopulations after variation due to eruption durations has been explained. This example confirms our previous findings that (i) accounting for unobserved heterogeneity can affect the estimated coefficients, (ii) it will tend to lead to better (smaller) standard errors than the naïve OLS approach, and (iii) Algorithm 1 delivers standard errors which appear robust and plausible.
However, this example also hinted at two limitations of the present study. First, a further investigation of situations with higher variances of the fixed effect terms than in our simulation study may still be encouraged. Secondly, one could imagine that the relationship between eruption duration and waiting time itself would depend on the cluster membership, requiring hence subpopulation-dependent slope parameters, β ( k ) , in model (2). In the NPML context, for a single covariate, estimation of such a model has been discussed by [3]. We are not aware of an instance of bootstrap estimation of standard errors for this model. While we believe that Algorithms 1 and 2 could be similarly applied to this scenario, a label switching problem may occur when proceeding from step (iii) to step (iv). Hence we leave this question for further research. We note that this extended model is also of relevance with view to current research interests on treatment effect heterogeneity [17], where the covariate would just correspond to a treatment indicator.

6. Conclusions

In this study, we have considered a version of the linear regression model which takes population heterogeneity into account by replacing the usual, “common” intercept by a discrete mixture distribution. We have shown through simulation studies how a straightforward adaptation of routine bootstrap methodology is able to estimate the standard errors of regression coefficients accurately. This has been evidenced by comparing these standard errors with empirical parameter standard deviations arising from Monte Carlo resamples, as well as by considering raw and bias-corrected coverage values. Overall, it has turned out that attaining accurate estimates of standard errors is not a major worry: OLS-based standard errors are still accurate under heterogeneity, and NPML-based standard errors, when computed by Algorithm 1 (which is a vanilla version of the general mixture bootstrap), are still accurate in its absence. However, what changes is the magnitude of the standard errors of the estimators themselves: while OLS and NPML estimators have similar standard errors under weak heterogeneity, this changes fundamentally when the heterogeneity is strong, where the NPML-based estimators become considerably more efficient, hence yielding strongly reduced standard errors of estimated coefficients.

Author Contributions

Conceptualization, Y.Z. and J.E.; methodology, Y.Z. and J.E.; software, Y.Z.; validation, Y.Z.; formal analysis, Y.Z. and J.E.; investigation, Y.Z.; resources, J.E.; data curation, Y.Z.; writing—original draft preparation, Y.Z. and J.E.; writing—review and editing, J.E.; visualization, Y.Z.; supervision, J.E.; project administration, J.E. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The Old Faithful data analyzed in Section 4 are publicly available as part of the cited package datasets [16].

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
NPMLNonparametric maximum likelihood
RQResearch question
EMExpectation-Maximization
DGPData-generating process
OLSOrdinary Least Squares

Appendix A. Louis’ Method

The complete data log-likelihood function is written as
l c ( θ ) = ∑ i = 1 n ∑ k = 1 K w i k log π k − 1 2 log ( 2 π σ 2 ) − ( y i − γ k − x i T β ) 2 2 σ 2 ,
where θ = ( β , γ 1 , … , γ K , π 1 , … , π K , σ 2 ) , w i k is defined in Equation (6).
The score for β :
S β = ∂ l c ∂ β = ∑ i = 1 n ∑ k = 1 K w i k 1 σ 2 x i ( y i − γ k − x i T β ) .
The complete data information for β :
− ∂ 2 l c ∂ β ∂ β T = ∑ i = 1 n ∑ k = 1 K w i k 1 σ 2 x i x i T .
So the observed information takes the following form:
I ( β ) = − E ∂ 2 l c ∂ β ∂ β T ∣ y − Var ( S β ∣ y ) = 1 σ 2 ∑ i = 1 n x i x i T − 1 σ 4 ∑ i = 1 n x i x i T ∑ k = 1 K τ i k ( y i − γ k − x i T β ) 2 − ( ∑ k = 1 K τ i k ( y i − γ k − x i T β ) ) 2 ,
where τ i k = P ( w i k = 1 ∣ y i ) .
So,
Var ( β ^ ) = I ( β ) − 1 .

Appendix B. Bootstrap Bias and Bias-Corrected Coverage

For each completed bootstrap according to either Algorithm 1 or Algorithm 2, one can additionally produce a bootstrapped estimate of bias for parameter β according to
Bias ( β ^ ) = 1 B ∑ b = 1 B β ^ * b − β ^
where β ^ is the original (non-bootstrapped) estimate of β which was obtained directly from the data. This allows one to compute bias-corrected coverage values that are based on confidence intervals which are re-centered at
β ^ c = β ^ − Bias ( β ^ ) = 2 β ^ − 1 B ∑ b = 1 B β ^ * b
hence correcting for the bias present in the estimation of β .

References

  1. Montgomery, D.C.; Peck, E.A.; Vining, G.G. Introduction to Linear Regression Analysis, 4th ed.; Wiley & Sons: Hoboken, NJ, USA, 2006. [Google Scholar]
  2. Uwimpuhwe, G.; Singh, A.; Higgins, S.; Coux, M.; Xiao, Z.; Shkedy, Z.; Kasim, A. Latent Class Evaluation in Educational Trials: What Percentage of Children Benefits from an Intervention? J. Exp. Educ. 2020, 90, 404–418. [Google Scholar] [CrossRef] [Scilit]
  3. Aitkin, M.; Francis, B.; Hinde, J.; Darnell, R. Statistical Modelling in R; Oxford University Press: Oxford, UK, 2009; pp. 440–442. [Google Scholar]
  4. DeSarbo, W.S.; Cron, W.L. A maximum likelihood methodology for clusterwise linear regression. J. Classif. 1988, 5, 249–282. [Google Scholar] [CrossRef] [Scilit]
  5. Einbeck, J.; Hinde, J. Nonparametric Maximum Likelihood Estimation for Random Effect Models in R. R Package Version 0.46-5. 2025. Available online: https://CRAN.R-project.org/package=npmlreg (accessed on 5 May 2025).
  6. Aitkin, M. A general maximum likelihood analysis of overdispersion in generalized linear models. Stat. Comput. 1996, 6, 251–262. [Google Scholar] [CrossRef] [Scilit]
  7. Louis, T.A. Finding the observed information using the EM algorithm. J. R. Stat. Soc. Ser. B 1982, 44, 98–130. [Google Scholar] [CrossRef] [Scilit]
  8. Basford, K.E.; Greenway, D.R.; McLachlan, G.J.; Peel, D. Standard errors of fitted component means of normal mixtures. Comput. Stat. 1997, 12, 1–18. [Google Scholar]
  9. McLachlan, G.; Peel, D. Finite Mixture Models; Wiley Series in Probability and Statistics; John Wiley & Sons, Inc.: Hoboken, NJ, USA, 2000. [Google Scholar]
  10. Jaki, T.; Su, T.L.; Kim, M.; Van Horn, L.M. An evaluation of the bootstrap for model validation in mixture models. Commun.-Stat.—Simul. Comput. 2018, 47, 1028–1038. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  11. O’Hagan, A.; Murphy, T.N.; Scrucca, L.; Gormley, I.C. Investigation of parameter uncertainty in clustering using a Gaussian mixture model via jackknife, bootstrap and weighted likelihood bootstrap. Comput. Stat. 2015, 34, 1779–1813. [Google Scholar] [CrossRef] [Scilit]
  12. Scrucca, L.; Fraley, C.; Murphy, T.B.; Raftery, A.E. Model-Based Clustering, Classification, and Density Estimation Using Mclust in R; Chapman & Hall/CRC Press: Boca Raton, FL, USA, 2023; Sec 3.3.1. [Google Scholar]
  13. Polymenis, A.; Titterington, D.M. On the determination of the number of components in a mixture. Stat. Probab. Lett. 1998, 38, 295–298. [Google Scholar] [CrossRef] [Scilit]
  14. Turner, R. Estimating the propagation rate of a viral infection of potato plants via mixtures of regressions. J. R. Stat. Soc. Ser. C 2000, 49, 371–384. [Google Scholar] [CrossRef] [Scilit]
  15. Einbeck, J.; Gray, E.; Sofroniou, N.; Marques da Silva Junior, A.H.; Gledhill, J. Confidence intervals for posterior intercepts, with application to the PIAAC literacy survey. In Proceedings of the 32nd International Workshop on Statistical Modelling, Groningen, The Netherlands, 3–7 July 2017; pp. 217–222. [Google Scholar]
  16. R Core Team. R: A Language and Environment for Statistical Computing; R Foundation for Statistical Computing: Vienna, Austria, 2025; Available online: https://www.R-project.org (accessed on 23 February 2026).
  17. Lavery, J.A.; Chen, Y.; Panageas, K.S.; Wang, Y. Unveiling non–small cell lung cancer treatment effect heterogeneity: A comparative analysis of statistical methods. JNCI J. Natl. Cancer Inst. 2025, 117, 2062–2072. [Google Scholar] [CrossRef] [Scilit] [PubMed]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.