myGetDkn computes the kth order differencing matrix for use in trend filtering regression

myGetDkn(k, n)

Arguments

k

Order of the differencing matrix

n

Number of time points

Value

Returns a Matrix object as the kth order differencing matrix