Compute Both Reliability Metrics in a Single Pass
compute_rho_both.RdComputes both the average-information reliability (\(\tilde{\rho}\)) and the MSEM-based marginal reliability (\(\bar{w}\)) from a single set of test-information reductions, avoiding redundant kernel evaluation.
This is a performance optimization over calling compute_rho_tilde()
and compute_rho_bar() separately, since both share the same stable,
automatically chunked item-information reduction.
Usage
compute_rho_both(
c,
theta_vec,
beta_vec,
lambda_base,
theta_var = NULL,
guessing = NULL,
weights = NULL,
return_diagnostics = FALSE
)Arguments
- c
Numeric scalar. Global discrimination scaling factor.
- theta_vec
Numeric vector of abilities \(\theta_m\).
- beta_vec
Numeric vector of item difficulties \(\beta_i\).
- lambda_base
Numeric vector of baseline discriminations \(\lambda_{i,0}\) (before scaling by
c).- theta_var
Optional numeric. Pre-calculated variance of theta. If NULL, computed from
theta_vec.- guessing
Optional numeric scalar or item-length vector of 3PL lower asymptotes in
[0, 1). A scalar is recycled;NULLgives the Rasch/2PL special case. The kernel usesD = 1.- weights
Optional non-negative integration weights, one per theta value. They are normalized internally.
- return_diagnostics
Logical. Return log-domain numerical diagnostics in addition to the two legacy reliability fields.
Value
A named list with components:
rho_tildeAverage-information reliability.
rho_barMSEM-based marginal reliability.
Details
For the same information values and latent-variance basis, Jensen's
inequality implies \(\tilde{\rho} \geq \bar{w}\).
See compute_rho_bar for details on each metric.
Examples
set.seed(1)
theta <- rnorm(1000)
beta <- rnorm(20)
lambda0 <- rep(1, 20)
both <- compute_rho_both(1, theta, beta, lambda0)
both$rho_tilde
#> [1] 0.7870079
both$rho_bar
#> [1] 0.7795393
# Verify: rho_tilde >= rho_bar (Jensen's inequality)
both$rho_tilde >= both$rho_bar
#> [1] TRUE
# The same call supports 3PL information.
compute_rho_both(1, theta, beta, lambda0, guessing = 0.20)
#> $rho_tilde
#> [1] 0.7055277
#>
#> $rho_bar
#> [1] 0.6946309
#>