econirl.Trajectory
- class econirl.Trajectory(states, actions, next_states, individual_id=None, metadata=<factory>)[source]
Bases:
objectA single individual’s observed decision trajectory.
Represents the sequence of states, actions, and next states observed for one decision-maker over time. This is the fundamental unit of observation in dynamic discrete choice estimation.
- Variables:
states (jax.jaxlib._jax.Array) – Array of shape (T,) containing state indices at each period
actions (jax.jaxlib._jax.Array) – Array of shape (T,) containing chosen action at each period
next_states (jax.jaxlib._jax.Array) – Array of shape (T,) containing state after transition
individual_id (str | int | None) – Optional identifier for the individual
metadata (dict[str, Any]) – Optional dictionary for additional trajectory-level data
- Parameters:
Example
>>> traj = Trajectory( ... states=jnp.array([0, 5, 12, 18]), ... actions=jnp.array([0, 0, 0, 1]), ... next_states=jnp.array([5, 12, 18, 0]), ... individual_id="bus_001" ... )
- states: Array
- actions: Array
- next_states: Array