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
2 changes: 1 addition & 1 deletion ARCHITECTURE.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to TEPP are documented here. The format follows Keep a Chang

## [Unreleased]

- `psychometric_core` recovers the scalar analog of Driver, Oud, and Voelkle (2017, Table 2, p. 12 `TDPREDVAR` / `T0TDPREDCOV`; Table 3, p. 13 `T0TIPREDEFFECT`; p. 16; §7.2, pp. 20–21; Eq. 3, p. 5; 2017-era ctsem `summary.ctsemFit.R`; JSS PDF re-opened 2026-08-23T22:13Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) extra first-occasion time-dependent predictor variance. The 2017-era `summary.ctsemFit.R` forms `addedT0TIPREDVAR` as `T0TIPREDEFFECT %*% TIPREDVAR %*% t(T0TIPREDEFFECT)` immediately after `T0TIPREDEFFECTstd`. That file comments out `TDPREDVAR` and does not form `addedT0TDPREDVAR`. Table 2 names `T0TDPREDCOV` the covariance between latents at `T0` and time-dependent predictors, not this extra variance. Table 3 names `T0TIPREDEFFECT`, not a TD first-occasion effect matrix. The scalar analog of that quadratic form using the stack's first-occasion TD coefficient `t0_m` and Table 2 `TDPREDVAR` `v` is `t0_m² v`. Form `t0_m` first, then square, then multiply by `v`. A zero coefficient or zero predictor variance is exactly zero. `v < 0` fails closed. `T0` is an event-time occasion, so a non-event clock fails closed. Free `t0_m` does not require stable `a < 0`. `t0_b² v` is `addedT0TIPREDVAR` and is not this extra even when `t0_m = t0_b`. `t0_m · √v / √p_0` is `T0TDPREDEFFECTstd` and is not this variance. `T0TDPREDCOV` is the covariance, not `t0_m² v`. Free `T0VAR` `p_0` is the first-occasion state, not the extra TD variance. `TRAITVAR` is a zero-drift latent process, not `t0_m² v`. Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation. Meredith (1993) remains unread (Unpaywall 2026-08-23T21:34Z: `is_oa: false`; title *Measurement Invariance, Factor Analysis and Factorial Invariance*). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread (Unpaywall 2026-08-23T21:34Z: `is_oa: false`; title *Randomization-Based Inference about Latent Variables from Complex Samples*).
- `psychometric_core` recovers the Driver, Oud, and Voelkle (2017, Table 3, p. 13 `T0TDPREDEFFECTstd`; Table 2, p. 12; p. 16; footnote 4; Eq. 3, p. 5; 2017-era ctsem `summary.ctsemFit.R`; JSS PDF re-opened 2026-08-23T21:34Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar standardised first-occasion time-dependent predictor effect. Table 3 names `T0TDPREDEFFECT` the effect of time-dependent predictors on latents at `T0`. Table 2 names `M` `TDPREDEFFECT` and names `T0TDPREDCOV` the first-occasion covariance, not this coefficient. Page 16 prints standardised matrices with the suffix `std` when appropriate. Footnote 4: standardisations use only the relevant variance, not the total. The affecting variance is time-dependent predictor variance `v`, not `TIPREDVAR`. The affected variance is free first-occasion `T0VAR` `p_0`, not within-subject `asymDIFFUSION` `-q / (2 a)`, because Table 3 is the first occasion, not the process dynamics. Form strictly positive `p_0` first, then strictly positive `v`, then `t0_m · √v / √p_0`. Unstandardised `t0_m` is defined for a zero coefficient and for zero predictor variance; standardised `T0TDPREDEFFECT` is not. Zero `p_0` or zero `v` has no positive 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`. The continuous standardisation `m · √v / √(-q / (2 a))` uses `asymDIFFUSION` and is not this first-occasion map. `T0TIPREDEFFECTstd` `t0_b · √v / √p_0` is a different named matrix even when `t0_m = t0_b` and the predictor variances match. Section 7.1 warns that omitting trait variance confounds between- and within-person information. `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. Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation. Meredith (1993) remains unread (Unpaywall 2026-08-23T21:34Z: `is_oa: false`; title *Measurement Invariance, Factor Analysis and Factorial Invariance*). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread (Unpaywall 2026-08-23T21:34Z: `is_oa: false`; title *Randomization-Based Inference about Latent Variables from Complex Samples*).
- `psychometric_core` recovers the Driver, Oud, and Voelkle (2017, p. 16 `TDPREDEFFECTstd`; Table 2, p. 12; Eq. 3, p. 5; footnote 4; §7.1, pp. 18–19; JSS PDF re-opened 2026-08-23T21:10Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar standardised continuous time-dependent predictor effect. Page 16 prints continuous-time parameters and, when appropriate, standardised matrices with the suffix `std`. Table 2 names `M` `TDPREDEFFECT`. Footnote 4: standardisations use only the relevant variance, not the total. The affecting variance is time-dependent predictor variance `v`. The affected variance is within-subject `asymDIFFUSION` `-q / (2 a)`, because the process dynamics are individual, or average individual, temporal dynamics. Form strictly positive `asymDIFFUSION` first, then strictly positive `v`, then `m · √v / √(-q / (2 a))`. Unstandardised `M` is defined for a zero coefficient and for zero predictor variance; standardised `TDPREDEFFECT` is not. Zero `asymDIFFUSION` or zero `v` has no positive SD and fails closed. `TIPREDEFFECTstd` `B · √v / √p` is a different named matrix even when `M = B` and the predictor variances match. The finite-interval intercept-style standardisation `A^{-1}[e^{A Δt} − I] M · √v / √p` depends on the event interval and is not this continuous Dirac coefficient. Section 7.1 warns that omitting trait variance confounds between- and within-person information. `m · √v / √(trait + p + added)` uses the total, not `asymDIFFUSION`, and is not `TDPREDEFFECTstd` when `TRAITVAR` is nonzero. `TRAITVAR` is not the standardisation variance. Predecessor `event_time.rs` asymptotic-std `process_sd == 0` / `predictor_sd == 0` gates after already-checked `within == 0` and `v == 0` were unreachable; this slice drops them so stacked line/branch coverage can close. Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation. Meredith (1993) remains unread (Unpaywall 2026-08-23T21:10Z: `is_oa: false`; title *Measurement Invariance, Factor Analysis and Factorial Invariance*). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread (Unpaywall 2026-08-23T21:10Z: `is_oa: false`; title *Randomization-Based Inference about Latent Variables from Complex Samples*).
- `psychometric_core` recovers the Driver, Oud, and Voelkle (2017, Eq. 5, p. 5; Table 2, p. 12; §7.2, pp. 20–21; 2017-era ctsem `summary.ctsemFit.R`; JSS PDF re-opened 2026-08-23T19:23Z from https://www.jstatsoft.org/index.php/jss/article/download/v077i05/1104) scalar extra observed-indicator time-independent predictor variance of §7.2 `addedTIPREDVAR`. Equation 5 writes `y_i(t) = Γ + Λ η_i(t) + ζ_i(t)` with `ζ ~ N(0, Θ)` and `Γ ~ N(τ, Ψ)`. The 2017-era `summary.ctsemFit.R` forms the latent extra `addedTIPREDVAR` as `asymTIPREDEFFECT %*% TIPREDVAR %*% t(asymTIPREDEFFECT)`. The scalar latent extra is `(B / a)² v`. Equation 5 of that extra, with `θ = 0` and `ψ = 0`, is `λ² (B / a)² v`. Form `addedTIPREDVAR` first, then `(λ extra) λ`. Do not form `λ²` first. A zero loading or zero extra is exactly zero. `v < 0` fails closed. A non-event clock fails closed. `a ≥ 0` cannot hold a finite process-mean change when the extra is nonzero and fails closed. `(B / a)² v` is the latent extra, not this observed extra. `λ² t0_b² v` is Eq. 5 of `addedT0TIPREDVAR`, not this asymptotic observed extra. `λ² p + θ` is stationary observed variance, not this extra. `MANIFESTVAR` `θ` is measurement error, not this extra. `Ψ` is intercept variance and is not extra TI. The printed 2-latent `addedTIPREDVAR` 2.838 is not this scalar map. Still not a Kalman filter, not a matrix `expm`, not ESEM estimation, not DSEM, and not ctsem estimation. Meredith (1993) remains unread (Unpaywall 2026-08-23T19:10Z: `is_oa: false`; title *Measurement Invariance, Factor Analysis and Factorial Invariance*). Mislevy (1991, *Psychometrika, 56*, 177–196) remains unread (Unpaywall 2026-08-23T19:10Z: `is_oa: false`; title *Randomization-Based Inference about Latent Variables from Complex Samples*).
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions crates/psychometric_core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,33 @@ pub enum PsychometricError {
/// / p. 16 `T0TDPREDEFFECTstd`. Footnote 4 uses only free
/// `T0VAR`, not `TRAITVAR`.
TraitContaminatedInitialTimeDependentEffectIsNotStandardisedInitialTimeDependentEffect,
/// The scalar analog of 2017-era `addedT0TIPREDVAR` for the
/// first-occasion TD coefficient `t0_m² v` was treated as
/// 2017-era `addedT0TIPREDVAR` `t0_b² v`. Table 3 names
/// `T0TIPREDEFFECT`. Equal numbers when `t0_m = t0_b` are still
/// distinct named quantities.
InitialTimeDependentVarianceIsNotInitialTimeIndependentVariance,
/// The scalar analog of 2017-era `addedT0TIPREDVAR` for the
/// first-occasion TD coefficient `t0_m² v` was treated as
/// Table 3 / p. 16 `T0TDPREDEFFECTstd`. The extra first-occasion
/// variance is not the standardised coefficient.
InitialTimeDependentVarianceIsNotStandardisedInitialTimeDependentEffect,
/// The scalar analog of 2017-era `addedT0TIPREDVAR` for the
/// first-occasion TD coefficient `t0_m² v` was treated as
/// Table 2 `T0TDPREDCOV`. `T0TDPREDCOV` is the covariance
/// between latents at `T0` and time-dependent predictors, not
/// the extra variance `t0_m² v`.
InitialTimeDependentVarianceIsNotInitialTimeDependentCovariance,
/// The scalar analog of 2017-era `addedT0TIPREDVAR` for the
/// first-occasion TD coefficient `t0_m² v` was treated as free
/// first-occasion `T0VAR`. `p_0` is the first-occasion state,
/// not the extra TD variance.
InitialTimeDependentVarianceIsNotInitialLatentVariance,
/// The scalar analog of 2017-era `addedT0TIPREDVAR` for the
/// first-occasion TD coefficient `t0_m² v` was treated as
/// `TRAITVAR`. Section 4.3 `TRAITVAR` is a zero-drift latent
/// process, not first-occasion TD extra variance.
InitialTimeDependentVarianceIsNotTraitVariance,
}

impl fmt::Display for PsychometricError {
Expand Down Expand Up @@ -1615,6 +1642,21 @@ impl fmt::Display for PsychometricError {
Self::TraitContaminatedInitialTimeDependentEffectIsNotStandardisedInitialTimeDependentEffect => {
"trait-contaminated initial time-dependent predictor effect is not standardised initial time-dependent predictor effect"
}
Self::InitialTimeDependentVarianceIsNotInitialTimeIndependentVariance => {
"initial time-dependent predictor variance is not initial time-independent predictor variance"
}
Self::InitialTimeDependentVarianceIsNotStandardisedInitialTimeDependentEffect => {
"initial time-dependent predictor variance is not standardised initial time-dependent predictor effect"
}
Self::InitialTimeDependentVarianceIsNotInitialTimeDependentCovariance => {
"initial time-dependent predictor variance is not initial time-dependent predictor covariance"
}
Self::InitialTimeDependentVarianceIsNotInitialLatentVariance => {
"initial time-dependent predictor variance is not initial latent variance"
}
Self::InitialTimeDependentVarianceIsNotTraitVariance => {
"initial time-dependent predictor variance is not trait variance"
}
};
formatter.write_str(message)
}
Expand Down Expand Up @@ -2781,4 +2823,31 @@ mod tests {
"trait-contaminated initial time-dependent predictor effect is not standardised initial time-dependent predictor effect"
);
}

#[test]
fn initial_time_dependent_variance_boundary_messages_are_stable() {
assert_eq!(
PsychometricError::InitialTimeDependentVarianceIsNotInitialTimeIndependentVariance
.to_string(),
"initial time-dependent predictor variance is not initial time-independent predictor variance"
);
assert_eq!(
PsychometricError::InitialTimeDependentVarianceIsNotStandardisedInitialTimeDependentEffect
.to_string(),
"initial time-dependent predictor variance is not standardised initial time-dependent predictor effect"
);
assert_eq!(
PsychometricError::InitialTimeDependentVarianceIsNotInitialTimeDependentCovariance
.to_string(),
"initial time-dependent predictor variance is not initial time-dependent predictor covariance"
);
assert_eq!(
PsychometricError::InitialTimeDependentVarianceIsNotInitialLatentVariance.to_string(),
"initial time-dependent predictor variance is not initial latent variance"
);
assert_eq!(
PsychometricError::InitialTimeDependentVarianceIsNotTraitVariance.to_string(),
"initial time-dependent predictor variance is not trait variance"
);
}
}
Loading
Loading