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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang
- **TDT/CHRONOS durable result contract**: canonical typed JSON and deterministic GraphML now export the actual bounded Allen reasoner result, observed/derived status, and conservative accepted-assertion support; canonical payload digest and `tdt_chronos_interval_consistency_v1` type bind the immutable bytes into ADR 0013's append-only `model_artifact` chain.
- **Analysis engine**: deterministic end-to-end analysis-run execution with cutoff-safe eligibility, immutable evidence binding, and reproducibility manifests (`analysis_engine` crate).
- **Restore Driver p.16 `MANIFESTVARstd`**: `recover_standardised_manifest_variance` maps `θ / θ = 1` with strictly positive `MANIFESTVAR`, refusing unstandardised manifest-variance, `MANIFESTTRAITVARstd`, and Equation 5 `Var(y)` substitutions (`psychometric_core`).
- **Restore Driver Table 3 / p.16 `T0TDPREDEFFECTstd`**: `recover_standardised_initial_time_dependent_predictor_effect` maps `t0_m · √v / √p_0` after strictly positive free `T0VAR` and `TDPREDVAR`, refusing unstandardised `t0_m`, `TDPREDEFFECTstd`, `T0TIPREDEFFECTstd`, and trait-contaminated total-variance substitutions (`psychometric_core`).
- **Posterior network estimator**: cross-draw Pearson correlations in ILR space, jackknife SE and CI, Benjamini–Hochberg FDR edge admission, nonparametric bootstrap stability, greedy modularity consensus clustering (`network_analysis` crate).
- **Topic measurement reference estimator**: bounded deterministic CPU `f64` TRSL-TM fitting with ALR/ILR coordinates, Aitchison distance, and lexical-inferential-weight refusal gates (`topic_measurement` crate).
- **Psychometric core**: Driver et al. (2017) SDE discrete-time recovery suite including drift, diffusion, T0VAR, TIPRED/TDPRED effects, standardised parameters, trait/state variance decomposition, and observed-indicator mapping — 18 K lines of production Rust with true-parameter RMSE tests.
Expand Down Expand Up @@ -40,6 +41,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, Table 3, p. 13 `T0TDPREDEFFECT`; Table 2, p. 12 `TDPREDVAR`; p. 16 `T0TDPREDEFFECTstd`; footnote 4; Eq. 3, p. 5; 2017-era ctsem `summary.ctsemFit.R`; JSS PDF re-opened 2026-08-30T00:17Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar standardised first-occasion time-dependent predictor effect rebased onto protected `main` `6444a81` after `0ce16e8` dropped the pre-consolidation code while research notes already named the map (register items 77–78). Page 16 prints continuous-time parameters and, when appropriate, standardised matrices with the suffix `std`. The printed example on p. 16 is `discreteDRIFTstd`, not `T0TDPREDEFFECTstd`. Footnote 4 standardises using only the relevant variance, not the total. Table 3 names `T0TDPREDEFFECT` the effect of time-dependent predictors on latents at `T0`. Table 2 names `TDPREDEFFECT` `M` for the process dynamics and names `TDPREDVAR` the time-dependent predictor variance. The affecting variance is `TDPREDVAR` `v`. The affected variance is free first-occasion `T0VAR` `p_0`, not within-subject `asymDIFFUSION` `p = −q / (2 a)`, because Table 3 is the first occasion, not the process dynamics. The 2017-era `summary.ctsemFit.R` forms `T0TIPREDEFFECTstd` when `verbose = TRUE` as `T0TIPREDEFFECT * (sqrt(TIPREDVAR) / sqrt(T0VAR))`. That file does not form `T0TDPREDEFFECT` or `T0TDPREDEFFECTstd`. The `n.TDpred` section forms unstandardised `TDPREDEFFECT` only and comments out `TDPREDVAR` and `TDPREDVARstd`. The scalar analog of that `T0TIPREDEFFECTstd` formation using Table 3 `T0TDPREDEFFECT` and Table 2 `TDPREDVAR` is `t0_m · √v / √p_0`. Form strictly positive `p_0` first, then strictly positive `v`, then the first-occasion coefficient, then the SD ratio. Form the SD ratio before multiplying by the coefficient. A zero coefficient with positive `v` and `p_0` is exactly zero even when `√v / √p_0` overflows (`0 · Inf` is NaN). When that ratio overflows, form `(t0_m / √p_0) √v`. Unstandardised `t0_m` is defined for a zero coefficient and for zero predictor variance; standardised `T0TDPREDEFFECT` is not. Zero `v` has no positive predictor SD and fails closed. Zero `p_0` has no positive first-occasion 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`; this map has no log-rate argument. A larger positive `p_0` yields a smaller `|std|`. The continuous standardisation `m · √v / √p` uses `asymDIFFUSION` and is not this first-occasion map. Table 3 `T0TIPREDEFFECTstd` `t0_b · √v / √p_0` is a different named matrix even when `t0_m = t0_b`. `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. Independent of open `#302` `T0TIPREDEFFECTstd`, `#300` `TIPREDEFFECTstd`, `#299` `asymTIPREDEFFECTstd`, `#298` `DRIFTstd`, `#280` `discreteDRIFTstd`, `#296` `discreteDIFFUSIONstd`, `#297` `DIFFUSIONstd`, and `#272` `TIPREDVARstd`. Meredith (1993) remains unread (Unpaywall 2026-08-30T00:17Z: `is_oa: false`; Springer `content/pdf` is a 3038-byte HTML stub). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread on the same terms (DOI `10.1007/bf02294457`; Unpaywall this cycle `is_oa: false`; Springer `content/pdf` is a 3038-byte HTML stub). 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
82 changes: 82 additions & 0 deletions crates/psychometric_core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,36 @@ pub enum PsychometricError {
/// `MANIFESTVARstd`. `λ² Var(η) + θ` is `Var(y)`, not the
/// correlation form of `Θ`.
ObservedVarianceIsNotStandardisedManifestVariance,
/// Driver Table 3 / p. 16 `T0TDPREDEFFECTstd` was requested with
/// a non-positive free first-occasion variance. Footnote 4
/// standardises the affected first-occasion latent using only
/// strictly positive free `T0VAR`.
StandardisedInitialTimeDependentEffectRequiresPositiveInitialLatentVariance,
/// Driver Table 3 / p. 16 `T0TDPREDEFFECTstd` was requested with
/// a non-positive time-dependent predictor variance. Footnote 4
/// standardises the affecting predictor using only strictly
/// positive `TDPREDVAR`.
StandardisedInitialTimeDependentEffectRequiresPositivePredictorVariance,
/// Driver Table 3 unstandardised `T0TDPREDEFFECT` `t0_m` was
/// treated as p. 16 `T0TDPREDEFFECTstd`. Unstandardised `t0_m`
/// is defined for a zero coefficient or zero predictor variance;
/// standardised `T0TDPREDEFFECT` is not.
UnstandardisedInitialTimeDependentEffectIsNotStandardisedInitialTimeDependentEffect,
/// Driver p. 16 `TDPREDEFFECTstd`
/// `m · √v / √(-q / (2 a))` was treated as Table 3 / p. 16
/// `T0TDPREDEFFECTstd`. The continuous map uses `asymDIFFUSION`;
/// the first-occasion map uses free `T0VAR`.
StandardisedContinuousTimeDependentEffectIsNotStandardisedInitialTimeDependentEffect,
/// Driver Table 3 / p. 16 `T0TIPREDEFFECTstd`
/// `t0_b · √v / √p_0` was treated as Table 3 / p. 16
/// `T0TDPREDEFFECTstd`. Equal numbers when `t0_m = t0_b` remain
/// distinct named quantities.
StandardisedInitialTimeIndependentEffectIsNotStandardisedInitialTimeDependentEffect,
/// Driver §7.1 trait-contaminated first-occasion TD effect
/// `t0_m · √v / √(trait + p_0 + added)` was treated as Table 3 /
/// p. 16 `T0TDPREDEFFECTstd`. Footnote 4 uses only free `T0VAR`,
/// not `TRAITVAR`.
TraitContaminatedInitialTimeDependentEffectIsNotStandardisedInitialTimeDependentEffect,
}

impl fmt::Display for PsychometricError {
Expand Down Expand Up @@ -1235,6 +1265,24 @@ impl fmt::Display for PsychometricError {
Self::ObservedVarianceIsNotStandardisedManifestVariance => {
"observed-indicator variance is not standardised measurement-error variance"
}
Self::StandardisedInitialTimeDependentEffectRequiresPositiveInitialLatentVariance => {
"standardised initial time-dependent predictor effect requires strictly positive initial latent variance"
}
Self::StandardisedInitialTimeDependentEffectRequiresPositivePredictorVariance => {
"standardised initial time-dependent predictor effect requires strictly positive predictor variance"
}
Self::UnstandardisedInitialTimeDependentEffectIsNotStandardisedInitialTimeDependentEffect => {
"unstandardised initial time-dependent predictor effect is not standardised initial time-dependent predictor effect"
}
Self::StandardisedContinuousTimeDependentEffectIsNotStandardisedInitialTimeDependentEffect => {
"standardised continuous time-dependent predictor effect is not standardised initial time-dependent predictor effect"
}
Self::StandardisedInitialTimeIndependentEffectIsNotStandardisedInitialTimeDependentEffect => {
"standardised initial time-independent predictor effect is not standardised initial time-dependent predictor effect"
}
Self::TraitContaminatedInitialTimeDependentEffectIsNotStandardisedInitialTimeDependentEffect => {
"trait-contaminated initial time-dependent predictor effect is not standardised initial time-dependent predictor effect"
}
};
formatter.write_str(message)
}
Expand Down Expand Up @@ -2073,4 +2121,38 @@ mod tests {
"measurement error is not standardised manifest-trait variance"
);
}

#[test]
fn standardised_initial_time_dependent_effect_boundary_messages_are_stable() {
assert_eq!(
PsychometricError::StandardisedInitialTimeDependentEffectRequiresPositiveInitialLatentVariance
.to_string(),
"standardised initial time-dependent predictor effect requires strictly positive initial latent variance"
);
assert_eq!(
PsychometricError::StandardisedInitialTimeDependentEffectRequiresPositivePredictorVariance
.to_string(),
"standardised initial time-dependent predictor effect requires strictly positive predictor variance"
);
assert_eq!(
PsychometricError::UnstandardisedInitialTimeDependentEffectIsNotStandardisedInitialTimeDependentEffect
.to_string(),
"unstandardised initial time-dependent predictor effect is not standardised initial time-dependent predictor effect"
);
assert_eq!(
PsychometricError::StandardisedContinuousTimeDependentEffectIsNotStandardisedInitialTimeDependentEffect
.to_string(),
"standardised continuous time-dependent predictor effect is not standardised initial time-dependent predictor effect"
);
assert_eq!(
PsychometricError::StandardisedInitialTimeIndependentEffectIsNotStandardisedInitialTimeDependentEffect
.to_string(),
"standardised initial time-independent predictor effect is not standardised initial time-dependent predictor effect"
);
assert_eq!(
PsychometricError::TraitContaminatedInitialTimeDependentEffectIsNotStandardisedInitialTimeDependentEffect
.to_string(),
"trait-contaminated initial time-dependent predictor effect is not standardised initial time-dependent predictor effect"
);
}
}
Loading
Loading