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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ 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, p. 16 `DIFFUSIONstd`; Eq. 4, p. 5; Table 2, p. 12; footnote 4; 2017-era ctsem `summary.ctsemFit.R`; JSS PDF re-opened 2026-09-01T19:20Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar standardised continuous diffusion on current main after `0ce16e8` dropped the pre-consolidation code while research notes already named the map (register items 59–60). Page 16 prints standardised matrices with the suffix `std` when appropriate. The printed example on p. 16 is `discreteDRIFTstd`, not `DIFFUSIONstd`. Footnote 4 standardises using only the relevant variance, not the total. Table 2 names `DIFFUSION` `Q` the lower-triangular `n.latent × n.latent` Cholesky of diffusion variance/covariance. Process noise is within-subject stochastic input, so that relevant variance is within-subject `asymDIFFUSION` `p = −q / (2 a)`. The 2017-era source forms unstandardised `DIFFUSION` as `mxEval(DIFFUSION, mxobj, compute=TRUE)` and forms `asymDIFFUSIONstd` when `verbose = TRUE`. That source does not form a `DIFFUSIONstd` matrix; the scalar map is the footnote 4 standardisation of that named continuous diffusion: `q / p` after strictly positive `p`. Form strictly positive `p` first, then divide `q` by `p`. In the scalar stationary case that ratio equals `−2 a` and does not depend on `q` once `q > 0`. Unstandardised `q` is defined for growing `a ≥ 0` and for a zero process; standardised `DIFFUSION` is not. Zero `q` has no positive process SD and fails closed. Lasting `p` requires stable `a < 0`. A non-event clock fails closed. `Q_Δt / p` is `discreteDIFFUSIONstd` and depends on the event interval. `p / p = 1` is `asymDIFFUSIONstd` and recovers the same number when `a = −0.5` and remains a distinct named quantity. `q / (trait + p + added)` uses the total and is not this map when `TRAITVAR` is nonzero. 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.
- `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
53 changes: 53 additions & 0 deletions crates/psychometric_core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,23 @@ pub enum PsychometricError {
/// `asymDIFFUSIONstd`. The continuous-diffusion ratio is not
/// the correlation form of `asymDIFFUSION`.
StandardisedContinuousDiffusionIsNotStandardisedAsymptoticDiffusion,
/// Driver p. 16 `DIFFUSIONstd` was requested without a strictly
/// positive `asymDIFFUSION`. Footnote 4 standardises using only
/// the relevant variance; zero `q` has no positive process SD.
StandardisedContinuousDiffusionRequiresPositiveStationaryVariance,
/// Driver Table 2 unstandardised `DIFFUSION` `q` was treated as
/// `DIFFUSIONstd`. Unstandardised diffusion is defined for
/// growing `a ≥ 0` and for zero diffusion; standardised
/// `DIFFUSION` is not.
UnstandardisedContinuousDiffusionIsNotStandardisedContinuousDiffusion,
/// Driver p. 16 `discreteDIFFUSIONstd` `Q_Δt / p` was treated
/// as `DIFFUSIONstd`. The discrete map depends on the event
/// interval; the continuous ratio does not.
DiscreteStandardisedDiffusionIsNotStandardisedContinuousDiffusion,
/// Driver §7.1 total `q / (trait + p + added)` was treated as
/// p. 16 `DIFFUSIONstd`. Footnote 4 uses only within-subject
/// `asymDIFFUSION`, not the total.
TotalVarianceScaledDiffusionIsNotStandardisedContinuousDiffusion,
/// Driver p. 16 `TIPREDVARstd` was treated as p. 16
/// `asymDIFFUSIONstd`. Equal numbers of 1 after a strictly
/// positive relevant variance are still distinct named
Expand Down Expand Up @@ -1168,6 +1185,18 @@ impl fmt::Display for PsychometricError {
Self::StandardisedContinuousDiffusionIsNotStandardisedAsymptoticDiffusion => {
"standardised continuous diffusion is not standardised asymptotic diffusion"
}
Self::StandardisedContinuousDiffusionRequiresPositiveStationaryVariance => {
"standardised continuous diffusion requires strictly positive stationary within-subject variance"
}
Self::UnstandardisedContinuousDiffusionIsNotStandardisedContinuousDiffusion => {
"unstandardised continuous diffusion is not standardised continuous diffusion"
}
Self::DiscreteStandardisedDiffusionIsNotStandardisedContinuousDiffusion => {
"discrete standardised diffusion is not standardised continuous diffusion"
}
Self::TotalVarianceScaledDiffusionIsNotStandardisedContinuousDiffusion => {
"total-variance scaled diffusion is not standardised continuous diffusion"
}
Self::StandardisedTimeIndependentPredictorVarianceIsNotStandardisedAsymptoticDiffusion => {
"standardised time-independent predictor variance is not standardised asymptotic diffusion"
}
Expand Down Expand Up @@ -1979,6 +2008,30 @@ mod tests {
);
}

#[test]
fn standardised_continuous_diffusion_boundary_messages_are_stable() {
assert_eq!(
PsychometricError::StandardisedContinuousDiffusionRequiresPositiveStationaryVariance
.to_string(),
"standardised continuous diffusion requires strictly positive stationary within-subject variance"
);
assert_eq!(
PsychometricError::UnstandardisedContinuousDiffusionIsNotStandardisedContinuousDiffusion
.to_string(),
"unstandardised continuous diffusion is not standardised continuous diffusion"
);
assert_eq!(
PsychometricError::DiscreteStandardisedDiffusionIsNotStandardisedContinuousDiffusion
.to_string(),
"discrete standardised diffusion is not standardised continuous diffusion"
);
assert_eq!(
PsychometricError::TotalVarianceScaledDiffusionIsNotStandardisedContinuousDiffusion
.to_string(),
"total-variance scaled diffusion is not standardised continuous diffusion"
);
}

#[test]
fn standardised_trait_variance_boundary_messages_are_stable() {
assert_eq!(
Expand Down
Loading
Loading