scijs/ndarray-vandermonde

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ndarray-vandermonde

Build Status npm version

Construct an ndarray vandermonde matrix

Introduction

A Vandermonde matrix is a matrix with format:

Vandermonde

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.

Usage

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);
Credits

(c) 2015 Ricky Reusser. MIT License


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.