mushi.eta

class eta(change_points, y)[source]

Bases: mushi.histories.History

Demographic history \(\eta(t)\).

Parameters
  • change_points (ndarray) – epoch change points (times)

  • y (ndarray) – vector of constant population sizes in each epoch

Example

>>> import mushi
>>> import numpy as np
>>> eta = mushi.eta(np.array([1, 10, 100, 1000]),
...                 np.array([1000, 100, 100, 1000, 1000]))

Methods

arrays

Return time grid and values in each cell.

check_grid

Test if time grid is the same as another instance.

epochs

Generator yielding epochs as tuples: (start_time, end_time, value)

plot

Plot the history.

Attributes

y

read-only alias to vals attribute in base class.

property y

read-only alias to vals attribute in base class.

plot(**kwargs)[source]

Plot the history.

Parameters
  • t_gen – generation time in years (optional)

  • kwargs – key word arguments passed to plt.plot

Return type

None

arrays()

Return time grid and values in each cell.

check_grid(other)

Test if time grid is the same as another instance.

Parameters

other (History) – another History object

epochs()

Generator yielding epochs as tuples: (start_time, end_time, value)