@jit(nopython=True)
def _generate_sample_paths(P_cdfs, init_states, random_values, out):
 (num_reps, ts_length) = out.shape
 for i in range(num_reps):
  out[(i, 0)] = init_states[i]
  for t in range((ts_length - 1)):
   out[(i, (t + 1))] = searchsorted(P_cdfs[out[(i, t)]], random_values[(i, t)])

@ jit ( nopython = True ) def _generate_sample_paths ( P_cdfs , init_states , random_values , out ) : ( num_reps , ts_length ) = out . shape for i in range ( num_reps ) : out [ ( i , 0 ) ] = init_states [ i ] for t in range ( ( ts_length - 1 ) ) : out [ ( i , ( t + 1 ) ) ] = searchsorted ( P_cdfs [ out [ ( i , t ) ] ] , random_values [ ( i , t ) ] )
generate num_reps sample paths of length ts_length .