biogeme.latent_variables.latent_variables module¶
Latent-variable definitions and normalization utilities for structural equation models.
This module provides lightweight data structures used to define latent variables in Biogeme latent-variable models.
Normalizationdefines the anchor (indicator) and coefficient used to identify a latent variable.LatentVariablecombines a latent variable name, itsStructuralEquation, the related indicators, and the information required to build a JAX-compatible structural expression.
Michel Bierlaire Thu Dec 11 2025, 15:30:00
- class biogeme.latent_variables.latent_variables.LatentVariable(name, structural_equation, indicators, normalization, draw_type_jax=None, sigma_factory=None)[source]¶
Bases:
objectDefine a latent variable with its structural equation and metadata.
The structural equation is provided through a
StructuralEquation. For JAX-based computations, the complete expression (including the stochastic error term) can be obtained via :pyattr:`structural_equation_jax`.- Parameters:
name (
str) – Name of the latent variable.structural_equation (
StructuralEquation) – Structural equation specification (deterministic part and stochastic error term definition).indicators (
Iterable[str]) – Collection of indicator names linked to this latent variable.normalization (
Normalization) – Normalization information (anchor indicator and fixed coefficient).draw_type_jax (
str|None) – Identifier of the draw type used when constructing the stochastic error term for JAX (passed tostructural_equation.expression(draw_type=...)). If None, :pyattr:`structural_equation_jax` cannot be evaluated.sigma_factory (
SigmaFactory|None) – Factory used to create the strictly positive scale parameter of the stochastic error term. If None, :pyattr:`structural_equation_jax` cannot be evaluated.
-
draw_type_jax:
str|None= None¶
-
indicators:
Iterable[str]¶
-
name:
str¶
-
normalization:
Normalization¶
-
sigma_factory:
SigmaFactory|None= None¶
-
structural_equation:
StructuralEquation¶
- property structural_equation_jax: Expression¶
Return the full structural equation expression for JAX.
This property requires both
draw_type_jaxandsigma_factoryto be defined. It injectssigma_factoryinto the underlyingstructural_equationbefore callingstructural_equation.expression(draw_type=draw_type_jax).- Returns:
The complete structural equation expression including the stochastic error term.
- Raises:
ValueError – If
draw_type_jaxis not defined.ValueError – If
sigma_factoryis not defined.
- class biogeme.latent_variables.latent_variables.Normalization(indicator, coefficient)[source]¶
Bases:
objectNormalization information for a latent variable.
A normalization anchors a latent variable by fixing one measurement loading.
- Parameters:
indicator (
str) – Name of the indicator used as anchor for the normalization.coefficient (
float) – Numeric value of the fixed loading associated with the anchor indicator.
-
coefficient:
float¶
-
indicator:
str¶