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 `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*).
- `psychometric_core` recovers the Driver, Oud, and Voelkle (2017, p. 16 `TDPREDEFFECTstd`; Table 2, p. 12; Eq. 3, p. 5; footnote 4; §7.1, pp. 18–19; JSS PDF re-opened 2026-08-23T21:10Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar standardised continuous time-dependent predictor effect. Page 16 prints continuous-time parameters and, when appropriate, standardised matrices with the suffix `std`. Table 2 names `M` `TDPREDEFFECT`. Footnote 4: standardisations use only the relevant variance, not the total. The affecting variance is time-dependent predictor variance `v`. The affected variance is within-subject `asymDIFFUSION` `-q / (2 a)`, because the process dynamics are individual, or average individual, temporal dynamics. Form strictly positive `asymDIFFUSION` first, then strictly positive `v`, then `m · √v / √(-q / (2 a))`. Unstandardised `M` is defined for a zero coefficient and for zero predictor variance; standardised `TDPREDEFFECT` is not. Zero `asymDIFFUSION` or zero `v` has no positive SD and fails closed. `TIPREDEFFECTstd` `B · √v / √p` is a different named matrix even when `M = B` and the predictor variances match. The finite-interval intercept-style standardisation `A^{-1}[e^{A Δt} − I] M · √v / √p` depends on the event interval and is not this continuous Dirac coefficient. Section 7.1 warns that omitting trait variance confounds between- and within-person information. `m · √v / √(trait + p + added)` uses the total, not `asymDIFFUSION`, and is not `TDPREDEFFECTstd` when `TRAITVAR` is nonzero. `TRAITVAR` is not the standardisation variance. Predecessor `event_time.rs` asymptotic-std `process_sd == 0` / `predictor_sd == 0` gates after already-checked `within == 0` and `v == 0` were unreachable; this slice drops them so stacked line/branch coverage can close. 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:10Z: `is_oa: false`; title *Measurement Invariance, Factor Analysis and Factorial Invariance*). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread (Unpaywall 2026-08-23T21:10Z: `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.

52 changes: 52 additions & 0 deletions crates/psychometric_core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,23 @@ pub enum PsychometricError {
/// p. 16 `T0VARstd`. Extra TI variance is not the correlation
/// form of free `T0VAR`.
InitialTimeIndependentVarianceIsNotStandardisedInitialLatentVariance,
/// Driver p. 16 `TRAITVARstd` was requested with a non-positive
/// trait variance. The 2017-era correlation form requires
/// strictly positive `TRAITVAR` and is not formed when
/// `TRAITVAR` is zero.
StandardisedTraitVarianceRequiresPositiveTraitVariance,
/// Driver Table 2 unstandardised `TRAITVAR` was treated as
/// p. 16 `TRAITVARstd`. Unstandardised trait variance is
/// defined for a zero trait; standardised `TRAITVAR` is not.
UnstandardisedTraitVarianceIsNotStandardisedTraitVariance,
/// Driver p. 16 `T0VARstd` was treated as p. 16 `TRAITVARstd`.
/// Equal numbers when both correlations equal 1 are still
/// distinct named quantities.
StandardisedInitialLatentVarianceIsNotStandardisedTraitVariance,
/// Driver 2017-era `addedT0TIPREDVAR` `t0_b² v` was treated as
/// p. 16 `TRAITVARstd`. Extra first-occasion TI variance is not
/// the correlation form of between-subject `TRAITVAR`.
InitialTimeIndependentVarianceIsNotStandardisedTraitVariance,
}

impl fmt::Display for PsychometricError {
Expand Down Expand Up @@ -1644,6 +1661,18 @@ impl fmt::Display for PsychometricError {
Self::InitialTimeIndependentVarianceIsNotStandardisedInitialLatentVariance => {
"initial time-independent predictor variance is not standardised initial latent variance"
}
Self::StandardisedTraitVarianceRequiresPositiveTraitVariance => {
"standardised trait variance requires strictly positive trait variance"
}
Self::UnstandardisedTraitVarianceIsNotStandardisedTraitVariance => {
"unstandardised trait variance is not standardised trait variance"
}
Self::StandardisedInitialLatentVarianceIsNotStandardisedTraitVariance => {
"standardised initial latent variance is not standardised trait variance"
}
Self::InitialTimeIndependentVarianceIsNotStandardisedTraitVariance => {
"initial time-independent predictor variance is not standardised trait variance"
}
};
formatter.write_str(message)
}
Expand Down Expand Up @@ -2834,4 +2863,27 @@ mod tests {
"initial time-independent predictor variance is not standardised initial latent variance"
);
}

#[test]
fn standardised_trait_variance_boundary_messages_are_stable() {
assert_eq!(
PsychometricError::StandardisedTraitVarianceRequiresPositiveTraitVariance.to_string(),
"standardised trait variance requires strictly positive trait variance"
);
assert_eq!(
PsychometricError::UnstandardisedTraitVarianceIsNotStandardisedTraitVariance
.to_string(),
"unstandardised trait variance is not standardised trait variance"
);
assert_eq!(
PsychometricError::StandardisedInitialLatentVarianceIsNotStandardisedTraitVariance
.to_string(),
"standardised initial latent variance is not standardised trait variance"
);
assert_eq!(
PsychometricError::InitialTimeIndependentVarianceIsNotStandardisedTraitVariance
.to_string(),
"initial time-independent predictor variance is not standardised trait variance"
);
}
}
Loading