{ } Raw JSON

bundles / scipy 1.17.1 / scipy / linalg / _special_matrices / invpascal

function

scipy.linalg._special_matrices:invpascal

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

Signature

def   invpascal ( n kind = symmetric exact = True )

Summary

Returns the inverse of the n x n Pascal matrix.

Extended Summary

The Pascal matrix is a matrix containing the binomial coefficients as its elements.

Parameters

n : int

The size of the matrix to create; that is, the result is an n x n matrix.

kind : str, optional

Must be one of 'symmetric', 'lower', or 'upper'. Default is 'symmetric'.

exact : bool, optional

If exact is True, the result is either an array of type numpy.int64 (if n <= 35) or an object array of Python integers. If exact is False, the coefficients in the matrix are computed using scipy.special.comb with exact=False. The result will be a floating point array, and for large n, the values in the array will not be the exact coefficients.

Returns

invp : (n, n) ndarray

The inverse of the Pascal matrix.

Notes

Examples

from scipy.linalg import invpascal, pascal
invp = invpascal(5)
invp
p = pascal(5)
p.dot(invp)
An example of the use of `kind` and `exact`:
invpascal(5, kind='lower', exact=False)

See also

pascal

Aliases

  • scipy.linalg.invpascal

Referenced by

This package