Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.vander

Contents

jax.numpy.vander#

jax.numpy.vander(x,N=None,increasing=False)[source]#

Generate a Vandermonde matrix.

JAX implementation ofnumpy.vander().

Parameters:
  • x (ArrayLike) – input array. Must havex.ndim==1.

  • N (int |None) – int, optional, default=None. Specifies the number of the columns theoutput matrix. If not specified,N=len(x).

  • increasing (bool) – bool, optional, default=False. Specifies the order of the powersof the columns. IfTrue, the powers increase from left to right,\([x^0, x^1, ..., x^{(N-1)}]\). By default, the powers decrease from left toright\([x^{(N-1)}, ..., x^1, x^0]\).

Returns:

An array of shape[len(x),N] containing the generated Vandermonde matrix.

Return type:

Array

Examples

>>>x=jnp.array([1,2,3,4])>>>jnp.vander(x)Array([[ 1,  1,  1,  1],       [ 8,  4,  2,  1],       [27,  9,  3,  1],       [64, 16,  4,  1]], dtype=int32)

IfN=2, generates a Vandermonde matrix with2 columns.

>>>jnp.vander(x,N=2)Array([[1, 1],       [2, 1],       [3, 1],       [4, 1]], dtype=int32)

Generates the Vandermonde matrix in increasing order of powers, whenincreasing=True.

>>>jnp.vander(x,increasing=True)Array([[ 1,  1,  1,  1],       [ 1,  2,  4,  8],       [ 1,  3,  9, 27],       [ 1,  4, 16, 64]], dtype=int32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp