Generate a Vandermonde matrix from a vector
stm_vander.Rd
stm_vander()
creates a Vandermonde matrix from a given vector. It
raises each element of the vector to the power of integers from 0 to
n-1
, where n
is the length of the vector. The user can
specify the number of columns in the matrix and whether the matrix should
be in increasing order.
Value
A matrix representing the Vandermonde matrix, either in the default
order or reversed if is_increasing = TRUE
.
Details
The function generates a Vandermonde matrix using the outer product, where
the elements of vec
are raised to successive powers from 0 to
n-1
. The user can specify the number of columns using the
ncols
parameter. The matrix can also be returned in increasing order
if is_increasing
is set to TRUE
.