The function returns the Vandermode matrix of a numeric vector, x
, whose columns are the vector
raised to the powers 0:n
.
vandermode(x, n)
a numeric vector
a numeric scalar
a matrix of size length(x)
x n
vandermode(1:5, 4)
#> [,1] [,2] [,3] [,4]
#> [1,] 1 1 1 1
#> [2,] 1 2 4 8
#> [3,] 1 3 9 27
#> [4,] 1 4 16 64
#> [5,] 1 5 25 125