ehs-risk-sem
Back to ehs-risk-sem

identification

IdentificationReport

IdentificationReport(n_observed: 'int', n_moments: 'int', n_free_parameters: 'int', df: 'int', t_rule_passed: 'bool', recursive: 'bool', scale_setting: 'str', per_factor_indicator_counts: 'Dict[str, int]', smallest_eigenvalue: 'float', condition_number: 'float', errors: 'List[str]' = <factory>, warnings: 'List[str]' = <factory>) -> None

Outcome of the identification checks.

``necessary_condition_met`` is the gate. ``sufficient`` is deliberately absent: no general sufficient condition for an arbitrary SEM is checked here, and claiming one would be false.

check_identification

check_identification(blocks: 'Dict[str, Sequence[str]]', paths: 'Dict[str, Sequence[str]]', sample_covariance: 'np.ndarray', min_indicators: 'int' = 2, recommended_indicators: 'int' = 3) -> 'IdentificationReport'

Run every identification check and return a report.

Parameters ---------- blocks Mapping from latent variable name to its indicator names. paths Mapping from endogenous latent name to its direct predictors. sample_covariance Observed covariance (or correlation) matrix of the indicators, used only for the empirical checks.

count_free_parameters

count_free_parameters(indicator_counts: 'Sequence[int]', n_exogenous: 'int', n_paths: 'int') -> 'int'

Count free parameters under this package's parameterization.

With every latent variance fixed to 1:

Disturbance variances of the endogenous latents are *not* free: with the latent standardized, the disturbance variance is ``1 - R^2``, determined by the paths.

  • one free loading per indicator: ``sum(indicator_counts)``;
  • one free error variance per indicator: ``sum(indicator_counts)``;
  • free covariances among the exogenous latents: ``n_exo * (n_exo - 1) / 2``;
  • one coefficient per structural path: ``n_paths``.

is_recursive

is_recursive(paths: 'Dict[str, Sequence[str]]', latents: 'Sequence[str]') -> 'bool'

True if the directed graph implied by ``paths`` is acyclic.

``paths`` maps each endogenous latent to the list of latents pointing into it. Depth-first search with a colour marking.

t_rule

t_rule(n_observed: 'int', n_free: 'int') -> 'bool'

Necessary condition: free parameters must not exceed observed moments.