Tutorials › Generalized Linear Models › Constructing a Profile Likelihood for a Scalar Target

Profile Likelihood and Intervals · Tutorial 283 of 981

Constructing a Profile Likelihood for a Scalar Target

Learn to construct a scalar profile likelihood and to calculate it by fitting the nuisance intercept separately at each fixed slope.

Advanced 10 min read

What You'll Learn

  • Define a profile likelihood for a scalar parameter or function of model parameters.
  • Distinguish the profile likelihood from the likelihood at a fixed nuisance-parameter value.
  • Derive the intercept score equation for a binomial regression at a fixed slope.
  • Establish when that score equation has a unique finite solution.
  • Calculate profile likelihood values, including the binomial likelihood constants.

Fix the Target, Refit the Nuisance Parameters

A likelihood describes how well each possible parameter value accounts for the observed data. When the parameter of interest is only one component of a larger GLM parameter vector, the likelihood at a proposed target value still depends on the other components. The profile likelihood addresses this by fixing the target and maximizing over all remaining, nuisance parameters. The nuisance estimates can therefore change as the target changes.

This is different from simply substituting one fixed nuisance-parameter value into the likelihood. In the profile, the nuisance parameters are re-estimated separately for each target value. The construction gives a one-dimensional function even when the original model has several parameters.

Definition: Let \(\theta\) be a parameter vector, let \(\psi=g(\theta)\) be a scalar parameter of interest, and let \(L(\theta)\) be the likelihood. The profile likelihood for \(\psi\) is $$ L_p(\psi)=\sup_{\theta:\,g(\theta)=\psi} L(\theta). $$ The supremum is taken over the feasible parameter values satisfying the constraint \(g(\theta)=\psi\). If it is attained, \(L_p(\psi)\) is the likelihood evaluated at a constrained maximizer. Its logarithm is the profile log-likelihood, \(\ell_p(\psi)=\log L_p(\psi)\), when \(L_p(\psi)>0\).

For a parameter vector written as \(\theta=(\psi,\lambda)\), where \(\lambda\) denotes nuisance parameters, the definition is \(L_p(\psi)=\sup_{\lambda}L(\psi,\lambda)\), with the supremum restricted to values allowed by the model. A constrained maximizer may be denoted \(\hat{\lambda}(\psi)\); this notation emphasizes that its value depends on the fixed target. When the maximizing nuisance value exists, \(\ell_p(\psi)=\ell(\psi,\hat{\lambda}(\psi))\).

Two Properties of the Profile

The profile retains the likelihood scale and compares the best fit available at each target value. The following basic property explains how its maximum relates to the unrestricted likelihood maximum.

Theorem: Suppose the parameter space is partitioned into the feasible sets \(\{\theta:g(\theta)=\psi\}\), and define \(L_p\) using a supremum over each such set. Then $$ \sup_{\psi} L_p(\psi)=\sup_{\theta}L(\theta). $$ If a global likelihood maximum \(\hat{\theta}\) exists, then \(L_p(g(\hat{\theta}))=L(\hat{\theta})\).

Proof. Every feasible \(\theta\) belongs to the set indexed by \(\psi=g(\theta)\). Thus \(L(\theta)\leq L_p(g(\theta))\), so \(\sup_\theta L(\theta)\leq\sup_\psi L_p(\psi)\). Conversely, for each \(\psi\), the set defining \(L_p(\psi)\) is a subset of the full parameter space, so \(L_p(\psi)\leq\sup_\theta L(\theta)\). Taking the supremum over \(\psi\) gives the reverse inequality. If \(\hat{\theta}\) is a global maximizer, then \(L_p(g(\hat{\theta}))\geq L(\hat{\theta})\), and it cannot exceed the global maximum. Therefore equality holds. \(\square\)

This argument uses suprema and does not require a maximizer to exist at every target value. In applications, however, it matters whether the nuisance-parameter maximum is actually attained. In the binomial regression below, the intercept score equation gives a useful existence and uniqueness condition.

Profiling the Intercept in Binomial Regression

Consider independent grouped binomial observations \(Y_i\sim\operatorname{Binomial}(m_i,p_i)\), with fixed covariates \(x_i\), positive group sizes \(m_i\), and logistic mean model \( \operatorname{logit}(p_i)=\alpha+\beta x_i \). Here \(\beta\) is the scalar target and \(\alpha\) is the nuisance intercept. For a fixed value \(b\) of the slope, the likelihood as a function of the intercept is

$$ L(\alpha,b)=\prod_{i=1}^n {m_i\choose y_i} p_i(\alpha,b)^{y_i}\{1-p_i(\alpha,b)\}^{m_i-y_i}, \qquad p_i(\alpha,b)=\frac{\exp(\alpha+b x_i)}{1+\exp(\alpha+b x_i)}. $$

The binomial coefficients do not depend on either parameter, but they are part of the likelihood and should be retained when reporting its numerical value. The log-likelihood, apart from those constants, is \( \sum_i\{y_i(\alpha+b x_i)-m_i\log(1+\exp(\alpha+b x_i))\} \). Differentiating with respect to \(\alpha\) gives the intercept score equation

$$ \frac{\partial\ell(\alpha,b)}{\partial\alpha} =\sum_{i=1}^n\{y_i-m_i p_i(\alpha,b)\}=0. $$
Theorem: Fix any finite slope \(b\). Suppose \(m_i>0\), all \(x_i\) are finite, and the total number of successes \(S=\sum_i y_i\) satisfies \(0<S<M\), where \(M=\sum_i m_i\). Then there is a unique finite intercept \(\hat{\alpha}(b)\) maximizing the binomial log-likelihood at that slope. It is the unique solution of $$ \sum_{i=1}^n m_i p_i(\alpha,b)=S. $$

Proof. The derivative of the score with respect to \(\alpha\) is

$$ \frac{\partial^2\ell(\alpha,b)}{\partial\alpha^2} =-\sum_{i=1}^n m_i p_i(\alpha,b)\{1-p_i(\alpha,b)\}<0 $$

for every finite \(\alpha\), because \(m_i>0\) and \(0<p_i(\alpha,b)<1\). Hence the score is strictly decreasing. As \(\alpha\to-\infty\), every \(p_i(\alpha,b)\to0\), so the score tends to \(S>0\). As \(\alpha\to+\infty\), every \(p_i(\alpha,b)\to1\), so the score tends to \(S-M<0\). The score is continuous, so it has a zero by the intermediate value theorem; strict decrease makes that zero unique. The log-likelihood increases before this zero and decreases after it, so the zero is the unique finite maximizer. \(\square\)

If \(S=0\) or \(S=M\), the score need not have a finite zero: the likelihood can instead approach its supremum as the intercept tends to \(-\infty\) or \(+\infty\). This boundary case is one reason to distinguish a supremum in the definition from an attained maximum.

Worked Binomial Calculations

With a binary covariate \(x=0,1\), write \(p_0\) and \(p_1\) for the probabilities in the two groups. At a fixed slope \(b\), the logistic model imposes \( \operatorname{logit}(p_1)-\operatorname{logit}(p_0)=b \). When the two groups have equal size, profiling the intercept also requires the fitted probabilities to sum to the observed total successes divided by that common size. These two equations determine the fitted probabilities at the fixed slope.

Worked Example: A Small Profile Value at Zero Slope

Suppose the two groups each contain four trials, with one success at \(x=0\) and three successes at \(x=1\). Find the profile likelihood at \(\beta=0\).

At \(\beta=0\), the model requires \(p_0=p_1=p\), so the intercept fit uses the pooled success fraction: \( p=(1+3)/(4+4)=1/2 \). The likelihood, including both binomial coefficients, is

$$ L_p(0) ={4\choose1}{4\choose3} \left(\frac12\right)^{1+3} \left(\frac12\right)^{(4-1)+(4-3)} =4\cdot4\cdot\left(\frac12\right)^8 =\frac{1}{16}=0.0625. $$

Equivalently, the log-likelihood is \(\ell_p(0)=\log(1/16)\approx-2.7726\). The common fitted probability is the nuisance-parameter estimate at this particular target value; it is not held fixed for other values of \(\beta\).

Worked Example: Profiling at a Log Odds Ratio of \(\log 2\)

Now suppose each group has ten trials, with two successes at \(x=0\) and seven at \(x=1\). Calculate the profile likelihood at \(\beta=\log 2\).

The intercept score equation requires \(10p_0+10p_1=9\), or \(p_0+p_1=0.9\). The fixed slope imposes an odds ratio of two: \( \{p_1/(1-p_1)\}/\{p_0/(1-p_0)\}=2 \). Substitute \(p_1=0.9-p_0\) into this odds-ratio equation:

$$ (0.9-p_0)(1-p_0)=2p_0(0.1+p_0), \qquad p_0^2+2.1p_0-0.9=0. $$

The root in \((0,1)\) is \(p_0=(-2.1+\sqrt{8.01})/2\approx0.365097\), so \(p_1=0.9-p_0\approx0.534903\). The corresponding intercept is \( \hat{\alpha}(\log 2)=\log\{p_0/(1-p_0)\}\approx-0.553 \). The fitted probabilities satisfy both constraints: they sum to \(0.900000\), and their odds ratio is two.

The full likelihood includes \({10\choose2}{10\choose7}=45\cdot120=5400\). Therefore

$$ \begin{aligned} \ell_p(\log 2) &=\log(5400)+2\log(0.365097)+8\log(0.634903)\\ &\quad+7\log(0.534903)+3\log(0.465097)\\ &\approx 8.5942-2.0152-3.6343-4.3797-2.2965\\ &\approx -3.7315, \end{aligned} $$

and \(L_p(\log 2)=\exp(-3.7315)\approx0.0240\). Keeping the fitted probabilities and the binomial constants consistent is essential: likelihood values can otherwise be numerically wrong even when the intercept calculation is correct.

Worked Example: A Different Dataset at Zero Slope

Suppose the \(x=0\) group has eight trials and two successes, while the \(x=1\) group has twelve trials and nine successes. Find the profile likelihood at \(\beta=0\).

With zero slope, the two groups share a probability. Maximizing the binomial likelihood gives the pooled estimate \(p=(2+9)/(8+12)=11/20=0.55\). The binomial-coefficient factor is \({8\choose2}{12\choose9}=28\cdot220=6160\). Thus

$$ \begin{aligned} L_p(0) &=6160(0.55)^{11}(0.45)^9,\\ \ell_p(0) &=\log(6160)+11\log(0.55)+9\log(0.45)\\ &\approx 8.7258-6.5762-7.1866\\ &\approx -5.0370, \end{aligned} $$

so \(L_p(0)\approx \exp(-5.0370)\approx0.00649\). The pooled probability is \(11/20\), not the unweighted average of the two observed proportions: the groups have different sizes.

Reading and Using the Profile

For each proposed slope \(b\), the calculation has the same logic: impose that slope, find the intercept maximizing the likelihood under that constraint, and evaluate the likelihood at the resulting fit. The curve \(b\mapsto L_p(b)\), or its log version \(b\mapsto\ell_p(b)\), records the best attainable fit at every slope value. Its global maximum agrees with the unrestricted maximum when that maximum exists, as shown above.

In computation, the nuisance fit is often obtained by solving the intercept score equation numerically. For a simple two-group model, the equations may be solved directly as in the worked calculation. For larger designs, the same fixed-target principle applies, but the nuisance optimization may require a numerical GLM fit. A profile value is meaningful only if the optimization respects the target constraint and the model's feasible parameter space.

Common Mistakes

  • Holding the nuisance estimate fixed. Evaluating \(L(\psi,\hat{\lambda})\) with one fixed \(\hat{\lambda}\) is not generally the profile. For each \(\psi\), maximize over nuisance values anew.
  • Confusing a target value with a fitted estimate. In the slope example, \(b\) is fixed during the constrained fit; \(\hat{\alpha}(b)\) is then found from the intercept score equation.
  • Dropping likelihood constants without saying so. Binomial coefficients do not affect the maximizing parameters, but omitting them changes the numerical likelihood. Log-likelihoods with the constants omitted are not the full log-likelihood values reported above.
  • Assuming every conditional maximum is attained. With all failures or all successes, the intercept supremum may occur only as the intercept diverges. State whether the profile uses a maximum or a supremum.
  • Using an unweighted average of group proportions. At zero slope, the common binomial probability is the pooled success fraction, weighted by group sizes.
Key takeaway: A scalar profile likelihood fixes the target and gives every nuisance parameter the value that maximizes the likelihood under that constraint. In binomial regression with a fixed slope, profiling the intercept means solving its score equation and evaluating the full likelihood at that fitted intercept.

Check Your Understanding

For each question, make clear which parameter is fixed and which is optimized.

  1. In a model with target \(\psi\) and nuisance vector \(\lambda\), write the definition of the profile likelihood.
  2. For grouped binomial data with a logistic intercept and fixed slope, state the intercept score equation.
  3. Why does \(0<S<M\) guarantee a unique finite intercept maximizer at a fixed finite slope under the conditions stated above?
  4. At zero slope with group sizes \(8\) and \(12\), and success counts \(2\) and \(9\), what common probability maximizes the likelihood? Why is an unweighted average inappropriate?
  5. Explain why dropping binomial coefficients leaves the fitted parameters unchanged but changes the numerical likelihood.
Clinical Biostats