Skip to content
Draft
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.

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ 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` / `T0VAR`; §7.1, pp. 18–19; p. 16; 2017-era ctsem `summary.ctsemFit.R` lines 322–339; JSS PDF re-opened 2026-08-30T18:50Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar 2017-era `T0TOTALVAR` on current main (register items 110–111). Independent of open `#321` unstandardised `T0TRAITVAR` and `#322` `T0TRAITVARstd`. This crate does not currently export `recover_initial_trait_variance`; form the quadratic `t0_trait² · trait` directly, then add free first-occasion `T0VAR` `p_0`. Table 2 names `TRAITVAR` `φ_ξ` the latent trait variance/covariance and `T0VAR` the latent process initial variance/covariance. Section 7.1 names traits the stable between-subject differences (unit-level unobserved heterogeneity). `T0TRAITEFFECT` is not in Table 2 or Table 3. The 2017-era `summary.ctsemFit.R` (ctsem 2.5.0, lines 322–339) comments `T0TRAITVAR <- T0TRAITEFFECT %*% TRAITVAR %*% t(T0TRAITEFFECT)` with `#is this valid?`, then `T0TOTALVAR <- T0TRAITVAR + T0VAR`. The scalar analog extra is `t0_trait² · trait`. The scalar total is `extra + p_0`. Form the extra first, then add free `p_0`. A zero extra or zero `p_0` is kept. A zero extra and a zero `p_0` is exactly zero. `trait < 0` or `p_0 < 0` fails closed. `T0` is an event-time occasion, so a non-event clock fails closed. Free `T0TRAITEFFECT` and free `T0VAR` do not require stable `a < 0`. `t0_trait² · trait` is `T0TRAITVAR` and equals this total when `p_0 = 0` and remains a distinct named quantity. Free `p_0` is `T0VAR` and equals this total when the extra is 0 and remains a distinct named quantity. `TRAITVAR` equals this total when `T0TRAITEFFECT = I` and `p_0 = 0` and remains a distinct named quantity. `t0_b² v` is `addedT0TIPREDVAR` and is extra first-occasion TI variance, not this total. Meredith (1993) remains unread (Unpaywall 2026-08-30T18:40Z: `is_oa: false`; OpenAlex closed; Springer `content/pdf` is an HTML stub). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread on the same terms (DOI `10.1007/bf02294457`; Unpaywall `is_oa: false`). Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation.

- `event_core` adds bounded Allen interval-consistency classification, atomic path-consistency closure, contradiction/resource refusals, and an explicit dependency-error fallback without claiming unrestricted global satisfiability.

- `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-27T14:20Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar standardised manifest-trait variance on current main after `0ce16e8` dropped the pre-consolidation code while research notes already named the map (register items 83–84). Table 2 names `MANIFESTTRAITVAR` `Ψ_τ` the additional time-invariant variance-covariance on the measurement level and sets it `NULL` when there is no manifest trait. Equation 5 writes `Γ ~ N(τ, Ψ)` and names that covariance the manifest traits. 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 printed example on p. 16 is `discreteDRIFTstd`, not `MANIFESTTRAITVARstd`. Footnote 4 standardises using only the relevant variance, not the total. The relevant variance for that named indicator-level correlation is `MANIFESTTRAITVAR`, not process-level `TRAITVAR` and not residual `MANIFESTVAR` `θ`. The 2017-era source forms `MANIFESTTRAITVARstd` only when `MANIFESTTRAITVAR != 0`, as `solve(sqrt(diag(MANIFESTTRAITVAR) + ridging)) %&% MANIFESTTRAITVAR` when `verbose = TRUE`. OpenMx `%&%` is `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. `trait / trait = 1` is `TRAITVARstd` and recovers the same number and remains a distinct named quantity. `θ` is `MANIFESTVAR` and is measurement error, not this correlation. Meredith (1993) remains unread (web search 2026-08-27T14:20Z: Springer/Cambridge Core paywalled; Unpaywall historically `is_oa: false`; Springer `content/pdf` is an HTML stub). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread on the same terms (DOI `10.1007/bf02294457`). Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation.
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions crates/psychometric_core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,23 @@ pub enum PsychometricError {
/// `MANIFESTVARstd`. `λ² Var(η) + θ` is `Var(y)`, not the
/// correlation form of `Θ`.
ObservedVarianceIsNotStandardisedManifestVariance,
/// Driver 2017-era `T0TOTALVAR` `t0_trait² · trait + p_0` was
/// treated as unstandardised `T0TRAITVAR` `t0_trait² · trait`.
/// Equal numbers when `p_0 = 0` are still distinct named
/// quantities.
InitialTotalVarianceIsNotInitialTraitVariance,
/// Driver 2017-era `T0TOTALVAR` was treated as free first-occasion
/// `T0VAR` `p_0`. Equal numbers when the trait extra is 0 are
/// still distinct named quantities.
InitialTotalVarianceIsNotInitialLatentVariance,
/// Driver 2017-era `T0TOTALVAR` was treated as Table 2 `TRAITVAR`.
/// Equal numbers when `T0TRAITEFFECT = I` and `p_0 = 0` are still
/// distinct named quantities.
InitialTotalVarianceIsNotTraitVariance,
/// Driver 2017-era `T0TOTALVAR` was treated as 2017-era
/// `addedT0TIPREDVAR` `t0_b² v`. Extra first-occasion TI variance
/// is not the first-occasion trait-plus-state total.
InitialTotalVarianceIsNotInitialTimeIndependentVariance,
}

impl fmt::Display for PsychometricError {
Expand Down Expand Up @@ -1235,6 +1252,18 @@ impl fmt::Display for PsychometricError {
Self::ObservedVarianceIsNotStandardisedManifestVariance => {
"observed-indicator variance is not standardised measurement-error variance"
}
Self::InitialTotalVarianceIsNotInitialTraitVariance => {
"initial total variance is not initial trait variance"
}
Self::InitialTotalVarianceIsNotInitialLatentVariance => {
"initial total variance is not initial latent variance"
}
Self::InitialTotalVarianceIsNotTraitVariance => {
"initial total variance is not trait variance"
}
Self::InitialTotalVarianceIsNotInitialTimeIndependentVariance => {
"initial total variance is not initial time-independent predictor variance"
}
};
formatter.write_str(message)
}
Expand Down Expand Up @@ -2073,4 +2102,24 @@ mod tests {
"measurement error is not standardised manifest-trait variance"
);
}

#[test]
fn initial_total_variance_boundary_messages_are_stable() {
assert_eq!(
PsychometricError::InitialTotalVarianceIsNotInitialTraitVariance.to_string(),
"initial total variance is not initial trait variance"
);
assert_eq!(
PsychometricError::InitialTotalVarianceIsNotInitialLatentVariance.to_string(),
"initial total variance is not initial latent variance"
);
assert_eq!(
PsychometricError::InitialTotalVarianceIsNotTraitVariance.to_string(),
"initial total variance is not trait variance"
);
assert_eq!(
PsychometricError::InitialTotalVarianceIsNotInitialTimeIndependentVariance.to_string(),
"initial total variance is not initial time-independent predictor variance"
);
}
}
Loading
Loading