Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ARCHITECTURE.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang

## [Unreleased]

- `psychometric_core` recovers the Driver, Oud, and Voelkle (2017, Table 2, p. 12 `MANIFESTTRAITVAR`; §7.1, p. 19; p. 16 `MANIFESTTRAITVARstd`; footnote 4; 2017-era ctsem `summary.ctsemFit.R`; JSS PDF re-opened 2026-08-23T22:28Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar standardised manifest-trait variance. Table 2 names `MANIFESTTRAITVAR` `Ψ_τ` the additional time-invariant variance-covariance on the measurement level and sets it `NULL` when there is no manifest trait. Section 7.1 names manifest traits stable individual differences in indicator levels, distinct from process-level `TRAITVAR` `φ_ξ`. Page 16 prints standardised matrices with the suffix `std` when appropriate. The 2017-era `summary.ctsemFit.R` forms `MANIFESTTRAITVARstd` only when `MANIFESTTRAITVAR != 0`, as `solve(sqrt(diag(MANIFESTTRAITVAR) + ridging)) %&% MANIFESTTRAITVAR` when `verbose = TRUE`. OpenMx `%&%` is the quadratic form `t(A) %*% B %*% A`. Unlike `TRAITVARstd`, that formation adds `diag(c(ridging), n.manifest)`. The default `ridging = FALSE` adds 0, not `0.0001`; that ridge is a numerical hack and is not this exact map. The scalar correlation is `ψ / ψ = 1` after strictly positive `MANIFESTTRAITVAR`. Form strictly positive `ψ` first, then `1 / √ψ`, then `(1 / √ψ) ψ (1 / √ψ)`. Unstandardised `MANIFESTTRAITVAR` is defined for a zero trait; standardised `MANIFESTTRAITVAR` is not. Zero `MANIFESTTRAITVAR` skips forming `MANIFESTTRAITVARstd` in the 2017-era source and fails closed here. Indicator-level trait variance is an event-time structural quantity, so a non-event clock fails closed. `MANIFESTTRAITVAR` does not require stable `a < 0`. Distinct positive `ψ` recover the same 1. `TRAITVARstd` `trait / trait = 1` recovers the same number and remains a distinct named quantity. `MANIFESTVAR` `θ` is measurement error, not this correlation. Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation. Meredith (1993) remains unread (Unpaywall 2026-08-23T22:21Z: `is_oa: false`; title *Measurement Invariance, Factor Analysis and Factorial Invariance*). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread (Unpaywall 2026-08-23T22:21Z: `is_oa: false`; title *Randomization-Based Inference about Latent Variables from Complex Samples*).
- `psychometric_core` recovers the Driver, Oud, and Voelkle (2017, Table 2, p. 12 `TRAITVAR`; §7.1, pp. 18–19; p. 16 `TRAITVARstd`; footnote 4; 2017-era ctsem `summary.ctsemFit.R`; JSS PDF re-opened 2026-08-23T22:21Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar standardised trait variance. Table 2 names `TRAITVAR` `φ_ξ` the latent trait variance/covariance and sets it `NULL` when there is no trait. Section 7.1 names traits the stable between-subject differences (unit-level unobserved heterogeneity). Page 16 prints standardised matrices with the suffix `std` when appropriate. The 2017-era `summary.ctsemFit.R` forms `TRAITVARstd` only when `TRAITVAR != 0`, as `solve(sqrt(diag(TRAITVAR))) %&% TRAITVAR` when `verbose = TRUE`. OpenMx `%&%` is the quadratic form `t(A) %*% B %*% A`. Unlike `T0VARstd`, that formation uses `diag(diag(TRAITVAR))` and does not add `diag(c(ridging))`. The ridge is a `T0VAR` numerical hack and is not this exact map. The scalar correlation is `trait / trait = 1` after strictly positive `TRAITVAR`. Form strictly positive `trait` first, then `1 / √trait`, then `(1 / √trait) trait (1 / √trait)`. Unstandardised `TRAITVAR` is defined for a zero trait; standardised `TRAITVAR` is not. Zero `TRAITVAR` skips forming `TRAITVARstd` in the 2017-era source and fails closed here. Between-subject variance is an event-time structural quantity, so a non-event clock fails closed. `TRAITVAR` does not require stable `a < 0`. Distinct positive `trait` recover the same 1. `T0VARstd` `p_0 / p_0 = 1` recovers the same number and remains a distinct named quantity. `addedT0TIPREDVAR` `t0_b² v` is extra first-occasion TI variance, not this correlation. Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation. Meredith (1993) remains unread (Unpaywall 2026-08-23T22:21Z: `is_oa: false`; title *Measurement Invariance, Factor Analysis and Factorial Invariance*). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread (Unpaywall 2026-08-23T22:21Z: `is_oa: false`; title *Randomization-Based Inference about Latent Variables from Complex Samples*).
- `psychometric_core` recovers the Driver, Oud, and Voelkle (2017, Table 2, p. 12 `T0VAR`; p. 16 `T0VARstd`; footnote 4; 2017-era ctsem `summary.ctsemFit.R`; JSS PDF re-opened 2026-08-23T22:06Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar standardised first-occasion latent variance. Table 2 names `T0VAR` the latent process initial variance/covariance. Page 16 prints standardised matrices with the suffix `std` when appropriate. The 2017-era `summary.ctsemFit.R` forms `T0VARstd` as `solve(sqrt(diag(T0VAR))) %&% T0VAR` when `verbose = TRUE`. OpenMx `%&%` is the quadratic form `t(A) %*% B %*% A`. The default `ridging = FALSE` adds 0, not `0.0001`; that ridge is a numerical hack and is not this exact map. The scalar correlation is `p_0 / p_0 = 1` after strictly positive free `T0VAR`. Form strictly positive `p_0` first, then `1 / √p_0`, then `(1 / √p_0) p_0 (1 / √p_0)`. Unstandardised `T0VAR` is defined for a zero first-occasion variance; standardised `T0VAR` is not. Zero `p_0` has no positive SD and fails closed. `T0` is an event-time occasion, so a non-event clock fails closed. Free `T0VAR` does not require stable `a < 0`. Distinct positive `p_0` recover the same 1. `T0TDPREDEFFECTstd` `t0_m · √v / √p_0` depends on `p_0` and is not this correlation. `addedT0TIPREDVAR` `t0_b² v` is extra TI variance, not this correlation. `TRAITVAR` is not the standardisation variance. Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation. Meredith (1993) remains unread (Unpaywall 2026-08-23T22:06Z: `is_oa: false`; title *Measurement Invariance, Factor Analysis and Factorial Invariance*). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread (Unpaywall 2026-08-23T22:06Z: `is_oa: false`; title *Randomization-Based Inference about Latent Variables from Complex Samples*).
- `psychometric_core` recovers the Driver, Oud, and Voelkle (2017, Table 3, p. 13 `T0TDPREDEFFECTstd`; Table 2, p. 12; p. 16; footnote 4; Eq. 3, p. 5; 2017-era ctsem `summary.ctsemFit.R`; JSS PDF re-opened 2026-08-23T21:34Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar standardised first-occasion time-dependent predictor effect. Table 3 names `T0TDPREDEFFECT` the effect of time-dependent predictors on latents at `T0`. Table 2 names `M` `TDPREDEFFECT` and names `T0TDPREDCOV` the first-occasion covariance, not this coefficient. Page 16 prints standardised matrices with the suffix `std` when appropriate. Footnote 4: standardisations use only the relevant variance, not the total. The affecting variance is time-dependent predictor variance `v`, not `TIPREDVAR`. The affected variance is free first-occasion `T0VAR` `p_0`, not within-subject `asymDIFFUSION` `-q / (2 a)`, because Table 3 is the first occasion, not the process dynamics. Form strictly positive `p_0` first, then strictly positive `v`, then `t0_m · √v / √p_0`. Unstandardised `t0_m` is defined for a zero coefficient and for zero predictor variance; standardised `T0TDPREDEFFECT` is not. Zero `p_0` or zero `v` has no positive SD and fails closed. `T0` is an event-time occasion, so a non-event clock fails closed. Free `T0VAR` does not require stable `a < 0`. The continuous standardisation `m · √v / √(-q / (2 a))` uses `asymDIFFUSION` and is not this first-occasion map. `T0TIPREDEFFECTstd` `t0_b · √v / √p_0` is a different named matrix even when `t0_m = t0_b` and the predictor variances match. Section 7.1 warns that omitting trait variance confounds between- and within-person information. `t0_m · √v / √(trait + p_0 + added)` uses the total, not free `T0VAR`, and is not `T0TDPREDEFFECTstd` when `TRAITVAR` is nonzero. `TRAITVAR` is not the standardisation variance. Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation. Meredith (1993) remains unread (Unpaywall 2026-08-23T21:34Z: `is_oa: false`; title *Measurement Invariance, Factor Analysis and Factorial Invariance*). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread (Unpaywall 2026-08-23T21:34Z: `is_oa: false`; title *Randomization-Based Inference about Latent Variables from Complex Samples*).
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions crates/psychometric_core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,26 @@ pub enum PsychometricError {
/// p. 16 `TRAITVARstd`. Extra first-occasion TI variance is not
/// the correlation form of between-subject `TRAITVAR`.
InitialTimeIndependentVarianceIsNotStandardisedTraitVariance,
/// Driver p. 16 `MANIFESTTRAITVARstd` was requested with a
/// non-positive manifest-trait variance. The 2017-era
/// correlation form requires strictly positive
/// `MANIFESTTRAITVAR` and is not formed when
/// `MANIFESTTRAITVAR` is zero.
StandardisedManifestTraitVarianceRequiresPositiveManifestTraitVariance,
/// Driver Table 2 unstandardised `MANIFESTTRAITVAR` `Ψ_τ` was
/// treated as p. 16 `MANIFESTTRAITVARstd`. Unstandardised
/// manifest-trait variance is defined for a zero trait;
/// standardised `MANIFESTTRAITVAR` is not.
UnstandardisedManifestTraitVarianceIsNotStandardisedManifestTraitVariance,
/// Driver p. 16 `TRAITVARstd` was treated as p. 16
/// `MANIFESTTRAITVARstd`. Equal numbers when both correlations
/// equal 1 are still distinct named quantities. `TRAITVAR` is
/// process-level; `MANIFESTTRAITVAR` is indicator-level.
StandardisedTraitVarianceIsNotStandardisedManifestTraitVariance,
/// Driver Table 2 `MANIFESTVAR` `Θ` was treated as p. 16
/// `MANIFESTTRAITVARstd`. Measurement error is not the
/// correlation form of indicator-level trait variance.
MeasurementErrorIsNotStandardisedManifestTraitVariance,
}

impl fmt::Display for PsychometricError {
Expand Down Expand Up @@ -1673,6 +1693,18 @@ impl fmt::Display for PsychometricError {
Self::InitialTimeIndependentVarianceIsNotStandardisedTraitVariance => {
"initial time-independent predictor variance is not standardised trait variance"
}
Self::StandardisedManifestTraitVarianceRequiresPositiveManifestTraitVariance => {
"standardised manifest-trait variance requires strictly positive manifest-trait variance"
}
Self::UnstandardisedManifestTraitVarianceIsNotStandardisedManifestTraitVariance => {
"unstandardised manifest-trait variance is not standardised manifest-trait variance"
}
Self::StandardisedTraitVarianceIsNotStandardisedManifestTraitVariance => {
"standardised trait variance is not standardised manifest-trait variance"
}
Self::MeasurementErrorIsNotStandardisedManifestTraitVariance => {
"measurement error is not standardised manifest-trait variance"
}
};
formatter.write_str(message)
}
Expand Down Expand Up @@ -2886,4 +2918,27 @@ mod tests {
"initial time-independent predictor variance is not standardised trait variance"
);
}

#[test]
fn standardised_manifest_trait_variance_boundary_messages_are_stable() {
assert_eq!(
PsychometricError::StandardisedManifestTraitVarianceRequiresPositiveManifestTraitVariance
.to_string(),
"standardised manifest-trait variance requires strictly positive manifest-trait variance"
);
assert_eq!(
PsychometricError::UnstandardisedManifestTraitVarianceIsNotStandardisedManifestTraitVariance
.to_string(),
"unstandardised manifest-trait variance is not standardised manifest-trait variance"
);
assert_eq!(
PsychometricError::StandardisedTraitVarianceIsNotStandardisedManifestTraitVariance
.to_string(),
"standardised trait variance is not standardised manifest-trait variance"
);
assert_eq!(
PsychometricError::MeasurementErrorIsNotStandardisedManifestTraitVariance.to_string(),
"measurement error is not standardised manifest-trait variance"
);
}
}
Loading