gemlib.distributions.DiscreteTimeStateTransitionModel.compute_state#
- DiscreteTimeStateTransitionModel.compute_state(events, include_final_state=False)#
Computes a state timeseries from a sequence of transition events.
- Parameters:
events (Array) – an array of events of shape
(T,N,R)whereTis the number of timesteps,N=self.num_unitsthe number of units andR=self.incidence_matrix.shape[0]the number of transitions.include_final_state (bool) – If
False(default) the result does not include the final state. Otherwise the result includes the final state.
- Returns:
- An array of shape
(T, N, S)if include_final_state==Falseor(T+1, N, S)ifinclude_final_state==True, whereS=self.num_states, giving the number of individuals in each state at each time point for each unit.
- An array of shape
- Return type:
Array