jax.scipy.linalg.helmert#
- jax.scipy.linalg.helmert(n, full=False)[source]#
Construct a Helmert matrix.
JAX implementation of
scipy.linalg.helmert().The Helmert matrix has rows of orthonormal contrasts. For
k = 1, ..., n - 1, rowk - 1is \((\underbrace{1, \ldots, 1}_{k}, -k, 0, \ldots, 0) / \sqrt{k(k + 1)}\). IffullisTrue, a row of \(1 / \sqrt{n}\) is prepended.- Parameters:
- Returns:
A Helmert matrix of shape
(n - 1, n)iffullisFalse, or(n, n)iffullisTrue.- Return type:
Examples
>>> jax.scipy.linalg.helmert(2, full=True).round(3) Array([[ 0.707, 0.707], [ 0.707, -0.707]], dtype=float32)