get_diff_mat: Construct a difference matrix

Description Usage Arguments Details Value

View source: R/helper-ridge.R

Description

get_diff_mat returns a difference matrix of an arbitrary order and size.

Usage

1
get_diff_mat(size, k)

Arguments

size

the column size of the difference matrix. Required.

k

the order of difference. Required.

Details

This function returns a k^{th} order difference matrix D, such that Dx gives a vector of k^{th} order differences of x. The parameter size is usually the dimension of x.

Value

A size - k by size matrix.


weiyaw/flexss documentation built on June 16, 2021, 7:48 a.m.