multi_locus_analysis.finite_window.stats

multi_locus_analysis.finite_window.stats.average_lifetime(obs, traj_cols=['replicate'])[source]

Estimate the true means of each state of the process.

Doesn’t require removing any censoring, because the process is stationary.

multi_locus_analysis.finite_window.stats.ecdf_simple(waits, T, pad_left_at_x=0)[source]

cdf of interior times (ts > 0) observed in window of size T

multi_locus_analysis.finite_window.stats.ecdf_windowed(times, window_sizes, window_sf=None, times_allowed=None, auto_pad_left=None, pad_left_at_x=0, normalize=True, skip_times_allowed_check=False)[source]

Empirical cumulative distribution for windowed observations.

Parameters
  • times ((N,) array_like) – “Interior” waiting times.

  • window_sizes (float or (N,) array_like) – The window size used. If a single value is passed, the window size is assumed to be constant.

  • times_allowed ((M,) array_like) – Unique values that the data can take. Mostly useful for adding eCDF values at locations where data could or should have been observed but none was recorded (e.g. if a movie was taken with a given framerate but not all possible window lengths were observed).

  • auto_pad_left (bool) – Deprecated. It makes more sense to default to left padding at zero for a renewal process. If left False, the data will not have a data value at the point where the eCDF equals zero. Use mean inter-data spacing to automatically generate an aesthetically reasonable such point. You must pass pad_left_at_x=False manually for this to work as expected.

  • pad_left_at_x (float, default: 0) – Same as auto_pad_left, but specify the point at which to add the leftmost point.

  • window_sf ((M,) array_like of float) – For each unique window size in window_sizes, the number of trajectories with at least that window size. If not specified, it is assumed that each unique value of window size correponds to a unique trajectory. For the case of constant window size, this option is ignored.

Returns

  • x ((M,) array_like) – The values at which the eCDF was computed. By default np.sort(np.unique(y)).

  • cdf ((M,) array_like) – Values of the eCDF at each x.

Notes

If using times_allowed, the pad_left parameters are redundant.