Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2019 Mar 12.
Published in final edited form as: R J. 2018 Jul;10(1):288–307.

Semiparametric Generalized Linear Models with the gldrm Package

Michael J Wurm 1, Paul J Rathouz 2
PMCID: PMC6414059  NIHMSID: NIHMS1011992  PMID: 30873295

Abstract

This paper introduces a new algorithm to estimate and perform inferences on a recently proposed and developed semiparametric generalized linear model (glm). Rather than selecting a particular parametric exponential family model, such as the Poisson distribution, this semiparametric glm assumes that the response is drawn from the more general exponential tilt family. The regression coefficients and unspecified reference distribution are estimated by maximizing a semiparametric likelihood. The new algorithm incorporates several computational stability and efficiency improvements over the algorithm originally proposed. In particular, the new algorithm performs well for either small or large support for the nonparametric response distribution. The algorithm is implemented in a new R package called gldrm.

Introduction

Rathouz and Gao (2009) introduced the generalized linear density ratio model (gldrm), which is a novel semiparametric formulation of the classical glm. Although Rathouz and Gao did not use the term gldrm, we refer to it as such because it is a natural extension of the density ratio model (see e.g. Lovric (2011)). Like a standard glm, the gldrm relates the conditional mean of the response to a linear function of the predictors through a known link function g. To be specific, let the random variable Y be a scalar response, and let X be a p × 1 covariate vector for a particular observation. The model for the mean is

E(Y|X=x)=g1(xTβ). (1)

Because Equation 1 holds for both gldrm and glm, the regression coefficients have the same interpretation for both models. The gldrm relaxes the standard glm assumption that the distribution of Y|X comes from a particular exponential family model. Instead, assume that Y|X from an exponential tilt model of the form

f(y|X=x)=f0(y) exp{θyb(θ)}, (2)

where

b(θ)=logf0(y) exp(θy)dλ(y), (3)

and θ is defined implicitly as the solution to

g1(xTβ)=y exp{θyb(θ)}dλ(y). (4)

Here f0 is an unspecified probability density with respect to a measure λ. We call f0 the reference distribution. Measure λ is Lebesgue if Y|X is continuous, a counting measure if Y|X is discrete, or a mixture of the two if Y|X has a mixture distribution. Note that E(Y|X) = b′(θ) and Var(Y|X) = b″(θ), which are standard glm properties.

The regression coefficients β and reference distribution f0 are estimated by maximizing a semi-parametric likelihood function, which contains a nonparametric representation of f0 that has point mass only at values of Y observed in the data. The quantity θ is not a parameter in this model, but rather a function of the free parameters β and f0, as well as of X. This work was fully developed by Huang and Rathouz (2012), who first focused on the case where the covariate vector takes one of finitely many values, drawing on theoretical arguments advanced in the empirical likelihood literature (e.g. Owen et al. (2001)). Drawing on semiparametric profile likelihood methods, Huang (2014) went on to fully generalize the asymptotic arguments, proving consistency and asymptotic normality of the regression coefficient estimators, and deriving the asymptotic variance matrix using the profile likelihood. Huang also proved pointwise asymptotic normality of the reference cumulative distribution function estimator.

Despite these important theoretical advances, computation for this model has remained a practical challenge. The original algorithm in Rathouz and Gao (2009) is somewhat rudimentary and applies mostly to cases with finite support. It does not scale well, and stability and speed are challenges. This paper proposes a new algorithm to address these challenges and render the model more widely applicable.

In particular, the issue of optimizing the semiparametric likelihood over the f0 point masses is improved with application of the Broyden-Fletcher-Goldfarb-Shanno (BFGS) technique (Broyden, 1970; Fletcher, 1970; Goldfarb, 1970; Shanno, 1970). Because the number of parameters in the semiparametric likelihood associated with f0 is equal to the number of unique points in the response vector, the rank of the Hessian matrix can become unwieldy, especially for continuous response data. The BFGS method uses an easily-computed rank-two approximate Hessian matrix that has an inverse which is much less computationally intensive to calculate.

The optimization techniques in this paper have been incorporated into the R package gldrm (Wurm and Rathouz, 2018), the first CRAN package for gldrm. This package estimates the gldrm model and provides coefficient standard errors. In addition, since the publication of Rathouz and Gao (2009), Huang (2014) developed likelihood ratio tests and likelihood ratio-based confidence intervals for regression coefficients and demonstrated their strong properties. The gldrm package provides utilities for likelihood ratio tests of nested models, as well as confidence intervals.

We present our optimization algorithm in Section 2. In Section 3, we present simulation experiments to check the finite sample performance of the gldrm estimators and the accuracy of estimated standard errors using this algorithm. In Section 4, we discuss methods for inference. Section 5, we present a simulation that benchmarks the computational time and how it scales with the number of observations and number of covariates. In Section 6, we present a summary of the functions in the gldrm package. In Section 7, we demonstrate the functionality of the gldrm package with an example in R. In Section 8, we make concluding remarks.

Optimization algorithm

Suppose we have an observed sample (x1, y1),…, (xn, yn) generated by the model specified in Equations 14. The xi can be fixed or random, and the yi are conditionally independent given the covariates. Let S=(s1,,sK) be the observed support, i.e. a vector containing the unique values in the set {y1,…yn}. If the response follows a continuous distribution, then K will equal n. Otherwise K may be less than n due to ties. Let the vector f˜0=(f1,,fK) represent probability mass at the points (s1,…, sK). This is a nonparametric representation of f0 because the true reference density may be continuous or have probability mass at values not contained in S.

The semiparametric log-likelihood is

l(β,f˜0)=i=1n{θiyilogk=1Kfk exp(θisk)+k=1KI(yi=sk) log fk}, (5)

where each θi is defined implicitly as the solution to

g1(xiTβ)=k=1Kskfk exp{θisk}k=1Kfk exp{θisk}. (6)

There exists a θi that satisfies Equation 6 as long as g1(xiTβ)(m,M) for all i, where m ≡ min(S) and M ≡ max(S).

We obtain parameter estimates from this likelihood as argmax(β,f˜0)l(β,f˜0), subject to the following constraints:

C1.g1(xiTβ)(m,M) for all i
C2.fk>0 for all k=1,,K
C3.k=1Kfk=1
C4.k=1Kskfk=μ0 for some chosen μ0(m,M)

Constraint (C4) is necessary for identifiability because for any nonparametric density f˜0=(f1,,fk)T, the “exponentially tilted” density f˜0(α)=(f1eαs1,,fKeαsK)T/k=1Kfkeαsk has the same semiparametric log-likelihood for any α, i.e. l(β,f˜0)=l(β,f˜0(α)) for all β. We can set μ0 to be any value within the range of observed response values, but choosing a value too extreme can lead to numerical instability in estimating f˜0. It usually works well to choose μ0=1ni=1nyi.

To perform the optimization, we take an iterative approach, alternating between optimizing over f˜0 and over β (Rathouz and Gao, 2009). Each optimization step marginally optimizes the log-likelihood over one set of parameters, holding the other fixed. Neither optimization step has a closed form solution, so iterative procedures must be used. To update f˜0, we propose using the BFGS technique. To update β, we use Fisher scoring, which is equivalent to iteratively re-weighted least squares (IRLS). We propose iterating BFGS until convergence for each f˜0 update, while only using a single IRLS iteration to update β in between f˜0 updates; this is tantamount to a profile likelihood approach to estimation of β.

Although the log-likelihood in Equation 5 is a function of (β,f˜0), we have expressed it in terms of (θ1, … , θn); each θi is implicitly a function of (β,f˜0). The score function is also best expressed in terms of the θi′s (see Equations 12 and 15). Consequently, our optimization algorithm requires the θi’s to be computed each time β or f˜0 is updated. To do this, we use an iterative Newton-Raphson procedure after each iteration of the β update or the f˜0 update procedures.

In what follows, we detail updates of the θi′s, of f˜0, and of β. We use the notation b(θ) to denote the function defined in Equation 4 with respect to the discrete probability distribution specified by f˜0, i.e. b(θ)=logk=1Kfk exp(θsk). We also define μig1(xiTβ).

θ update procedure

θi is defined implicitly as the solution to Equation 6, which can be written as

μi=b(θi). (7)

To calculate θi, we use the Newton-Raphson procedure provided in Appendix C of Rathouz and Gao (2009). To satisfy equation 7, we need to find θ such that μi = b′(θ), or equivalently gl(μi) = gl{b′(θ)}, where gl(s)= logit (smMm)=log(smMs). (The transformation, gl, stabilizes the solution.)

We use Newton-Raphson to find the root of t(θ) = gl{b′(θ)} ‒ gl(μi). Let θ(r) denote the approximate solution at the rth Newton-Raphson iteration. The Newton-Raphson update is given by

θ(r+1)=θ(r){t(θ(r))}1t(θ(r)), (8)

where

t(θ)=Mm{b(θ)m}{Mb(θ)}b(θ), (9)

and

b(θ)=k=1K{skb(θ)}2fk exp {θskb(θ)}. (10)

We typically initialize θ(0) to be the value obtained from the previous θ update procedure. The first time θ is updated, we initialize θ(0) to zero for every observation. We define convergence when |t(θ(r))|<ϵ, where is a small threshold such as 10−10.

As μiM from the left, θi → +∞. Likewise, as μim from the right, θi → −∞. To prevent numerical instability when μi is at or near these boundaries, we cap |θi| at a maximum value (500 by default). The appropriateness of this threshold would depend on the scale of response variable. Rather than adjust the threshold, we center and scale the response variable to the interval [−1, 1] (see the subsequent section on “response variable transformation”).

f˜0 optimization procedure

Holding β fixed at its current estimate, we need to marginally optimize the log-likelihood l(β,f˜0) over f˜0, subject to constraints (C2)-(C4). The linear constraints (C3) and (C4) could be enforced using constrained optimization techniques such as Lagrange multipliers or reducing the dimension of the parameter space by two. Huang and Rathouz (2012) used the former technique, while Rathouz and Gao (2009) used the latter. We propose a different method, based on the BFGS technique, that is more computationally efficient. At each iteration, we apply a BFGS update to f˜0 to improve the unconstrained log-likelihood and then transform f˜0 to satisfy constraints (C3) and (C4). Application of the constraints does not affect the log-likelihood of the estimate, as the constraints are only required for identifiability (i.e. uniqueness of the optimal f˜0). For any set of positive f˜0 values, there exists a unique set of values with equal log-likelihood that satisfies both constraints (C3) and (C4).

We define the transformation g˜0=(g1,,gk)=(log f1,,log fK) and consider the log-likelihood as a function of g˜0 only, with β held fixed. Working on the log scale enforces constraint (C2) and also improves numerical stability. Specifically, numerical stability is improved by working with the score and Hessian as a function of g˜0 rather than f˜0.

BFGS is a quasi-Newton procedure, which makes iterative updates using an approximate Hessian matrix along with the exact score function. Let g˜0(t) be the estimate at the tth iteration. The updates take the form

g˜0(t+1)g˜0(t)Ht1S(g˜0(t);β). (11)

Here, S(g˜0;β) is the score as a function of g˜0 only, holding β fixed. It has kth element

{S(g˜0;β)}k=i=1n{I(yi=sk)exp(gk+θisk)exp{b(θi)}exp(gk+θisk)exp{b(θi)}skμib(θi)(yiμi)} (12)

for k = 1,…, K (derivation in Appendix A). Note that this score function ignores constraints (C3) and (C4). The matrix Ht is an approximation to the Hessian of the log-likelihood as a function of g˜0 only, holding β fixed. This estimate is updated with each iteration. Letting ut=g˜0(t)g˜0(t1) and vt=S(g˜0(t);β)S(g˜0(t1);β), we can write the BFGS estimate of the Hessian recursively as

Ht=Ht1+vtvtTutTvtHt1ututTHt1utTHt1ut. (13)

Ht is a rank-2 update to Ht−1 that satisfies the secant condition: Htut = vt. Furthermore, Ht is guaranteed to be symmetric and positive definite, even though the true Hessian is not full rank. (The true Hessian is not full rank because without imposing constraints (C3) and (C4), the log-likelihood does not have a unique optimum.) The BFGS update in Equation 11 requires the inverse of Ht, which can be calculated efficiently and directly, without calculating Ht. By the Sherman-Morrison-Woodbury formula,

Ht1=Ht11+(utTvt+vtTHt11vt)(ututT)(utTvt)2Ht11vtutT+utvtTHt11utTvt. (14)

For an initial estimate, we propose H01=αIK, where IK is the K × K identity matrix. We perform a line search along the gradient to choose an appropriate value for α such that l(β,f˜0(1))>l(β,f˜0(0)).

As previously mentioned, constraints (C3) and (C4) are only required for identifiability. After each BFGS iteration, we impose these constraints on the f˜0 estimate, which does not affect the log-likelihood of the estimate. Specifically, we apply (C3) by scaling our estimate of f˜0 to sum to one. We then “exponentially tilt” the estimate to enforce constraint (C4). In other words, we compute θ such that j=1Ksjfjeθsj/j=1Kfjeθsj=μ0, and set our final estimate for the iteration to be fkfkeθsk/j=1Kfjeθsj for all k.

We initialize g˜0(0) to the log of the f˜0 estimate obtained from the previous f˜0 update procedure. We suggest using the empirical response distribution as an initial estimate of f˜0. We define convergence using the relative change in the log-likelihood. Our default convergence threshold is 10−10. If the log-likelihood decreases after any iteration, we backtrack by half steps, setting g˜0(t+1)12(g˜0(t+1)+g˜0(t)) until the log-likelihood improves. In our experience, we have found that the log-likelihood improves after most iterations without taking half steps, but log-likelihood decreases can occur sporadically (both at early and late iterations).

β optimization procedure

Holding f˜0 fixed at its current estimate, we could marginally optimize the log-likelihood over β using iteratively re-weighted least squares (IRLS). Rather than iterating until convergence, however, we propose using a single IRLS iteration to update β in between f˜0 updates. The IRLS algorithm is simply the Newton-Raphson algorithm, but using the Fisher information in place of the negative Hessian matrix. This technique is commonly referred to as Fisher Scoring. As we now show, the Fisher Scoring update minimizes a weighted least squares expression, which is why we can refer to the algorithm as IRLS. The score function is given by

S(β;f˜0)=i=1nxi(1g(μi))(1b(θi))(yiμi)=XTWr, (15)

(derivation in Appendix C) and the Fisher information is

I(β;f˜0)=E(S(β;f˜0)S(β;f˜0)T|X1=x1,,Xn=xn)                     =i=1nxi(1g(μi))2(1b(θi))xiT                    =XTWX, (16)

where X is an n × p matrix with rows xiT, W is an n × n diagonal matrix with entries (1g(μi))21b(θi), and r is an n × 1 vector with entries g(μi)(Yiμi).

Let β(0) be the estimate obtained from the previous β update procedure. The IRLS step between β(0) and the updated estimate, β(1), is

β(1)β(0)={I(β(0);f˜0)}1S(β(0);f˜0)                      =(XTWX)1XTWr. (17)

This is the solution to a weighted least squares expression, which can be computed efficiently using QR decomposition.

Response variable transformation

Numerical stability issues can occur if the exp{θisk} terms become too large or small during optimization. To prevent these terms from exceeding R’s default floating-point number range, we transform the response vector to the interval [−1, 1]. Specifically, the response values are transformed to yi*=(yim+M2)2Mm. It turns out the semiparametric log-likelihood function with the transformed response and modified link function g*(μ)=g(m+M2+Mm2μ) is equivalent to the original log-likelihood. The parameters β and f˜0 that optimize the modified log-likelihood also optimize the original log-likelihood (proof in Appendix D).

As mentioned in the “θ update procedure” section, we choose to cap |θ| for each observation at 500 by default, thereby restricting the rescaled θisk terms to the interval [−500, 500]. Note that the optimization function in the gldrm R package returns the estimated θi values for each observation, and these values are on the original scale of the response variable.

Inference

The gldrm R package (Wurm and Rathouz, 2018) can perform inference on the regression coefficients using likelihood ratio tests for nested models. It can also calculate likelihood ratio, Wald, or score confidence intervals. All three confidence intervals should yield similar results for large samples, but the Wald form may be preferred for its computational simplicity. Likelihood ratio and score confidence intervals are more computationally expensive to calculate. Huang (2014) recommends likelihood ratio tests for small samples.

The Wald asymptotic variance estimate for the β estimator can be obtained from the inverse of the information matrix given in Equation 16. Recall this information matrix is calculated with the f˜0 parameters held fixed. Its inverse is a valid asymptotic variance matrix because the full information matrix is block diagonal; i.e., the β and f˜0 estimators are asymptotically independent. The gldrm optimization function returns standard error estimates for each coefficient, which are displayed by the print method along with p-values. Wald confidence intervals are straightforward to calculate from the standard errors and can be obtained from the gldrmCI function. For these single-coefficient hypothesis tests and confidence intervals, we approximate the null distribution by a t-distribution with np degrees of freedom, where n is the number of observations and p is the rank of the covariate matrix.

Likelihood ratio tests for nested models are based on the usual test statistic: 2 times the log-likelihood difference between the full and reduced model. Following Huang (2014), we approximate the null distribution by an F-distribution with q and np degrees of freedom, where q is the difference in the number of parameters between the full and reduced models. This test can be performed by the gldrmLRT function.

Likelihood ratio and score confidence intervals for a single coefficient can be obtained from the gldrmCI function. These confidence intervals are more computationally expensive than Wald confidence intervals because an iterative method is required to search for the interval boundaries. We use the following bisection method.

Suppose we want to obtain the lower boundary of a confidence level 1 − α interval for a single coefficient β*, and that the gldrm estimate of this coefficient is β^*. For the lower boundary, we need to find β1o* such that β1o*<β^* and the one-sided likelihood ratio test has a p-value equal to α/2 under the null hypothesis H0:β*=β1o*. As explained in the next paragraph, we can compute the p-value for any guess of β1o*. We begin by finding a guess that is too low (p-value less than α/2) and a guess that is too high (p-value greater than α/2). We then obtain the p-value of the midpoint. If the p-value is less than α/2 then the midpoint becomes the new low guess, and if it is greater than α/2 then the midpoint becomes the new high guess. We iterate this process, each time halving the distance between the low guess and high guess, until we have a guess of β1o* that has a p-value arbitrarily close to α/2. The same procedure can be used to solve for βhi*.

Let β0 be any constant. To calculate the likelihood ratio or score test p-value of H0 : β* = β0, we need to optimize the log-likelihood over f˜0 and all other β values, holding β* fixed at β0. This can be done by multiplying β0 with the column of the X matrix corresponding to β* and treating this vector as an offset to the linear predictor. In other words, this vector contains a fixed component of the linear predictor for each observation. The β* column is dropped from X, and the model is optimized with the offset term.

Goodness of fit

To check the model fit, we calculate the randomized probability inverse transform (Smith, 1985). This is done by evaluating the fitted conditional cdf (i.e., the cumulative distribution function, conditional on the covariates) of each observed response value. If the model fit is good, the probability inverse transform values should roughly follow a uniform distribution on the interval (0, 1). Because the gldrm fitted cdf is discrete, we use randomization to make the distribution continuous as follows.

Let F^(y|X=x) denote the fitted cdf conditional on a covariate vector x evaluated at y, and let yi=max({yj:yj<yi}{}). For each observation, we draw a random value from a uniform distribution on the interval (F^(yi|X=xi),F^(yi|X=xi)).

To illustrate a good gldrm fit, we generate 1,000 independent pairs (x, y) where x ~ Normal(mean = 0, sd = 1) and y|x ~ Normal(mean = x, sd = 1). The mean of y|x is linear in x, and the data generating mechanism is an exponential tilt family, so we expect the gldrm fit to be good. We fit the model and then do a visual check by plotting the histogram and uniform QQ plot of the randomized probability inverse transform values (Figure 1).

Figure 1:

Figure 1:

Scatterplot and probability inverse transform histogram and QQ plot for a good gldrm model fit.

To illustrate a poor gldrm fit, we generate 1,000 independent pairs (x, y) where x ~ Normal(mean = 0, sd = 1) and y|x Normal(mean = x, sd = x2). The mean of y|x is again linear in x, but this data generating mechanism is not an exponential tilt family. The diagnostic plots (Figure 2) confirm that the gldrm fit is not ideal. The probability inverse transform values are concentrated near the center of the interval (0, 1) rather than being uniformly distributed. The gldrm still provides a good estimate of the regression coefficients and the mean of y|x, but it is not the correct model for the cdf of y|x. .

Figure 2:

Figure 2:

Scatterplot and probability inverse transform histogram and QQ plot for a poor gldrm model fit.

Simulation experiments

Under four different simulation scenarios, we check the finite sample performance of the regression coefficient estimators, β^, as well as the reference distribution cdf estimator F^0(). For β^, we also check the accuracy of the estimated standard errors.

For each simulation, the data generating mechanism is a gamma glm. The covariates are the same under each simulation setting, and their values are fixed, not random. The covariate vector is x = (x0, x1, x2, x3). Variable x0 is an intercept column of ones. Variable x1 is an indicator with exactly 20% ones in each sample (observations 5, 10, 15, 20,… have x1 = 1, and the rest have x1 = 0). Variable x2 is a continuous variable that follows a uniform sequence between zero and one in each sample (the first observation has x2 = 0, and the last observation has x2 = 1). Lastly, x3 = x1 · x2.

The coefficient values were (β1, β2, β3) = (1, 1, −2) for all simulation scenarios. The intercepts were β0 = 0 for simulations 1 & 2, and β0 = 1 for simulations 3 & 4. These values were selected so the mean response values were centered close to one and, for the identity link scenarios, guaranteed to be positive.

The log link was used for simulations 1 & 2, and the identity link was used for simulations 3 & 4. For all four simulations, the response was drawn from a gamma distribution with Var(y|x) = ϕE(y|x)2, where ϕ varies by simulation to achieve different R2 values. R2 is defined as the squared correlation between the response and linear combination of predictors.

  1. Simulation 1: log link and high R2 (ϕ = 0.5, R2 ≈ 0.13)

  2. Simulation 2: log link and low R2 (ϕ = 4, R2 ≈ 0.019)

  3. Simulation 3: identity link and high R2 (ϕ = 0.25, R2 ≈ 0.13)

  4. Simulation 4: identity link and low R2 (ϕ = 2, R2 ≈ 0.018)

A gldrm was fit to each data set with correct link function and with f˜0 constrained to have mean μ0 = 1. If we had followed our usual practice of choosing μ0 to be the sample mean of the observed response values, then the reference distribution would have a different mean for each simulation replicate. By choosing μ0 = 1 for all replicates, the true f0 always follows a gamma distribution with mean one and variance ϕ, where ϕ varies by simulation scenario. The value μ0 = 1 was chosen because, by design, it fell within the range of observed response values for all 2,000 replicates of each simulation scenario. The cumulative reference distribution estimate, denoted as F^0(), was computed at percentiles 0.1, 0.25, 0.5, 0.75, 0.9.

For each simulation scenario, we display four tables. The first table (Tables 1, 5, 9, and 13) contains the sample mean of each β estimator. For comparison, we also calculated the gamma glm coefficient estimates for each simulated data set and display the sample mean alongside in parentheses.

Table 1:

Sample mean of β^. For comparison, the gamma glm sample mean is shown in parentheses.

β^ mean (gamma glm mean)
n = 25 n = 100 n = 400
β0 = 0 −0.02 (−0.02) 0.00 (0.00) 0.00 (0.00)
β1 = 1 0.93 (0.92) 0.98 (0.99) 0.99 (0.99)
β2 = 1 0.99 (1.00) 0.99 (1.00) 1.00 (1.00)
β3 = −2 −2.00 (−2.00) −2.00 (−2.01) −1.99 (−1.99)

Table 5:

Sample mean of β^. For comparison, the gamma glm sample mean is shown in parentheses.

β^ mean (gamma glm mean)
n = 25 n = 100 n = 400
β0 = 0 −0.16 (−0.19) −0.05 (−0.06) −0.02 (−0.02)
β1 = 1 0.21 (0.29) 0.80 (0.84) 0.96 (0.97)
β2 = 1 0.90 (0.96) 0.99 (1.01) 1.00 (1.00)
β3 = −2 −1.74 (−1.98) −1.93 (−2.01) −1.99 (−2.00)

Table 9:

Sample mean of β^. For comparison, the gamma glm sample mean is shown in parentheses.

β^ mean (gamma glm mean)
n = 25 n = 100 n = 400
β0 = 0 1.00(1.00) 0.99 (0.99) 1.00 (1.00)
β1 = 1 1.01 (1.01) 1.00 (1.00) 0.99 (0.99)
β2 = 1 1.01 (1.01) 1.01 (1.01) 1.00 (1.00)
β3 = −2 −2.02 (−2.01) −2.01 (−2.01) −1.99 (−1.99)

Table 13:

Sample mean of β^. For comparison, the gamma glm sample mean is shown in parentheses.

β^ mean (gamma glm mean)
n = 25 n = 100 n = 400
β0 = 0 1.02 (1.02) 1.01 (1.01) 1.00 (1.00)
β1 = 1 0.91 (0.89) 0.97 (1.00) 0.99 (0.99)
β2 = 1 0.99 (1.02) 0.97 (0.98) 0.99 (1.00)
β3 = −2 −1.86 (−1.85) −1.92 (−1.95) −1.98 (−1.99)

The second table (Tables 2, 6, 10, and 14) contains the root mean squared error (rmse) of each β estimator. The rmse is calculated as 12000i=12000(β^iβ)2, where β^i is the estimator of the ith simulation replicate, and β is the true parameter value. For comparison, we also show the relative efficiency compared to the gamma glm estimator. Relative efficiency is calculated as mseglm/msegldrm, where mse is the mean squared error (not rmse).

Table 2:

Root mean squared error (rmse) of β^. In parentheses is the relative efficiency compared to the gamma glm estimator.

β^ rmse (relative efficiency)
n = 25 n = 100 n = 400
β0 0.31 (0.99) 0.16 (1.00) 0.08 (1.00)
β1 0.81 (0.96) 0.38 (1.01) 0.18 (1.00)
β2 0.54 (1.00) 0.27 (1.00) 0.14 (0.99)
β3 1.27 (0.96) 0.63 (1.00) 0.30 (1.00)

Table 6:

Root mean squared error (rmse) of β^. In parentheses is the relative efficiency compared to the gamma glm estimator.

β^ rmse (relative efficiency)
n = 25 n = 100 n = 400
β0 0.94 (1.14) 0.45 (1.04) 0.23 (1.00)
β1 2.83 (1.43) 1.12 (1.09) 0.51 (1.02)
β2 1.62 (1.19) 0.78 (1.05) 0.39 (1.01)
β3 4.18 (1.59) 1.88 (1.14) 0.89 (1.02)

Table 10:

Root mean squared error (rmse) of β^. In parentheses is the relative efficiency compared to the gamma glm estimator.

β^ rmse (relative efficiency)
n = 25 n = 100 n = 400
β0 0.25 (0.99) 0.13 (0.99) 0.07 (1.00)
β1 0.88 (0.96) 0.40 (0.99) 0.20 (1.00)
β2 0.55 (0.98) 0.28 (0.99) 0.14 (1.00)
β3 1.26 (0.98) 0.63 (0.98) 0.32 (1.00)

Table 14:

Root mean squared error (rmse) of β^ In parentheses is the relative efficiency compared to the gamma glm estimator.

β^ rmse (relative efficiency)
n = 25 n = 100 n = 400
β0 0.73 (1.17) 0.39 (1.02) 0.19 (1.00)
β1 2.35 (1.05) 1.16 (1.09) 0.58 (1.02)
β2 1.58 (1.18) 0.81 (1.03) 0.40 (1.00)
β3 3.27 (1.18) 1.83 (1.11) 0.92 (1.02)

The third table (Tables 3, 7, 11, and 15) contains Wald confidence interval coverage rates for each β estimator. Confidence intervals were calculated based on a t-distribution with n − 4 degrees of freedom.

Table 3:

Wald confidence interval coverage rate for β.

80% C.I. 90% C.I. 95% C.I.
n = 25 n = 100 n = 400 n = 25 n = 100 n = 400 n = 25 n = 100 n = 400
β0 0.755 0.799 0.805 0.870 0.896 0.899 0.920 0.945 0.944
β1 0.677 0.764 0.800 0.782 0.860 0.900 0.837 0.919 0.949
β2 0.742 0.784 0.810 0.853 0.883 0.896 0.910 0.940 0.950
β3 0.681 0.767 0.806 0.800 0.869 0.907 0.867 0.920 0.948

Table 7:

Wald confidence interval coverage rate for β.

80% C.I. 90% C.I. 95% C.I.
n = 25 n = 100 n = 400 n = 25 n = 100 n = 400 n = 25 n = 100 n = 400
β0 0.704 0.770 0.782 0.806 0.877 0.888 0.869 0.933 0.945
β1 0.626 0.724 0.781 0.732 0.832 0.883 0.794 0.897 0.935
β2 0.680 0.755 0.774 0.795 0.862 0.881 0.869 0.925 0.939
β3 0.633 0.722 0.762 0.750 0.829 0.879 0.819 0.895 0.935

Table 11:

Wald confidence interval coverage rate for β.

80% C.I. 90% C.I. 95% C.I.
n = 25 n = 100 n = 400 n = 25 n = 100 n = 400 n = 25 n = 100 n = 400
β0 0.735 0.793 0.802 0.830 0.888 0.892 0.888 0.939 0.947
β1 0.670 0.789 0.799 0.785 0.875 0.892 0.847 0.931 0.949
β2 0.737 0.782 0.796 0.849 0.885 0.893 0.916 0.941 0.943
β3 0.667 0.773 0.792 0.800 0.876 0.896 0.872 0.937 0.942

Table 15:

Wald confidence interval coverage rate for β.

80% C.I. 90% C.I. 95% C.I.
n = 25 n = 100 n = 400 n = 25 n = 100 n = 400 n = 25 n = 100 n = 400
β0 0.661 0.761 0.794 0.754 0.845 0.893 0.802 0.893 0.938
β1 0.595 0.718 0.767 0.692 0.822 0.868 0.741 0.870 0.921
β2 0.665 0.769 0.779 0.777 0.864 0.895 0.847 0.910 0.943
β3 0.666 0.711 0.777 0.789 0.824 0.877 0.871 0.892 0.932

The fourth table (Tables 4, 8, 12, and 16) contains the mean of F^0(), calculated at the true 10th, 25th, 50th, 75th, and, 90th percentiles.

Table 4:

Sample mean of F^0 at selected true percentiles.

F^0(y) mean
F0(y) y n = 25 n = 100 n = 400
0.10 0.27 0.082 0.097 0.099
0.25 0.48 0.222 0.244 0.249
0.50 0.84 0.487 0.498 0.499
0.75 1.35 0.759 0.751 0.750
0.90 1.94 0.911 0.902 0.900

Table 8:

Sample mean of F^0 at selected true percentiles.

F^0(y) mean
F0(y) y n = 25 n = 100 n = 400
0.10 0.00 0.093 0.100 0.101
0.25 0.01 0.230 0.247 0.250
0.50 0.17 0.465 0.496 0.499
0.75 1.04 0.727 0.747 0.749
0.90 3.00 0.903 0.899 0.900

Table 12:

Sample mean of F^0 at selected true percentiles.

F^0 (y) mean
F0(y) y n = 25 n = 100 n = 400
0.10 0.44 0.077 0.095 0.098
0.25 0.63 0.219 0.244 0.249
0.50 0.92 0.492 0.498 0.499
0.75 1.28 0.769 0.753 0.751
0.90 1.67 0.913 0.903 0.901

Table 16:

Sample mean of F^0 at selected true percentiles.

F^0 (y) mean
F0(y) y n = 25 n = 100 n = 400
0.10 0.02 0.085 0.097 0.100
0.25 0.10 0.223 0.246 0.249
0.50 0.45 0.474 0.493 0.499
0.75 1.32 0.741 0.749 0.750
0.90 2.71 0.907 0.902 0.900

To summarize the results, the gldrm estimators perform as expected. In all four simulation scenarios, the bias of β^ and F^0() goes to zero as the sample size increases. For the high R2 scenarios, there is very little bias even at n = 25. Also, the relative efficiency of the β estimators compared to the gamma glm estimators goes to one as the sample size increases. This is expected because, as Rathouz and Gao (2009) demonstrated, the β and f0 estimators are asymptotically orthogonal, so gldrm and glm have equal asymptotic efficiency when the glm model is correctly specified. For the high R2 scenarios, the relative efficiency is close to one even at n = 25. For the low R2 scenarios, the gldrm estimator is actually more efficient than the glm estimator for small sample sizes.

The standard error estimates for gldrm β estimators are consistently low for small sample sizes, as demonstrated by low Wald confidence interval coverage rates. The coverage rates improve with increasing sample size, demonstrating good asymptotic properties of the standard error estimators. Likelihood ratio confidence intervals can be calculated with the gldrm R package and may have better small sample performance, as demonstrated by Huang (2014).

Simulation 1

Simulation 1 uses log link with β = (0, 1, 1, −2) and ϕ = 0.5. This results in an R2 of approximately 0.13. The simulation was replicated 2,000 times.

Simulation 2

Simulation 2 uses log link with β = (0, 1, 1, −2) and ϕ = 4. This results in an R2 of approximately 0.019. The simulation was replicated 2,000 times.

Simulation 3

Simulation 3 uses identity link with β = (1, 1, 1, −2) and ϕ = 0.25. This results in an R2 of approximately 0.13. The simulation was replicated 2,000 times.

Simulation 4

Simulation 4 uses identity link with β = (1, 1, 1, −2) and ϕ = 2. This results in an R2 of approximately 0.018. The simulation was replicated 2,000 times.

Likelihood ratio and score confidence intervals

To support our claim that likelihood ratio confidence intervals may have better small sample performance, we compared the Wald, likelihood ratio, and score 95% confidence interval coverage rates under the settings of Simulation 1 with n = 25. The coverage rates are shown in Table 17. The Wald coverage rates are similar to those in Table 3, but not identical because this experiment used a new set of 2,000 replicates.

Table 17:

Coverage rates for 95% confidence intervals under the settings of Simulation 1.

β0 β1 β2 β3
Wald 0.918 0.823 0.909 0.859
Likelihood ratio 0.969 0.939 0.958 0.944
Score 0.976 0.966 0.967 0.967

While the Wald confidence intervals tend to be too narrow, the score confidence intervals tend to be a bit too wide. The likelihood ratio intervals have coverage rates much closer to 0.95 than the corresponding Wald or score intervals. This is consistent with the findings of Huang (2014).

Computational time and scaling

The following simulation explores the computation time of gldrm and how it scales with the number of observations n and number of covariates p. For each value of n and p, we fit gldrm to 100 randomly generated data sets. A gldrm was fit once to each data set.

Covariates were drawn independently from a standard normal distribution, and coefficients were drawn independently from a uniform distribution on the interval (−1, 1). Simulation 1 used an identity link function with response drawn from a normal distribution with variance function V(μ) = 1. Simulation 2 used a log link function with response drawn from an exponential distribution, i.e. a gamma distribution with variance function V(μ) = μ2.

Iteration limits were set at 100 per θ update, 1,000 per f0 update, and 100 for the outer loop (for which each iteration consists of a single-iteration β update, followed by an f0 update). Convergence thresholds were set at 10−10 for the θ update, f0 update, and outer loop update. This experiment was run using a 2.2 GHz AMD Opteron 6174 processor. Figures 3 and 4 show the average CPU seconds for Simulations 1 and 2, respectively.

Figure 3:

Figure 3:

Mean computation time for Simulation 1. Error bars represent ±2 standard errors over 100 replicates.

Figure 4:

Figure 4:

Mean computation time for Simulation 2. Error bars represent ±2 standard errors over 100 replicates.

We also repeated this experiment with the number of support points fixed at 25. To do this, we generated n response values from the model. The first 25 values were designated as the support, and the remaining response values were matched to the nearest support value and set to that value. This discrete data generating model is not actually a gldrm model, but we are only using it to evaluate computation time. Figures 5 and 6 show the average CPU seconds for Simulations 1 and 2, respectively, with support size fixed at 25.

Figure 5:

Figure 5:

Mean computation time for Simulation 1 with support size fixed at 25. Error bars represent ±2 standard errors over 100 replicates.

Figure 6:

Figure 6:

Mean computation time for Simulation 2 with support size fixed at 25. Error bars represent ±2 standard errors over 100 replicates.

In summary, the computation time scales roughly linearly with n when the support is fixed at 25. When the support grows with n, the computation time grows faster than linearly. Computation time increases with p, but there is not a consistent pattern, especially with fixed support.

R package: gldrm

The gldrm package (Wurm and Rathouz, 2018) was written entirely in the R programming language. Its primary functions are the following.

  • gldrm is the main function for fitting gldrm models.

  • gldrmLRT performs a likelihood ratio test between nested gldrm models. The test statistic is calculated as 2 × (llikllik0)/r, where r is the difference is the number of parameters between the full and null models. Under the null hypothesis, the test statistic follows an asymptotic F distribution with degrees of freedom r and np, where n is the number of observations and p is the number of parameters in the full model.

  • gldrmCI calculates Wald or likelihood ratio confidence intervals for a single coefficient.

  • predict.gldrmFit is a predict method, which is modeled after the print.glm method in the stats package. Predictions can be obtained on the scale of the response or linear predictor, or the tilted nonparametric density for each observation can be returned.

  • gldrmPIT Returns a set of randomized probability inverse transform values and plots the histogram and uniform QQ plot.

R example: iris data

We demonstrate the gldrm package using the Iris data set from the datasets package. This is a data set of n = 150 observations. We choose sepal length to be the response variable. This variable has 35 unique values, so the support is K = 35. We first demonstrate how to fit a gldrm model with the optimization function, which is simply called gldrm. We demonstrate how to perform inference on the regression coefficients. We check the goodness of fit using the randomized probability inverse transform. Finally we show how to obtain predictions for a set of observations, including the predicted mean and nonparametric estimate of the distribution function.

Fit gldrm model

The gldrm optimization function takes a formula and data argument, similar to R’s glm function. Instead of passing both an error distribution and link function through a family argument, the gldrm only requires a link function. The link argument will accept the name of a link function (any function supported by make.link in the stats package is accepted). Alternatively, a custom link function can be passed as a list containing three items:

  1. linkfun A vectorized link function.

  2. linkinv The corresponding inverse link function, also vectorized.

  3. mu.eta The derivative of the inverse link function, also vectorized.

This list structure is the same as that of link-glm class objects, which are constructed by the make.link function. The custom link option allows great flexibility, but it is imperative that the user correctly specifies the inverse link and its derivative.

R> ### Load gldrm package and Iris data from datasets package
R> library(gldrm)
R> data(iris, package = “datasets”)
R> ### Fit gldrm with all variables
R> fit <- gldrm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width + Species,
R+                      data = iris, link = “log”)
R> fit
Summary of gldrm fit
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.1832 0.0369 32.10 < 2e-16 ***
Sepal.Width 0.0788 0.0128 6.17 6.4e-09 ***
Petal.Length 0.1128 0.0102 11.04 < 2e-16 ***
Petal.Width −0.0350 0.0248 −1.41 0.162
Speciesversicolor −0.0561 0.0395 −1.42 0.157
Speciesvirginica −0.0994 0.0557 −1.79 0.076 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Likelihood ratio test against null model:
F-statistic: 57.4
Numerator degrees of freedom: 5
Denominator degrees of freedom: 144
P-value: < 2e-16

Inference

The gldrmLRT function performs a semiparametric likelihood ratio test between two nested models. We demonstrate this on the Iris data by fitting a sub-model that excludes “Species”, which is a categorical variable with three levels and two degrees of freedom. We also obtain Wald and likelihood ratio confidence intervals for the petal width coefficient.

R> ### Fit gldrm without the categorical variable “Species”
R> fit0 <- gldrm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width,
R+                          data = iris, link = “log”)
R> ### Likelihood ratio test for the nested models
R> gldrmLRT(fit, fit0)
Likelihood ratio test:
F-statistic: 2.03
Numerator degrees of freedom: 2
Denomicator degrees of freedom: 144
P-value: 0.135
R> ### Wald 95% confidence interval for Petal.Width
R> gldrmCI(fit, term = “Petal.Width”, test = “Wald”, type = “2-sided”, level = .95)
95% Wald confidence interval for Petal.Width:
(−0.084, 0.014)
R> ### Likelihood ratio 95% confidence interval for Petal.Width
R> gldrmCI(fit, term = “Petal.Width”, test = “LRT”, type = “2-sided”, level = .95)
95% likelihood ratio confidence interval for Petal.Width:
(−0.094, 0.025)

Goodness of fit

The gldrmPIT function produces goodness of fit plots using the probability inverse transform. In addition to plotting, this function also returns the inverse transform values as a vector.

R> pit <- gldrmPIT(fit)

graphic file with name nihms-1011992-f0001.jpg

Prediction

We obtain predictions for three selected observations in the data set: one from each Species. These observations were contained in training data, but we could obtain predictions for out-of-sample observations in the same way. Using the predict method, we obtain the fitted mean response value for each observation, which is the estimate of E(Y|X = x).

We also use the predict method to obtain the nonparametric estimate of the conditional density f (y|X = x). This is obtained by setting the argument type = “fTilt”, which returns an n × K matrix with (i, k)th entry f˜kexp{θiskb(θi)}. Each row contains the nonparametric conditional density estimate for a given observation and sums to one. We use this matrix to calculate the conditional probabilities for the form P(y1 < Yy2|X = x) for each observation. Note that all observed support values (sepal length values) fall between four and eight, so all probability mass falls within this interval.

R> ### Select three observations; one from each Species
R> newdata <- iris[c(1, 51, 101), ]
R> ### Fitted mean Sepal.Length
R> fitted_mean <- predict(fit, newdata = newdata, type = “response”)
R> fitted_mean <- round(fitted_mean, 2)
R> ### Estimated Sepal.Length distribution of each observation
R> ### Note: all Sepal.Length values are between 4 and 8
R> fTilt <- predict(fit, newdata = newdata, type = “fTilt”)
R> spt <- fit$spt
R> F4 <- rowSums(fTilt[ , spt <= 4])
R> F5 <- rowSums(fTilt[ , spt <= 5])
R> F6 <- rowSums(fTilt[ , spt <= 6])
R> F7 <- rowSums(fTilt[ , spt <= 7])
R> F8 <- rowSums(fTilt[ , spt <= 8])
R> Ftilt <- cbind(F5-F4, F6-F5, F7-F6, F8-F7)
R> Ftilt <- round(Ftilt, 3)
R> colnames(Ftilt) <- c(“P(4=Y<=5)”, “P(5<Y<=6)”, “P(6<Y<=7)”, “P(7<Y<=8)”)
R> cbind(newdata, fitted_mean, Ftilt)
Sepal.Length Sepal.Width Petal.Length Petal.Width Species fitted_mean
1 5.1 3.5 1.4 0.2 setosa 5.00
51 7.0 3.2 4.7 1.4 versicolor 6.43
101 6.3 3.3 6.0 2.5 virginica 6.91
P(4<Y<=5) P(5<Y<=6) P(6<Y<=7) P(7<Y<=8)
1 0.625 0.375 0.000 0.000
51 0.000 0.136 0.832 0.032
101 0.000 0.006 0.649 0.344

Discussion

We introduced a new optimization algorithm for gldrm, which computationally scales better with the number of unique observed response values. This is especially useful for estimation of continuous response data where the number of parameters in the f˜0 parameter equals the sample size. In particular, the BFGS technique dramatically speeds up the f˜0 optimization step, and makes gldrm much more computationally feasible for either discrete or continuous response data. The new algorithm is implemented in the gldrm package. Simulation results show that the algorithm and software obtain accurate estimates and standard errors. Computational time was shown to be feasible for support sizes well over one thousand.

Future research directions could include the incorporation of random effects into the gldrm framework. Optimization techniques for generalized linear mixed models, such as adaptive Gaussian quadrature, may be useful for model estimation (Pinheiro and Chao, 2006; Pinheiro and Bates, 1995).

Acknowledgments

Research reported in this publication was supported by the National Heart, Lung, and Blood Institute of the National Institutes of Health under award number T32 HL083806 (for MJW) and R01 HL094786-05A1 (for PJR). The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health.

We thank Dr. Alan Huang, University of Queensland, for suggesting the use of probability inverse transform diagnostic plots, as well as providing the corresponding code, which we have incorporated into the gldrm package.

Appendix

Notation

In this appendix, we use to denote the partial derivative and d to denote the total derivative. We require this notation for chain rule derivatives, specifically to derive the score function with respect to β and f˜0. Each θi is implicitly a function of (β,f˜0) and hence should not be held fixed when differentiating the log-likelihood with respect to either β or f˜0. We also let

li=θiyilogk=1Kfk exp(θisk)+k=1KI(yi=sk) log fk (18)

denote the contribution of the ith observation to the log-likelihood.

A. Score function for f˜0

We derive Equation 12, which gives the score function with respect to f˜0, holding β fixed. Using the definition of li in Equation 18 and applying the chain rule, the kth element of the score function is

{S(f˜0;β)}k=dl(β,f˜0)dfk=i=1ndlidfk=i=1n(lifk+dθidfkliθi). (19)

The first term on the RHS of Equation 19 is

lifk=I(yi=sk)fkexp{θisk}m=1Kfmexp{θism}. (20)

The second term on the RHS of Equation 19 is

liθi=yik=1Kskfk exp{θsk}k=1Kfk exp{θsk}=yiμi. (21)

Recall that μi=g1(xiTβ), which does not vary with f˜0. Therefore,

0=ddfkμi=μifk+dθidfkμiθi, (22)

and the third term on the RHS of Equation 19 is

dθidfk=μifk/μiθi=exp{θisk}(skμi)exp{b(θi)}/b(θi). (23)

Plugging the results of Equations 20, 21, and 23 into Equation 19, we obtain

{S(f˜0;β)}k=i=1n{I(yi=sk)fkexp(θisk)exp{b(θi)}exp(θisk)exp{b(θi)}skμib(θi)(yiμi)}. (24)

We obtain the result of Equation 12 by applying the Jacobian transformation {S(g˜0;β)}k=fk{S(f˜0;β)}k.

B. Information matrix for f˜0

The f˜0 information matrix is not used during the BFGS optimization routine. However, we derive it here to correct a missing term in the Rathouz and Gao (2009) derivation. Each matrix element is

{I(f˜0;β)}(k,m)=E({S(f˜0;β)}k{S(f˜0;β)}m|Xk=xk,Xm=xm)                                         =i=1nE{AkAm2AkBm+BkBm|Xk=xk,Xm=xm}, (25)

where

Ak=I(yi=sk)fkexp(θisk)exp{b(θi}

and

Bk=exp(θisk)exp{b(θi)}exp(θisk)exp{b(θi)}skμib(θi)(yiμi).

From here on, all expectations are conditional on Xk = xk, Xm = xm, but we suppress the conditional expression. The first term on the RHS of Equation 25 is

E(AkAm)=exp(θisk)I(k=m)fkexp{b(θi)}exp(θisk+θism)exp{2b(θi)}. (26)

The second term on the RHS of Equation 25 is

E(BkBm)=exp(θisk+θism)exp{2b(θi)}(skμi)(smμi)b(θi), (27)

where we use the fact that E{(yiμi)2} = Var(yi) = b″(θi). The third term on the RHS of Equation 25 is

E(AkBm)=exp(θisk+θism)exp{2b(θi)}(skμi)(smμi)b(θi), (28)

where we use the fact that E{I(yi = sk)(yiμi)} = (ykμi)fk exp(θisk)/ exp{b(θi)}. Plugging the results of Equations 2628 into Equation 25, we obtain

{I(f˜0;β)}(k,m)=i=1n{exp(θisk)I(k=m)fkexp{b(θi)}exp(θisk+θism)exp{2b(θi)}exp(θisk+θism)exp{2b(θi)}(skμi)(smμi)b(θi)}. (29)

C. Score function for β

We derive Equation 15, which gives the score function with respect to β, holding f˜0 fixed. By the chain rule, each element is

S(β;f˜0)=dl(β,f˜0)dβ=i=1ndlidβ=i=1ndμidβdθidμiliθi (30)

We already derived the first term on the RHS of Equation 30 in Equation 21. Because μi = b′(θi),

dθidμi=1/(dμidθi)=1b(θi). (31)

Because g(μi)=xiTβ,

dμidβ=xi(1g(μi)). (32)

Plugging the results of Equations 21, 31, and 32 into Equation 30, we obtain the result of Equation 15.

D. Proof that transformed response with modified link function has equivalent log-likelihood

Let vm+M2 and ρMm2. Let yi*=(yiv)/ρ and sk*=(skv)/ρ. Equation 18 can be rewritten

li=θi(v+ρyi*)logk=1Kfk exp {θi(ν+ρsk*)}+k=1KI(yi*=sk*) log fk     =θi*yi*logk=1Kfk exp{θi*sk*}+k=1KI(yi*=sk*) log fk, (33)

where θi*=θiρ. Equation 6 can be rewritten as

g1(xiTβ)=k=1K(v+ρsk*)fk exp {θi(v+ρsk*)}k=1Kfk exp{θi(v+ρsk*)}                       =v+ρ(k=1Ksk*fk exp {θi*sk*}k=1Kfk exp{θi*sk*}). (34)

Hence, if we define a modified link function g*(μ) = g(v + ρμ) with inverse g*1(η)=(g1(η)v)/ρ, we can write

g*1(xiTβ)=(k=1Ksk*fk exp{θi*sk*}k=1Kfk exp{θi*sk*}). (35)

In other words θi* has the same implicit definition as θi when the modified link function and transformed response variable are used in place of the oginal. This shows that, as a function of (β,f˜0), the log-likelihood with the transformed response and modified link function is equivalent to the original log-likelihood. Note that θi* must be multiplied by 1/ρ if one would like calculate θi on the original scale.

Contributor Information

Michael J. Wurm, Department of Statistics, University of Wisconsin–Madison, 11300 University Avenue, Madison, WI 53706, USA

Paul J. Rathouz, Department of Biostatistics & Medical Informatics, University of Wisconsin School of Medicine and Public Health, K6/446 CSC, Box 4675, 600 Highland Avenue, Madison, WI 53792-4675, USA

Bibliography

  1. Broyden CG. The convergence of a class of double-rank minimization algorithms. IMA Journal of Applied Mathematics, 6(3):222–231, 1970. URL 10.1093/imamat/6.3.222. [p288] [DOI] [Google Scholar]
  2. Fletcher R. A new approach to variable metric algorithms. The Computer Journal, 13(3):317–322, 1970. URL 10.1093/comjnl/13.3.317. [p289] [DOI] [Google Scholar]
  3. Goldfarb D. A family of variable-metric methods derived by variational means. Mathematics of Computation, 24(109):23–26, 1970. URL 10.1090/S0025-5718-1970-0258249-6. [p289] [DOI] [Google Scholar]
  4. Huang A. Joint estimation of the mean and error distribution in generalized linear models. Journal of the American Statistical Association, 109(505):186–196, 2014. URL 10.1080/01621459.2013.824892. [p288, 289, 292, 295, 298] [DOI] [Google Scholar]
  5. Huang A and Rathouz PJ. Proportional likelihood ratio models for mean regression. Biometrika, 99(1):223–229, 2012. URL 10.1093/biomet/asr075. [p288, 290] [DOI] [PMC free article] [PubMed] [Google Scholar]
  6. Lovric M. International Encyclopedia of Statistical Science. Springer, 2011. ISBN 3642048986. [p288] [Google Scholar]
  7. Owen AB, Crc H, Raton B, New L, Washington Y, A. B A, and Owen A. Empirical Likelihood. CRC Press, 2001. ISBN 1584880716. [p288] [Google Scholar]
  8. Pinheiro JC and Bates DM. Approximations to the log-likelihood function in the nonlinear mixed-effects model. Journal of Computational and Graphical Statistics, 4(1):12–35, 1995. URL 10.1080/10618600.1995.10474663. [p303] [DOI] [Google Scholar]
  9. Pinheiro JC and Chao EC. Efficient laplacian and adaptive gaussian quadrature algorithms for multilevel generalized linear mixed models. Journal of Computational and Graphical Statistics, 15(1): 58–81, 2006. URL 10.1198/106186006X96962. [p303] [DOI] [Google Scholar]
  10. Rathouz PJ and Gao L. Generalized linear models with unspecified reference distribution. Biostatistics, 10(2):205–218, 2009. URL 10.1093/biostatistics/kxn030. [p288, 289, 290, 295, 306] [DOI] [PMC free article] [PubMed] [Google Scholar]
  11. Shanno DF. Conditioning of quasi-newton methods for function minimization. Mathematics of Computation, 24(111):647–656, 1970. URL 10.1090/S0025-5718-1970-0274029-X. [p289] [DOI] [Google Scholar]
  12. Smith J. Diagnostic checks of non-standard time series models. Journal of Forecasting, 4(3):283–291, 1985. URL 10.1002/for.3980040305. [p293] [DOI] [Google Scholar]
  13. Wurm M and Rathouz P. gldrm: Generalized Linear Density Ratio Models, 2018. URL https://CRAN.R-project.org/package=gldrm. R package version 1.5. [p289, 292, 300] [PMC free article] [PubMed] [Google Scholar]

RESOURCES