stack_trajectories()

stack_trajectories()#

static DiscreteModel.stack_trajectories(statelist, inputlist=None)[source]#

Translate a collection of state trajectories and (optionally) inputs to arrays that are appropriate arguments for fit().

Parameters:
statelistlist of s (r, k_i) ndarrays

Collection of state trajectories.

inputlistlist of s (m, k_i) ndarrays

Collection of inputs corresponding to the state trajectories.

Returns:
states(r, sum_i(k_i)) ndarray

Snapshot matrix with data from all but the final snapshot of each trajectory in statelist.

nextstates(r, sum_i(k_i)) ndarray

Snapshot matrix with data from all but the first snapshot of each trajectory in statelist.

inputs(r, sum_i(k_i)) ndarray

Input matrix with data from all but the last input for each trajectory. Only returned if inputlist is provided.