{ } Raw JSON

bundles / scipy 1.18.0 / scipy / linalg / _special_matrices / helmert

function

scipy.linalg._special_matrices:helmert

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

Signature

def helmert(n, full = False)

Summary

Create a Helmert matrix of order n.

Extended Summary

This has applications in statistics, compositional or simplicial analysis, and in Aitchison geometry.

Parameters

n : int

The size of the array to create.

full : bool, optional

If True the (n, n) ndarray will be returned. Otherwise the submatrix that does not include the first row will be returned. Default: False.

Returns

M : ndarray

The Helmert matrix. The shape is (n, n) or (n-1, n) depending on the full argument.

Examples

from scipy.linalg import helmert
✓
helmert(5, full=True)
✗
array([[ 0.45,  0.45,  0.45,  0.45,  0.45],
       [ 0.71, -0.71,  0.  ,  0.  ,  0.  ],
       [ 0.41,  0.41, -0.82,  0.  ,  0.  ],
       [ 0.29,  0.29,  0.29, -0.87,  0.  ],
       [ 0.22,  0.22,  0.22,  0.22, -0.89]])

Aliases

  • scipy.linalg.helmert