EAP by Number Correct#

API:

irtlib.ability.number_correct_eap(); irtlib.ability.NumberCorrectEstimates

Sources:

Thissen et al. [1995]; Bock and Mislevy [1982]

Motivation#

A test scored by its number correct reports one ability estimate for each number correct: a conversion table that every examinee with the same number correct shares, whichever items they answered correctly. The EAP by number correct is the mean of the ability’s posterior given the number correct alone, with the posterior standard deviation as its standard error [Thissen et al., 1995, p. 40]. It gives up a little precision against the Expected A Posteriori of each response pattern: Thissen et al. report the posterior standard deviation given a number correct as generally about 10% above the smallest given a response pattern with that number (p. 45).

The same computation gives the probability of each number correct, the distribution of number correct that the items and the ability distribution predict. Set against the observed distribution, it checks the fit of the model (p. 41).

Definition#

Let \(S_k(\theta)\) be the probability of \(k\) correct out of the \(M\) items at ability \(\theta\), which Item Response Functions defines, and \(\pi(\theta)\) the prior density of ability. The probability of a number correct of \(k\) is

\[\bar S_k = \int S_k(\theta)\, \pi(\theta)\, d\theta\]

[Thissen et al., 1995, p. 40, Equations 4-6], and its EAP estimate and posterior standard deviation are

\[\mathrm{EAP}(\theta \mid k) = \frac{1}{\bar S_k} \int \theta\, S_k(\theta)\, \pi(\theta)\, d\theta, \qquad \mathrm{SD}(\theta \mid k) = \left\{ \frac{1}{\bar S_k} \int [\theta - \mathrm{EAP}(\theta \mid k)]^2\, S_k(\theta)\, \pi(\theta)\, d\theta \right\}^{1/2}\]

(p. 40, Equations 7 and 8). Thissen et al.’s likelihood of a number correct, \(L_k(\theta)\), holds the prior density: it is \(S_k(\theta) \pi(\theta)\) (p. 43, Equation 17). These are the EAP estimate and posterior standard deviation of Bock and Mislevy [1982, p. 433, Equations 4 and 5], with the probability of the number correct in place of the likelihood of the response pattern [Thissen et al., 1995, p. 40].

Implementation#

The grid. The integrals are sums over the nodes \(X_q\) of a Quadrature and Ability Priors grid, with the prior’s masses \(A_q\): \(\bar S_k = \sum_q S_k(X_q) A_q\), and node \(X_q\) has posterior mass \(S_k(X_q) A_q / \bar S_k\) given \(k\). Thissen et al. integrate by rectangular quadrature too (p. 43). The default grid and prior are those of Expected A Posteriori: 121 nodes on \([-6, 6]\), 0.1 apart, and the standard normal, with that page’s measurements of the grid’s accuracy.

The table. Every number correct from 0 to \(M\) has an estimate, both ends included. A number correct whose probability underflows to 0 on the grid, as on a long test under a prior far from its items, has no posterior, and the call raises an error. The table depends on the items and the prior alone, so it takes no response matrix (ADR-0010): an examinee who answered every item reads the entry of its number correct. An examinee who skipped items reads the table of the items it answered.

Comparison with mirt
  • mirt 1.48’s fscores(method = "EAPsum", full.scores = FALSE) (manual p. 74) returns the same table: the estimate, its standard error, and the expected number of examinees with each number correct, \(N \bar S_k\) (R/fscores.internal.R:777-1044). Its default grid and prior are irtlib’s, 121 nodes on \([-6, 6]\) (R/fscores.R:302, 318-319) with the normal density at the nodes, normalized (R/fscores.internal.R:842-847).

  • The parity tests first check that mirt’s recorded estimates, standard errors and expected counts are the sums above, written out over every response pattern of a 2PL bank and a bank of 3PL and 4PL items, then compare irtlib’s with them within a relative \(10^{-10}\) (ADR-0003).

Parameters#

Parameter

Default

Description

Default from

grid

121 nodes on \([-6, 6]\)

The nodes the posterior is computed on.

mirt’s (R/fscores.R:302, 318-319), as for Expected A Posteriori

log_prior

the standard normal

The prior’s log-density.

mirt’s (R/fscores.internal.R:846-847); abilities \(N(0, 1)\) (ADR-0008)

Guarantees#

  1. Every number correct from 0 to \(M\) has an estimate within the grid’s nodes, and the probabilities of the numbers correct sum to 1; a number correct with probability 0 on the grid raises an error instead.

  2. Among examinees whose abilities follow the prior and who answer every item, the estimate of a number correct is the mean ability of those with that number correct, and its probability their share, within the grid’s accuracy.

References#

[BM82] (1,2)

R. Darrell Bock and Robert J. Mislevy. Adaptive EAP estimation of ability in a microcomputer environment. Applied Psychological Measurement, 6(4):431–444, 1982. Open copy: http://purl.umn.edu/93227. doi:10.1177/014662168200600405.

[TPBW95] (1,2,3,4)

David Thissen, Mary Pommerich, Kathleen Billeaud, and Valerie S. L. Williams. Item response theory for scores on tests including polytomous items with ordered responses. Applied Psychological Measurement, 19(1):39–49, 1995. Open copy: https://hdl.handle.net/11299/117418. doi:10.1177/014662169501900105.

API Reference#

irtlib.ability.number_correct_eap(items: NDArray[floating[Any]], *, grid: QuadratureGrid | None = None, log_prior: LogPrior | None = None) → NumberCorrectEstimates[source]#

Return the EAP estimate of every number correct on the items, the mean of the posterior given the number alone.

An examinee who answered every item, k of them correctly, has entry k, whichever items those were. The probabilities of the numbers correct are the distribution of number correct the items and the prior predict.

The EAP by Number Correct page gives the method, its sources and the origin of each default.

Parameters:
itemsnumpy.ndarray

The items [a, b, c, d], a matrix of shape (n, 4), with a > 0 and 0 <= c < d <= 1.

gridQuadratureGrid or None, optional

The nodes the posterior is computed on. Default is QuadratureGrid.uniform(), 121 nodes on [-6, 6].

log_priorLogPrior or None, optional

The prior’s log-density. Default is normal_log_prior(), the standard normal.

Returns:
NumberCorrectEstimates

The posterior mean and standard deviation, and the probability, of each number correct from 0 to n.

Raises:
ValueError

If items is not an (n, 4) matrix of finite numbers, the log-prior is NaN or +inf at a node or has no mass on the grid, or a number correct has probability 0 on the grid, as on a long test under a prior far from its items.

Examples

>>> import numpy
>>> items = numpy.array([[1.0, -1.0, 0.0, 1.0], [1.5, 0.0, 0.2, 1.0], [0.8, 1.0, 0.0, 0.95]])
>>> estimates = number_correct_eap(items)
>>> estimates.theta.round(4), estimates.standard_errors.round(4)
(array([-0.9932, -0.4077,  0.2652,  0.8555]), array([0.7846, 0.7986, 0.8274, 0.828 ]))
>>> round(float(estimates.probability.sum()), 12)
1.0
class irtlib.ability.NumberCorrectEstimates(theta: NDArray[floating[Any]], standard_errors: NDArray[floating[Any]], probability: NDArray[floating[Any]])[source]#

The EAP estimate of each number correct on a set of items, its standard error, and the number’s probability.

Entry k of each array is that of the number correct k, from 0 to the number of items. Printed, it shows a table of each number correct’s values.

Parameters:
thetanumpy.ndarray

The mean of the ability’s posterior given each number correct.

standard_errorsnumpy.ndarray

The posterior standard deviations.

probabilitynumpy.ndarray

The probability of each number correct for an examinee whose ability is drawn from the prior, summing to 1.