Generalized graded unfolding model for ranking (GGUM-RANK)#
Which trait level makes a particular statement most appealing? Fit simulated rankings to estimate the statements’ ideal points, then check the fitted endorsement curves and ranking predictions.
Model preferences around an ideal point#
Let \(\theta_{p,t(j)}\) be respondent \(p\)’s score on the trait measured by statement \(j\). The ideal point \(\delta_j\) is the trait level where the statement is most likely to be endorsed. The signed distance on the statement’s scale is \(x_{pj}=a_j(\theta_{p,t(j)}-\delta_j)\), with positive discrimination \(a_j\). The two endorsement weights are
Here \(\tau_j\) is a statement threshold. The probability of endorsing the statement is \(W_{pj}(1)/[W_{pj}(1)+W_{pj}(0)]\). A larger \(a_j\) makes the endorsement curve fall more sharply away from \(\delta_j\). A larger \(\tau_j\) lowers endorsement at any given trait score.
The odds of endorsement are \(w_{pj}=W_{pj}(1)/W_{pj}(0)\). At each stage, select a statement with probability proportional to its odds among the remaining statements. For the response \(Y_{pb}=(A,B,C)\), in order from most to least preferred,
The first factor compares all three statements. The second compares only \(B\) and \(C\). The figures later show statement endorsement and block ranking probabilities on their respective scales. GGUM-RANK model and priors
Set the score scale#
Each trait has mean zero and SD one. Location sides in the design set the sign of signed ideal points. A reference threshold is fixed at zero within each connected set of statements.
Read the design and responses#
The simulation has 200 respondents, 24 triplets, and four traits. Each design row specifies a statement, its position and its trait. The location side gives the sign restriction on that statement’s ideal point.
import pandas as pd
import seaborn as sns
import pyfcirt as fc
sns.set_theme(style="ticks")
example = fc.load_example("simulated_ggum_rank", model="GGUMRank", n_persons=200)
example.data.design.head(3)
| block_id | position | statement_id | trait | keying | location_side | |
|---|---|---|---|---|---|---|
| 0 | B1 | 1 | S1 | theta1 | 1 | -1 |
| 1 | B1 | 2 | S2 | theta2 | 1 | -1 |
| 2 | B1 | 3 | S3 | theta3 | 1 | -1 |
Each answer lists statement positions from most to least preferred. For B1, [2, 3, 1] orders the second statement above the third and the first.
example.data.responses.frame.head(3)
| person_id | block_id | response | |
|---|---|---|---|
| 0 | 1 | B1 | [2, 3, 1] |
| 1 | 1 | B2 | [2, 3, 1] |
| 2 | 1 | B3 | [3, 2, 1] |
model = fc.Model()
model.add_fc(
example.data.design,
example.data.responses.frame,
format="block_long",
model="GGUMRank",
response_format="rank",
)
model.prepare()
print(model.summary())
Model: GGUMRank
200 people, 4 traits, 24 blocks, 72 statements
Observations: 4,800 block events
Measurements:
rank: 24 blocks, size=3, categories=6
Population:
theta ~ MvNormal(mu=0, cov=R)
R [4 x 4] ~ LKJCorr(n=4, eta=1)
Priors:
loading [72] ~ LogNormal(mu=0, sigma=0.25)
statement_threshold [48] ~ Normal(mu=0, sigma=2)
location (location_negative) [36] ~ TruncatedNormal(mu=-2, sigma=1, lower=-inf, upper=0)
location (location_positive) [36] ~ TruncatedNormal(mu=2, sigma=1, lower=0, upper=inf)
Constraints:
statement_threshold: fixed=0 [24 fixed]
The summary lists full ranking events and the priors for positive and negative locations.
Fit the model#
The estimates shown use four chains with 2,000 warmup iterations and 1,500 retained draws per chain. Estimation backend setup
model.fit(draws=1500, tune=2000, chains=4);
Diagnose the chains#
The maximum R-hat is 1.008. The minimum bulk and tail effective sample sizes are 875 and 988, and there are zero divergences.
import arviz as az
import numpy as np
posterior = model.idata.posterior.to_dataset().reset_coords(drop=True)
with np.errstate(invalid="ignore", divide="ignore"):
r_hat = az.rhat(posterior).max().to_array().max().item()
bulk = az.ess(posterior, method="bulk").min().to_array().min().item()
tail = az.ess(posterior, method="tail").min().to_array().min().item()
print(f"Max R-hat: {r_hat:.3f}")
print(f"Min bulk / tail ESS: {bulk:.0f} / {tail:.0f}")
print("Divergences:", int(model.idata.sample_stats.diverging.sum()))
Max R-hat: 1.008
Min bulk / tail ESS: 875 / 988
Divergences: 0
The density and rank plots compare chains for respondent 1 on the first trait. The rank-test p-value for this score is 0.18.
Read the statement estimates#
The B1 table shows each statement’s discrimination, ideal point and threshold. The last two columns give 95% highest-density intervals. S1’s estimated ideal point is −1.91, and its interval runs from −3.59 to −0.69. The fixed reference threshold shows zero with blank uncertainty cells. The negative locations follow the design’s sign restriction for B1.
coef = model.coef(blocks=["B1"], kind="stats", round_to=2)
columns = ["statement", "parameter", "mean", "sd", "hdi95_lb", "hdi95_ub"]
table = coef.reset_index()[columns]
table.style.hide(axis="index").format(precision=2, na_rep="")
| statement | parameter | mean | sd | hdi95_lb | hdi95_ub |
|---|---|---|---|---|---|
| S1 | loading | 0.83 | 0.15 | 0.56 | 1.12 |
| S2 | loading | 1.06 | 0.20 | 0.68 | 1.46 |
| S3 | loading | 1.13 | 0.20 | 0.75 | 1.54 |
| S1 | statement_threshold | 0.00 | |||
| S2 | statement_threshold | -2.15 | 0.90 | -3.98 | -0.35 |
| S3 | statement_threshold | 0.10 | 0.87 | -1.61 | 1.89 |
| S1 | location | -1.91 | 0.79 | -3.59 | -0.69 |
| S2 | location | -1.57 | 0.70 | -2.97 | -0.42 |
| S3 | location | -2.50 | 0.66 | -3.86 | -1.34 |
These curves compare four statements on theta1 using their posterior-mean parameters. S1 peaks near −1.91. Its fixed zero threshold puts the peak at 0.50 on the reference endorsement scale. A whole ranking depends on the other statements’ odds as well.
The bottom marks show respondents’ posterior mean scores. The gray band spans the middle 90% of those scores.
Check the predicted rankings#
Compare the frequencies of the six observed B1 orders with 200 sets of replicated rankings. Crosses mark observed proportions. Dots mark predictive means, and the lines show 95% predictive intervals.
predictions = model.posterior_predictive(draws=200, random_seed=44)
view = fc.predictive_view(predictions, block="B1")
The Pearson check measures mismatch across all 200 B1 rankings. Its posterior predictive p-value is 0.325, the share of replicated discrepancies at least as large as the observed one.
Read score precision#
Empirical reliability ranges from 0.748 to 0.790 for the four traits in this simulation. It summarizes score precision across respondents.
reliability = model.reliability()["reliability"].to_series()
reliability.round(3).to_frame("Reliability")
| Reliability | |
|---|---|
| trait | |
| theta1 | 0.790 |
| theta2 | 0.767 |
| theta3 | 0.748 |
| theta4 | 0.763 |
The ridge plot compares respondents 1, 2 and 3. Markers show posterior means and lines show 50% and 95% HDIs. Compare their widths before interpreting small differences between scores.
See the GGUM-RANK mathematical notes for equations linking the endorsement odds to ranking probabilities.
References#
Lee, P., Joo, S.-H., Stark, S., & Chernyshenko, O. S. (2019). GGUM-RANK statement and person parameter estimation with multidimensional forced choice triplets. Applied Psychological Measurement, 43(3), 226–240. https://doi.org/10.1177/0146621618768294.