scipy.linalg.leslie

scipy.linalg.leslie(f, s)

Create a Leslie matrix.

Parameters :

f : array-like, 1D

The “fecundity” coefficients.

s : array-like, 1D

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 : ndarray, 2D

Returns a 2D numpy ndarray with shape (n,n), where n is the length of f. The array is zero except for the first row, which is f, and the first subdiagonal, which is s. The data type of the array will be the data type of f[0]+s[0].

Notes

New in version 0.8.0.

Examples

>>> 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. ]])

Previous topic

scipy.linalg.kron

Next topic

scipy.linalg.toeplitz

This Page