scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
leslie(f, s)

Given the length n array of fecundity coefficients f and the length n-1 array of survival coefficients s, return the associated Leslie matrix.

Notes

versionadded

The Leslie matrix is used to model discrete-time, age-structured population growth . In a population with :None:None:`n` age classes, two sets of parameters define a Leslie matrix: the :None:None:`n` "fecundity coefficients", which give the number of offspring per-capita produced by each age class, and the :None:None:`n` - 1 "survival coefficients", which give the per-capita survival rate of each age class.

Parameters

f : (N,) array_like

The "fecundity" coefficients.

s : (N-1,) array_like

The "survival" coefficients, has to be 1-D. The length of s must be one less than the length of f, and it must be at least 1.

Returns

L : (N, N) ndarray

The array is zero except for the first row, which is f, and the first sub-diagonal, which is s. The data-type of the array will be the data-type of f[0]+s[0] .

Create a Leslie matrix.

Examples

>>> from scipy.linalg import leslie
... leslie([0.1, 2.0, 1.0, 0.1], [0.2, 0.8, 0.7]) array([[ 0.1, 2. , 1. , 0.1], [ 0.2, 0. , 0. , 0. ], [ 0. , 0.8, 0. , 0. ], [ 0. , 0. , 0.7, 0. ]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.linalg._special_matrices.leslie

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/linalg/_special_matrices.py#357
type: <class 'function'>
Commit: