jax.scipy.linalg.leslie#
- jax.scipy.linalg.leslie(f, s)[source]#
Construct a Leslie matrix.
JAX implementation of
scipy.linalg.leslie().Given fecundity coefficients
fof shape(..., N)and survival coefficientssof shape(..., N - 1), the Leslie matrix hasfas its first row,salong its first sub-diagonal, and zeros elsewhere.- Parameters:
f (ArrayLike) – array of shape
(..., N)withN >= 2containing the fecundity coefficients.s (ArrayLike) – array of shape
(..., N - 1)containing the survival coefficients.
- Returns:
A Leslie matrix of shape
(..., N, N).- Return type:
Examples
>>> jax.scipy.linalg.leslie(jnp.array([0.1, 2.0, 1.0, 0.1]), ... jnp.array([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. ]], dtype=float32)