Name: ndarray-vandermonde
Owner: scijs
Description: Construct Vandermonde matrices with ndarrays
Created: 2015-05-04 11:36:11.0
Updated: 2015-05-10 03:46:48.0
Pushed: 2015-05-12 12:30:50.0
Homepage: null
Size: 152
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Construct an ndarray vandermonde matrix
A Vandermonde matrix is a matrix with format:
It's useful for least squares fits, among other things, in which you want a set of basis vectors that are successive powers of a variable evaluated at specific points. It's usually just plug and chug into QR or SVD in order to solve the least squares problem.
vander( x [, N] [, reversed] )
x
is a vector of numbers, N
is the width of the resulting matrix (i.e. the highest power + 1; the resulting matrix is square by default), and reversed
is a flag that will reverse the columns of the resulting matrix so that higher powers are on the left.
For example,
vander = require('ndarray-vandermonde'),
ndarray = require('ndarray');
x = ndarray(Float64Array([1,2,3,4]));
y = vander(x);
(c) 2015 Ricky Reusser. MIT License