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
4 changes: 2 additions & 2 deletions 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 @@ -40,6 +40,8 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang

- `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, Eq. 3 first summand, p. 5; §4.3, pp. 9–10; §7.1, pp. 18–19; 2017-era ctsem `ctModel.R` / `ctFit.R` / `ctGenerate.R`; JSS PDF re-opened 2026-08-31T01:40Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar Eq. 3 first-summand carry of 2017-era `T0TRAITEFFECT` as `e^{A Δt} t0_trait · trait` (register items 114–115). Paper §4.3 / §7.1 name traits the between-subject process. Table 2 / Table 3 do not print `T0TRAITEFFECT`. The 2017-era `ctFit.R` places that matrix in the `OpenMx` `A` regression block from trait latents to process latents at `T0`; `ctGenerate.R` writes `T0MEANS = T0MEANS + T0TRAITEFFECT %*% traits` and then integrates the SDE, so that product is already in `η(t0)`. Equation 3's first summand is `e^{A(t−t0)} η_i(t0)`, so the carry is `e^{A Δt} t0_trait · trait`. Form `t0_trait` first, then multiply by the trait score, then `e^{a Δt}` of that product. A zero coefficient or zero trait is exactly zero. A zero drift is the first-occasion product with no dissipation. Binary64 underflow of `e^{a Δt}` to `+0` is a vanishing carry and is kept. Overflow of a finite `a Δt` rewrites as `sign(shift) exp(ln|shift| + a Δt)`. `t0_trait · trait` is the first-occasion shift and is not this carry even when `a = 0`. `e^{A Δt} t0_b z` is `T0TIPREDEFFECT` carry and is not this carry even when the numbers equal. `e^{A Δt} t0_m x0` is `T0TDPREDEFFECT` carry and is not this carry even when the numbers equal. `A^{-1}[e^{A Δt} − I] B z` is `TIPREDEFFECT` and is not this carry. This crate does not invent `T0TRAITVAR`. Free `T0TRAITEFFECT` does not require `a < 0`. Independent of open sibling PRs (`#299`–`#318`). Meredith (1993) remains unread (web search 2026-08-31T01:40Z: Springer/Cambridge Core paywalled; Unpaywall historically `is_oa: false`). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread on the same terms (DOI `10.1007/bf02294457`; ERIC ED268155 is Mislevy 1985 ETS RR-85-41, not the 1991 journal article). Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation.

- `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.

- `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-26T17:45Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar standardised trait variance on current main after `0ce16e8` dropped the pre-consolidation code while research notes already named the map (register items 81–82). 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 printed example on p. 16 is `discreteDRIFTstd`, not `TRAITVARstd`. Footnote 4 standardises using only the relevant variance, not the total. The relevant variance for that named between-subject correlation is `TRAITVAR`, not free first-occasion `T0VAR` and not process-dynamics `asymDIFFUSION`. The 2017-era source forms `TRAITVARstd` only when `TRAITVAR != 0`, as `solve(sqrt(diag(TRAITVAR))) %&% TRAITVAR` when `verbose = TRUE`. OpenMx `%&%` is `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. `p_0 / p_0 = 1` is `T0VARstd` and recovers the same number and remains a distinct named quantity. `t0_b² v` is `addedT0TIPREDVAR` and is extra first-occasion TI variance, not this correlation. Meredith (1993) remains unread (Unpaywall 2026-08-26T17:20Z: `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.
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions crates/psychometric_core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,22 @@ pub enum PsychometricError {
/// `MANIFESTVARstd`. `λ² Var(η) + θ` is `Var(y)`, not the
/// correlation form of `Θ`.
ObservedVarianceIsNotStandardisedManifestVariance,
/// 2017-era `T0TRAITEFFECT` first-occasion shift was treated as
/// the Eq. 3 first-summand carry. `t0_trait · trait` is not
/// `e^{A Δt} t0_trait · trait`.
InitialTraitEffectIsNotInitialTraitCarry,
/// Driver Eq. 3 carry of Table 3 `T0TIPREDEFFECT` was treated as
/// the Eq. 3 carry of 2017-era `T0TRAITEFFECT`. `e^{A Δt} t0_b z`
/// is not `e^{A Δt} t0_trait · trait`.
InitialTimeIndependentCarryIsNotInitialTraitCarry,
/// Driver Eq. 3 carry of Table 3 `T0TDPREDEFFECT` was treated as
/// the Eq. 3 carry of 2017-era `T0TRAITEFFECT`. `e^{A Δt} t0_m x0`
/// is not `e^{A Δt} t0_trait · trait`.
InitialTimeDependentCarryIsNotInitialTraitCarry,
/// Driver Eq. 3 second-summand `TIPREDEFFECT` increment was treated
/// as the Eq. 3 carry of 2017-era `T0TRAITEFFECT`.
/// `A^{-1}[e^{A Δt} − I] B z` is not `e^{A Δt} t0_trait · trait`.
TimeIndependentIncrementIsNotInitialTraitCarry,
}

impl fmt::Display for PsychometricError {
Expand Down Expand Up @@ -1235,6 +1251,18 @@ impl fmt::Display for PsychometricError {
Self::ObservedVarianceIsNotStandardisedManifestVariance => {
"observed-indicator variance is not standardised measurement-error variance"
}
Self::InitialTraitEffectIsNotInitialTraitCarry => {
"first-occasion trait effect is not the first-occasion trait carry"
}
Self::InitialTimeIndependentCarryIsNotInitialTraitCarry => {
"first-occasion time-independent predictor carry is not the first-occasion trait carry"
}
Self::InitialTimeDependentCarryIsNotInitialTraitCarry => {
"first-occasion time-dependent predictor carry is not the first-occasion trait carry"
}
Self::TimeIndependentIncrementIsNotInitialTraitCarry => {
"time-independent predictor increment is not the first-occasion trait carry"
}
};
formatter.write_str(message)
}
Expand Down Expand Up @@ -2073,4 +2101,24 @@ mod tests {
"measurement error is not standardised manifest-trait variance"
);
}

#[test]
fn initial_trait_carry_boundary_messages_are_stable() {
assert_eq!(
PsychometricError::InitialTraitEffectIsNotInitialTraitCarry.to_string(),
"first-occasion trait effect is not the first-occasion trait carry"
);
assert_eq!(
PsychometricError::InitialTimeIndependentCarryIsNotInitialTraitCarry.to_string(),
"first-occasion time-independent predictor carry is not the first-occasion trait carry"
);
assert_eq!(
PsychometricError::InitialTimeDependentCarryIsNotInitialTraitCarry.to_string(),
"first-occasion time-dependent predictor carry is not the first-occasion trait carry"
);
assert_eq!(
PsychometricError::TimeIndependentIncrementIsNotInitialTraitCarry.to_string(),
"time-independent predictor increment is not the first-occasion trait carry"
);
}
}
Loading
Loading