HEXACO scores with the generalized partial preference model#
Fit MGPPM to observed best–worst choices from HEXACO triplets and check whether the model reproduces their relative frequencies.
Model the ranking patterns#
Let \(p\) index respondents, \(b\) index blocks and \(j\) index statements. The trait measured by statement \(j\) is \(t(j)\). Its utility for respondent \(p\) is
where \(\theta_{p,t(j)}\) is the trait score, \(a_j>0\) is the loading magnitude, and \(q_j\in\{-1,+1\}\) is the keying sign. A larger statement intercept \(b_j\) lowers its utility.
For a complete order \(r\) in a block with \(K\) statements, let \(s_{rj}\) be \(K\) minus the rank of statement \(j\). The highest rank is 1. The utility \(\eta_{pbr}\) of the entire order is the sum of the scored utilities:
In the order \(A>B>C\), the scores of \(A,B,C\) are \(2,1,0\), so \(\eta_{pbr}=2u_{pA}+u_{pB}\). For \(A>C>B\), it is \(2u_{pA}+u_{pC}\). The observed block response \(Y_{pb}\) has probability
where \(\mathcal R_b\) contains all possible complete orders for the block, including orders absent from the sample. A triplet has six terms in the denominator. When the response specifies only part of an order, sum the probabilities of the compatible orders. Furr and Fu (2025)
Set the score scale#
Each trait has mean zero and SD one. All complete orders of a triplet have the same total score, so a common utility shift cancels in the probability. A zero reference intercept sets the origin. Keying sets the direction of each loading. MGPPM model and priors
import seaborn as sns
import pyfcirt as fc
sns.set_theme(style="ticks")
Read the questionnaire and responses#
The bundled FC3 data contain 200 respondents and 20 HEXACO triplets from Li et al. (2025). The design names each statement, its position, trait and keying. Each answer records the most- and least-preferred positions. With three statements, those two positions determine the full order.
example = fc.load_example("hexaco_fc3", model="MGPPM")
design = example.data.design
responses = example.data.responses.frame
design.head(3)
| block_id | position | statement_id | trait | keying | |
|---|---|---|---|---|---|
| 0 | B1 | 1 | i1 | honestyhumility | -1 |
| 1 | B1 | 2 | i2 | openness | -1 |
| 2 | B1 | 3 | i3 | agreeableness | -1 |
A row with [3, None, 1] records statement 3 as best and statement 1 as
worst. Statement 2 is the middle choice.
responses.head(3)
| person_id | block_id | response | |
|---|---|---|---|
| 0 | 1 | B1 | [3, None, 1] |
| 1 | 1 | B2 | [3, None, 2] |
| 2 | 1 | B3 | [1, None, 2] |
model = fc.Model()
model.add_fc(
design,
responses,
format="block_long",
response_format="mole",
model="MGPPM",
)
model.prepare()
print(model.summary())
Model: MGPPM
200 people, 6 traits, 20 blocks, 60 statements
Observations: 4,000 block events
Measurements:
mole: 20 blocks, size=3, categories=6
Population:
theta ~ MvNormal(mu=0, cov=R)
R [6 x 6] ~ LKJCorr(n=6, eta=1)
Priors:
loading [60] ~ LogNormal(mu=0, sigma=0.5)
statement_intercept [40] ~ Normal(mu=0, sigma=2)
Constraints:
statement_intercept: fixed=0 [20 fixed]
The summary counts whole-block best–worst events and lists the reference statement intercepts.
Fit the model#
Each person–block answer contributes one category probability.
model.fit(draws=1200, tune=1800, chains=4);
Diagnose the chains#
Check that the chains agree before using the posterior estimates.
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.007
Min bulk / tail ESS: 779 / 1229
Divergences: 0
The rank and density panels inspect one respondent’s Honesty–Humility score.
Read the statement parameters#
Read the loadings and intercepts of the three statements in B1.
model.coef(blocks=["B1"], kind="stats", round_to=2)
| mean | sd | hdi95_lb | hdi95_ub | ||||
|---|---|---|---|---|---|---|---|
| unit | statement | trait | parameter | ||||
| B1 | i1 | honestyhumility | loading | 1.37 | 0.27 | 0.87 | 1.89 |
| i2 | openness | loading | 0.55 | 0.14 | 0.29 | 0.83 | |
| i3 | agreeableness | loading | 0.46 | 0.13 | 0.22 | 0.72 | |
| i1 | honestyhumility | statement_intercept | 0.00 | NaN | NaN | NaN | |
| i2 | openness | statement_intercept | -0.90 | 0.18 | -1.27 | -0.56 | |
| i3 | agreeableness | statement_intercept | -1.43 | 0.20 | -1.83 | -1.04 |
Check the predicted rankings#
Compare the observed proportions with 200 sets of replicated responses in block B1. A cross marks an observed proportion. A point and line show a predictive mean and 95% interval.
predictions = model.posterior_predictive(draws=200, random_seed=45)
view = fc.predictive_view(predictions, block="B1")
The most common B1 response names i3 as best and i1 as worst. It accounts for 48.5% of the observed answers.
Check overall fit#
The Pearson check pools the discrepancies across the 20 triplets.
Read score precision#
Empirical reliability compares score variation with posterior uncertainty.
model.reliability()["reliability"].to_series().round(3).to_frame("Reliability")
| Reliability | |
|---|---|
| trait | |
| honestyhumility | 0.692 |
| openness | 0.597 |
| agreeableness | 0.523 |
| emotionality | 0.563 |
| conscientiousness | 0.554 |
| extraversion | 0.704 |
A ridge plot shows the uncertainty in the Honesty–Humility and Openness scores for three respondents.
See 2PLM-RANK for a successive-choice model fitted to the same responses.