Build a Vandermonde matrix from a vector of samples.
Numeric.create.vander(samples, degree = samples.length, increasing = false)Builds a Vandermonde matrix from the samples.
- Parameters:
samples: Sample values used as the matrix rowsdegree: Highest power generated for each rowincreasing: When true orders powers from low to high
- Returns: Vandermonde matrix
- NumPy: Equivalent to
np.vander.
import Numeric from '@neabyte/numerix'
const matrix = Numeric.create.vander([1, 2, 3], 2)
console.log(matrix)
// [[1,1],[2,1],[3,1]]import Numeric from '@neabyte/numerix'
const matrix = Numeric.create.vander([1, 2, 3], 2, true)
console.log(matrix)
// [[1,1],[1,2],[1,3]]import Numeric from '@neabyte/numerix'
const matrix = Numeric.create.vander([1, 2], 3)
console.log(matrix)
// [[1,1,1],[4,2,1]]import Numeric from '@neabyte/numerix'
const matrix = Numeric.create.vander([2], 2)
console.log(matrix)
// [[2,1]]