Back in 1989, Thomas A. Warm (1937–2019) published a paper in Psychometrika that was to have an important influence on practical testing. It described a way to reduce the inherent bias in the maximum likelihood estimate of the person’s ability, given the responses and the item parameters. All testing is ultimately about estimating ability, so the paper naturally got a lot of attention.

We are not aware of any subsequent publications by T.A., although we did find a highly readable IRT primer on the Internet. Sadly, we also found an obituary. It says that he was in the army and that he enjoyed Japanese drumming (who doesn’t?), but there is no mention of psychometrics at all. Looking further, we found this picture on LinkedIn:

We don’t know whether this elusiveness was due to the extreme modesty of a private person, or to the military status of some of his employers, such as the U.S. Coastal Guard Institute. But we feel that T.A. deserves some kind of tribute by our community, and Timo proposed to write one. Predictably, the formulae started pouring out immediately, but what nicer tribute for a scientist?

Introduction

Starting with the simplest non-trivial case, we assume that the test consists of nn equally difficult Rasch items with π(θ)=exp(θ)1+exp(θ), \pi(\theta) = \frac{\exp(\theta)}{1+\exp(\theta)}, the probability to find the correct answer on any of the items. The ML estimate (MLE) of π(θ)\pi(\theta) is π̂=x+n\hat{\pi} = \frac{x_+}{n} where x+x_+ is the number of items answered correctly. From the invariance property of the MLE, it follows that θ̂=lnx+n1x+n \hat{\theta} = \ln \frac{\frac{x_+}{n}}{1-\frac{x_+}{n}} is the MLE of ability.

Unfortunately, θ̂\hat{\theta} is infinite for extreme scores; that is, -\infty when x+=0x_+=0 or ++\infty when x+=nx_+=n. One could say that θ̂\hat{\theta} is extremely biased and (under) over-estimates the ability corresponding to (x+=0x_+=0) x+=nx_+=n. To reduce bias, Haldane (1956) suggested that we replace π̂\hat{\pi} by π̂*=x++12n+1. \hat{\pi}^*=\frac{x_++\frac{1}{2}}{n+1}. If we do so, we find θ̂*=lnx++12n+1(x++12) \hat{\theta}^* = \ln \frac{x_++\frac{1}{2}}{n+1-\left(x_+ + \frac{1}{2}\right)} which we will call Haldane’s estimate. As Haldene’s estimate is finite even for the extreme scores, it is obviously less biased than the MLE.

The Warm estimate was similarly developed to prevent small-sample bias but, apparently, using a very different approach. Specifically, the Warm estimator is a weighted maximum likelihood estimate (WMLE) that maximizes a weighted likelihood function L(θ)W(θ)L(\theta)W(\theta). We obtain the Warm estimate when W(θ)=I(θ)W(\theta) = \sqrt{I(\theta)}, where I(θ)I(\theta) is the test information function. Here,
L(θ)I(θ)ex+θ(1+eθ)nneθ(1+eθ)2e(x++12)θ(1+eθ)n+1 L(\theta)\sqrt{I(\theta)} \propto \frac{e^{x_+\theta}}{(1+e^\theta)^{n}}\sqrt{ \frac{ne^{\theta}}{(1+e^{\theta})^2}} \propto\frac{e^{(x_++\frac{1}{2})\theta}}{(1+e^\theta)^{n+1}} As the right-hand side is the original likelihood function with x+x_+ replaced by x++1/2x_++1/2 and nn replaced by n+1n+1, it follows that the Warm estimate of ability equals Haldane’s estimate; see also Verhelst, Verstralen, and Jansen (1997).

This blog intends to explain the Warm estimate. We assume that the IRT model is a nominal response model. That is, a person with ability θ\theta answers independently to different items and has a probability
Pij(θ)=bijeaijθhbiheaihθ P_{ij}(\theta) = \frac{b_{ij} e^{a_{ij}\theta}}{\sum_h b_{ih} e^{a_{ih}\theta}} to earn an item score of aija_{ij} on item ii where bijb_{ij} is an item category parameter with j=0,,mij=0, \dots, m_i, ai0=0a_{i0}=0 and bi0=1b_{i0}=1. We focus on the estimation of θ\theta and we assume both the aija_{ij} and bijb_{ij} to be fixed. The IRT model is then a member of the exponential family with canonical parameter θ\theta where the test score is a sufficient statistic for θ\theta. This includes the Rasch model and the OPLM as special case. If the aija_{ij} are fixed, it also includes the 2PL.

Preliminaries

We have a scalar parameter θ\theta and a statistic θ̂\hat{\theta}. When estimating θ\theta, θ̂\hat{\theta} is called an estimator and its observed value an estimate. For simplicity, we use the single term estimate and a single symbol; i.e., θ̂\hat{\theta} for the MLE and θ̂*\hat{\theta}^* for the Warm estimate.

MLE, WMLE and the Warm estimate

The MLE θ̂\hat{\theta} is the value that maximizes the likelihood function or, equivalently, its natural logarithm the log-likelihood function l(θ)=lnL(θ)l(\theta)=\ln L(\theta). It is defined as the root of the score function: S(θ)=ddθl(θ). S(\theta) = \frac{d}{d\theta} l(\theta).

The WMLE is the root θ̂*\hat{\theta}^* of the weighted score function S*(θ)=ddθ[l(θ)+w(θ)] S^*(\theta) = \frac{d}{d\theta} \left[l(\theta) + w(\theta)\right] where w(θ)=lnW(θ)w(\theta)=\ln W(\theta) is the log-weight function. The Warm estimate is a special kind of WMLE where w(θ)=12lnI(θ)w(\theta) = \frac{1}{2}\ln I(\theta). Note that I(θ)=S(θ)I(\theta) = -S'(\theta).

Bias

Bias is the difference between the expected value of the estimate and the true value B(θ)=Eθ[θ̂|𝐱]θ B(\theta) = E_{\theta}[\hat{\theta}|\mathbf{x}] - \theta where the expectation is taken with respect to the distribution of the data given the true value of ability. In the example with equivalent Rasch items, the MLE, π̂=x+/n\hat{\pi} = x_+/n, is an unbiased estimate of π\pi. However, the estimate θ̂\hat{\theta}, although it is the MLE of θ\theta, was not unbiased. This is not surprising given that E[θ̂]=E[lnπ̂1π̂]lnE[π̂]1+E[π̂]=θ. E[\hat{\theta}] = E\left[\ln \frac{\hat{\pi}}{1-\hat{\pi}}\right] \neq \ln \frac{E[\hat{\pi}]}{1+E[\hat{\pi}]} =\theta. An estimate of θ\theta would only be unbiased if θ\theta is a linear function of π\pi. To obtain the Warm estimate, we essentially ‘biased’ the MLE of π\pi to obtain an estimate of θ\theta that was less biased.

In general, the MLE is not unbiased but the bias is of order 1/n1/n: B(θ̂)=b(θ)n+o(1n) B(\hat{\theta}) = \frac{b(\theta)}{n}+o\left(\frac{1}{n}\right) So the bias vanishes as nn\rightarrow \infty. Unfortunately, the number of items is typically small which is why we have to worry about bias. The term b(θ)/nb(\theta)/n is called the first-order bias.

Note that the mean-squared error, Eθ[(θ̂θ)2]=Varθ(θ̂)+B2(θ) E_{\theta}[(\hat{\theta}-\theta)^2] = Var_{\theta}(\hat{\theta})+B^2(\theta) is also of order n1n^{-1} with its main contribution the variance since B2B^2 is of order n2n^{-2}. Thus, a biased estimator may be better than an unbiased one if it has smaller variance and hence smaller mean-squared error.

First-order bias of the MLE

Using a Taylor-series expansion to approximate S(θ̂)S(\hat{\theta}) around the true value θ\theta, Lord (1983) found: E[θ̂θ]=J(θ)2I2(θ)+o(n1) E[\hat{\theta}-\theta] = \frac{-J(\theta)}{2I^2(\theta)} +o(n^{-1}) where J(θ)=I(θ)=S(θ)J(\theta)=I'(\theta)=-S''(\theta). Lord’s result is an instance of a general result derived, for example, in Cox and Hinkley (1974) or, slightly easier, in Mardia, Southworth, and Taylor (1999).

Note that I(θ)=iIi(θ)I(\theta)=\sum_i I_i(\theta) with Ii(θ)I_i(\theta) the item information function. If we write I(θ)=n1iI(θ)\bar{I}(\theta) = n^{-1}\sum_i I(\theta) for the average information per item, we find that b(θ)=J(θ)2I2(θ)=ddθlnI(θ) b(\theta) = -\frac{\bar{J}(\theta)}{2\bar{I}^2(\theta)} =-\frac{d}{d\theta} \ln \sqrt{\bar{I}(\theta)} Thus, the first-order bias is zero at the value of θ\theta where the (average) information function reaches its maximum value. It follows that first-order bias is smallest for those persons whose ability matches the difficulty of the test. For example, in the case of equally difficult Rasch items, b(θ)=1eθδ2(1+eθδ) b(\theta) = -\frac{1-e^{\theta-\delta}}{2(1+e^{\theta-\delta})} which is zero when θ=δ\theta=\delta and the ability of the test taker matches exactly the difficulty of the items.

Correction or prevention

Lord suggests to correct the MLE for first-order bias. That is, to use θ̃=θ̂b(θ)n\tilde{\theta} = \hat{\theta} - \frac{b(\theta)}{n} whose bias B(θ̃)=o(n1)B(\tilde{\theta})=o(n^{-1}). Efron et al. (1975) shows that this still holds if we substitute θ=θ̂\theta=\hat{\theta} for the true value. The problem is that this ‘bias-corrected’ estimate would be undefined when the ML estimates are infinite.

Like Haldane, Warm suggests instead a method to prevent bias. Namely, to weight (or bias) the score function to reduce the bias in the MLE. He found that: B(θ*)=1I(θ)[w(θ)J(θ)2I(θ)]+o(n1) B(\theta^*) = \frac{1}{I(\theta)}\left[w'(\theta) - \frac{J(\theta)}{2I(\theta)}\right] + o(n^{-1}) such that B(θ*)=o(n1)B(\theta^*) = o(n^{-1}) if we define w(θ)=12lnI(θ)w(\theta) =\frac{1}{2}\ln I(\theta).

Warm also succeeded in showing that the asymptotic distribution of the WMLE equals that of the MLE. As nn grows to infinity, both estimates are normally distributed around the true value with variance I(θ)1I(\theta)^{-1}.

The connection to Jeffrey’s prior

If W(θ)W(\theta) is a prior density function of θ\theta, the weighted likelihood is (proportional to) a posterior density function. It follows that θ̂*\hat{\theta}^* is a Bayesian modal estimate of θ\theta when the prior W(θ)lnI(θ)W(\theta) \propto \sqrt{\ln I(\theta)}. This prior is is known as Jeffreys prior.

Jeffreys prior was named after the statistician who introduced it as a prior distribution that results in a posterior that is invariant under reparametrization Jeffreys (1946). Warm notes the connection but doesn’t seem to believe that Jeffreys prior makes sense. He writes:

Suppose the same test was given to two groups of examinees, whose distributions of θ\theta are different and known. Bayesians will be obliged to use different priors for the two groups. For WLE the same w(θ)w(\theta) would be used for both groups, because w(θ)w(\theta) is a function of the test only. Similarly, if two different tests of the same ability are given to a single group, Bayesians would use the same prior for both tests, whereas for WLE a different w(θ)w(\theta) would be used for each test.

Personally, we see no objection to being ignorant of group differences and base our ability estimate on the test only.

Calculating the Warm estimate in R

The Warm estimate is not easy to calculate.

Rasch model

For the Rasch model it is relatively simple. The log-likelihood function is l(θ)=x+θiln(1+eθδi) l(\theta) = x_+ \theta -\sum_i \ln(1+e^{\theta-\delta_i}) The corresponding score function is S(θ)=l(θ)=x+ieθδi1+eθδi=x+iPi(θ)=x+E[X+|θ]\begin{align*} S(\theta) = l'(\theta) &= x_+ - \sum_i \frac{e^{\theta-\delta_i}}{1+e^{\theta-\delta_i}} \\ &= x_+ - \sum_i P_i(\theta) \\ &= x_+ -E[X_+|\theta] \end{align*} As a property of the exponential family, this has the form x+E[X+|θ]x_+ -E[X_+|\theta]. Hence, finding the MLE of ability means finding the ability such that the expected test score equals the observed one. The information function is I(θ)=S(θ)=iPi(θ)\begin{align*} I(\theta) &= -S'(\theta) \\ &= \sum_i P'_i(\theta)\\ \end{align*} where Pi(θ)=Pi(θ)(1Pi(θ))P'_i(\theta) = P_i(\theta)(1-P_i(\theta)). Finally, $$ J(\theta) = \sum_i P'_i(\theta)\left[1-2P_i(\theta)\right]\\ $$ The log-weighted score is thus: S*(θ)=x+E[X+|θ]+J(θ)2I(θ)=x+iPi(θ)+iPi(θ)[12Pi(θ)]2hPh(θ)(1Ph(θ))\begin{align*} S*(\theta) &= x_+ -E[X_+|\theta] + \frac{J(\theta)}{2I(\theta)}\\ &=x_+ - \sum_i P_i(\theta) +\frac{\sum_i P'_i(\theta)\left[1-2P_i(\theta)\right]} {2\sum_h P_h(\theta)(1-P_h(\theta))} \end{align*} This leads to a very simple function.

Warm_Rasch = function(test_score, delta)
{
  Sw = function(theta) 
  {
    Pi = 1/(exp(delta - theta)+1)
    dPi = Pi*(1 - Pi)
    I = sum(dPi)
    J = sum(dPi*(1 - 2*Pi))
    return(test_score - sum(Pi) + J/(2*I))
  }
  return(uniroot(Sw, interval=c(-10,10))$root)
}

It is more complex for the full NRM allowing for polytomous items. We have already discussed the calculation of the information function in an earlier blog entry. As before, let xij=1x_{ij}=1 be a dummy coded response where xij=1x_{ij}=1 if the response to item ii was scored in category jj was picked. Specifically, we derived:

  • The score function: S(θ)=x++ijaijPij(θ), S(\theta) = x_{++} - \sum_i \sum_j a_{ij}P_{ij}(\theta), where x++=ijxijaijx_{++}=\sum_i \sum_j x_{ij} a_{ij} is the test score and ijPih(θ)aih=E[X++|θ]\sum_i \sum_j P_{ih}(\theta)a_{ih} = E[X_{++}|\theta] is expectation.
  • The test information: I(θ)=iIi(θ)I(\theta) = \sum_i I_i(\theta) where Ii(θ)=jaij2Pij(θ)(jaijPij(θ))2 I_i(\theta) = \sum_j a^2_{ij} P_{ij}(\theta) - \left(\sum_j a_{ij} P_{ij}(\theta)\right)^2 is the item information. Note that I(θ)=E[X++2]E[X++|θ]2=Var(X++|θ)I(\theta) = E[X^2_{++}]-E[X_{++}|\theta]^2 = Var(X_{++}|\theta).

We now need J(θ)=iJi(θ)J(\theta) = \sum_i J_i(\theta) where Ji(θ)=Ii(θ)=jaij2Pij(θ)2(jaijPij(θ))(jaijPij(θ)) J_i(\theta) = I'_i(\theta) = \sum_j a^2_{ij} P'_{ij}(\theta) - 2\left(\sum_j a_{ij}P_{ij}(\theta)\right)\left(\sum_j a_{ij}P'_{ij}(\theta)\right) Noting that ddθPij(θ)=Pij(θ)(aijhaihPih(θ)) \frac{d}{d\theta} P_{ij}(\theta) = P_{ij}(\theta)\left(a_{ij} - \sum_h a_{ih}P_{ih}(\theta)\right) we find, after some tedious but straightforward algebra, that we can write: Ji(θ)=jaij3Pij(θ)3(jaij2Pij(θ))(haihPih(θ))+2(jaijPij(θ))3 J_i(\theta) = \sum_j a^3_{ij} P_{ij}(\theta) - 3\left(\sum_j a^2_{ij}P_{ij}(\theta)\right)\left(\sum_h a_{ih}P_{ih}(\theta)\right) +2\left(\sum_j a_{ij} P_{ij}(\theta)\right)^3

All we need can be written in terms of sums Mri=jaijrPij(θ)M_{ri} = \sum_j a^r_{ij}P_{ij}(\theta), for r{1,2,3}r \in \{1,2,3\}. which inspired the following function to calculate the Warm estimate using a parms object or data.frame of item parameters.

## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
Warm = function(test_score, parms)
{
  if(!inherits(parms,'data.frame'))
    parms = coef(parms)

  weighted_score = function(theta)
  {  
    s = parms |>
      rename(a = 'item_score') |>
      group_by(item_id) |>
      mutate(P = exp(a*theta - cumsum(beta*(a-lag(a,default=0))))) |>
      mutate(P = P/(sum(P)+1)) |> #normalize
      summarise(E = sum(a*P),
                I = sum(a^2*P) - E^2,
                J = sum(a^3*P) - 3 * E * sum(a^2*P) + 2 * E^3) |>
      summarise(E=sum(E), I=sum(I), J=sum(J))
    
    test_score - s$E + s$J/(2*s$I)
  }
  uniroot(weighted_score, interval=c(-10,10))$root
}

The user-function ability in dexter will of course do the job using a dedicated method to locate the root of the weighted (log-) likelihood.

Conclusion

In closing, we mention that Firth (1993), independently of Warm, developed the idea beyond the exponential family. In these very capable hands, Warm’s legacy was taken up and generalized by Kosmidis and Firth (2009) and implemented in an R package called brgl.

Appendix: First-order bias in the MLE

We derive an expression for the first-order bias term b(θ)/nb(\theta)/n. To this effect, we use a Taylor-series expansion to approximate S(θ̂)S(\hat{\theta}) around the true ability θ\theta. S(θ̂)=S(θ)+(θ̂θ)S(θ)+12(θ̂θ)2S(θ)+o(n1/2)=0 S(\hat{\theta}) = S(\theta)+(\hat{\theta}-\theta)S'(\theta)+\frac{1}{2}(\hat{\theta}-\theta)^2S''(\theta) + o(n^{-1/2})= 0 By definition, S(θ̂)=0S(\hat{\theta})=0. Thus, if we take expectations on both sides we find: E[θ̂θ]S(θ)+12E[(θ̂θ)2]S(θ)=0 E[\hat{\theta}-\theta]S'(\theta) + \frac{1}{2}E[(\hat{\theta}-\theta)^2]S''(\theta) = 0 Using:

  • E[S(θ)]=0E[S(\theta)] = 0
  • We consider the situation where all derivatives of SS are independent of data.
  • E[(θ̂θ)2]=Var(θ̂)+o(n1)=1I(θ)+o(n1)E[(\hat{\theta}-\theta)^2]=Var(\hat{\theta}) + o(n^{-1}) = \frac{1}{I(\theta)} + o(n^{-1}),

we find that E[θ̂θ]S(θ)+S(θ)2I(θ)+o(n1)=0 E[\hat{\theta}-\theta]S'(\theta) + \frac{S''(\theta)}{2I(\theta)} +o(n^{-1})= 0 Rearranging shows that: E[θ̂θ]=S(θ)2I2(θ)+o(n1) E[\hat{\theta}-\theta] = \frac{-S''(\theta)}{2I^2(\theta)} +o(n^{-1}) Since I(θ)=S(θ)I(\theta)=-S'(\theta), it follows that S(θ)=I(θ)S''(\theta)=-I'(\theta).

References

Cox, David Roxbee, and David Victor Hinkley. 1974. Theoretical Statistics. CRC Press.
Efron, Bradley et al. 1975. “Defining the Curvature of a Statistical Problem (with Applications to Second Order Efficiency).” The Annals of Statistics 3 (6): 1189–1242.
Firth, David. 1993. “Bias Reduction of Maximum Likelihood Estimates.” Biometrika, 27–38.
Jeffreys, Harold. 1946. “An Invariant Form for the Prior Probability in Estimation Problems.” Proceedings of the Royal Society of London. Series A. Mathematical and Physical Sciences 186 (1007): 453–61.
Kosmidis, Ioannis, and David Firth. 2009. “Bias Reduction in Exponential Family Nonlinear Models.” Biometrika 96 (4): 793–804.
Mardia, KV, HR Southworth, and CC Taylor. 1999. “On Bias in Maximum Likelihood Estimators.” Journal of Statistical Planning and Inference 76 (1-2): 31–39.
Verhelst, Norman D, Huub HFM Verstralen, and MGH Jansen. 1997. “A Logistic Model for Time-Limit Tests.” In Handbook of Modern Item Response Theory, 169–85. Springer.