gemlib.distributions.DiscreteTimeStateTransitionModel.compute_state

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) where T is the number of timesteps, N=self.num_units the number of units and R=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==False or (T+1, N, S) if include_final_state==True, where S=self.num_states, giving the number of individuals in each state at each time point for each unit.

Return type:

Array