{ } Raw JSON

bundles / scipy latest / scipy / linalg / _special_matrices / leslie

function

scipy.linalg._special_matrices:leslie

source: /scipy/linalg/_special_matrices.py :287

Signature

def   leslie ( f s )

Summary

Create a Leslie matrix.

Extended Summary

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

The documentation is written assuming array arguments are of specified "core" shapes. However, array argument(s) of this function may have additional "batch" dimensions prepended to the core shape. In this case, the array is treated as a batch of lower-dimensional slices; see linalg_batch for details.

The documentation is written assuming array arguments are of specified "core" shapes. However, array argument(s) of this function may have additional "batch" dimensions prepended to the core shape. In this case, the array is treated as a batch of lower-dimensional slices; see linalg_batch for details. Note that calls with zero-size batches are unsupported and will raise a ValueError.

Parameters

f : (N,) array_like

The "fecundity" coefficients.

s : (N-1,) array_like

The "survival" coefficients. 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].

Notes

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

Examples

from scipy.linalg import leslie
leslie([0.1, 2.0, 1.0, 0.1], [0.2, 0.8, 0.7])

Aliases

  • scipy.linalg.leslie

Referenced by

This package