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

## [Unreleased]

- `psychometric_core` recovers Equation 5 of 2017-era commented three-term `asymTOTALVAR` as `λ²(−q / (2 a) + trait / a² + (B / a)² v) + θ` on current main (Driver, Oud, & Voelkle, 2017, Eq. 1, p. 4; Eq. 4–5, p. 5; Table 2, p. 12; §4.3, p. 9; §7.2, pp. 20–21; p. 16; 2017-era ctsem `summary.ctsemFit.R`; JSS PDF re-opened 2026-08-31T05:20Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104). Page 16 names `asymDIFFUSION` `-q / (2 a)`. Section 4.3 adds a stable trait whose process-mean variance is `trait / a²`. Section 7.2 names `addedTIPREDVAR` `(B / a)² v`. The 2017-era source comments `asymTOTALVAR <- asymDIFFUSION + asymTRAITVAR` then `+ addedTIPREDVAR` (not in the active `outlist`). Form that three-term total inline, then `λ²` of it plus `θ`. Do not export the unstandardised total. Do not import unpublished `asymTRAITVAR` / `asymTOTALVAR` helpers. `ψ = 0` this slice. A zero loading is exactly `θ`. All-zero latent contributions return `θ` even if `a ≥ 0`. `a ≥ 0` with any nonzero contribution fails closed. Numeric: `a = −0.5`, `trait = 1`, `q = 0.4`, `B = 0.5`, `v = 1`, `λ = 2`, `θ = 0.3` recovers 21.9, distinct from Eq. 5 of stationary `T0VAR` 9.9 (`TRAITVAR` is not `trait / a²`). `MANIFESTVAR` is not `Var(y)`. The unstandardised three-term total is not `Var(y)`. A non-event clock fails closed. Meredith (1993) remains unread (Springer/Cambridge paywalled; Unpaywall historically `is_oa: false`). Mislevy (1991, *Psychometrika, 56*, 177–196, DOI 10.1007/bf02294457) remains unread on the same terms. 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.

53 changes: 53 additions & 0 deletions crates/psychometric_core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,25 @@ pub enum PsychometricError {
/// `MANIFESTVARstd`. `λ² Var(η) + θ` is `Var(y)`, not the
/// correlation form of `Θ`.
ObservedVarianceIsNotStandardisedManifestVariance,
/// Equation 5 of 2017-era three-term `asymTOTALVAR` was requested
/// with a non-strictly-negative drift and a nonzero latent
/// contribution. Lasting `−q / (2 a) + trait / a² + (B / a)² v`
/// requires stable `a < 0`. All-zero contributions remain `θ`.
AsymptoticTotalObservedVarianceRequiresStableDrift,
/// Unstandardised 2017-era three-term `asymTOTALVAR`
/// `−q / (2 a) + trait / a² + (B / a)² v` was treated as Eq. 5 of
/// that total. The latent total is not `Var(y)`.
UnstandardisedAsymptoticTotalVarianceIsNotAsymptoticTotalObservedVariance,
/// Equation 5 of §4.3 stationary `T0VAR`
/// `λ²(trait + −q / (2 a) + (B / a)² v) + θ` was treated as
/// Eq. 5 of 2017-era three-term `asymTOTALVAR`. Stationary
/// `T0VAR` uses untransformed `TRAITVAR`; `asymTRAITVAR` is
/// `trait / a²`.
StationaryInitialObservedVarianceIsNotAsymptoticTotalObservedVariance,
/// Driver Table 2 `MANIFESTVAR` `θ` was treated as Eq. 5 of
/// 2017-era three-term `asymTOTALVAR`. Measurement error is not
/// `λ²` of that latent total plus `θ`.
MeasurementErrorIsNotAsymptoticTotalObservedVariance,
}

impl fmt::Display for PsychometricError {
Expand Down Expand Up @@ -1235,6 +1254,18 @@ impl fmt::Display for PsychometricError {
Self::ObservedVarianceIsNotStandardisedManifestVariance => {
"observed-indicator variance is not standardised measurement-error variance"
}
Self::AsymptoticTotalObservedVarianceRequiresStableDrift => {
"asymptotic total observed variance requires stable drift"
}
Self::UnstandardisedAsymptoticTotalVarianceIsNotAsymptoticTotalObservedVariance => {
"unstandardised asymptotic total variance is not asymptotic total observed variance"
}
Self::StationaryInitialObservedVarianceIsNotAsymptoticTotalObservedVariance => {
"stationary initial observed variance is not asymptotic total observed variance"
}
Self::MeasurementErrorIsNotAsymptoticTotalObservedVariance => {
"measurement error is not asymptotic total observed variance"
}
};
formatter.write_str(message)
}
Expand Down Expand Up @@ -2073,4 +2104,26 @@ mod tests {
"measurement error is not standardised manifest-trait variance"
);
}

#[test]
fn asymptotic_total_observed_variance_boundary_messages_are_stable() {
assert_eq!(
PsychometricError::AsymptoticTotalObservedVarianceRequiresStableDrift.to_string(),
"asymptotic total observed variance requires stable drift"
);
assert_eq!(
PsychometricError::UnstandardisedAsymptoticTotalVarianceIsNotAsymptoticTotalObservedVariance
.to_string(),
"unstandardised asymptotic total variance is not asymptotic total observed variance"
);
assert_eq!(
PsychometricError::StationaryInitialObservedVarianceIsNotAsymptoticTotalObservedVariance
.to_string(),
"stationary initial observed variance is not asymptotic total observed variance"
);
assert_eq!(
PsychometricError::MeasurementErrorIsNotAsymptoticTotalObservedVariance.to_string(),
"measurement error is not asymptotic total observed variance"
);
}
}
Loading
Loading