genD: Generate D Matrix

Description Usage Arguments Details Value Author(s) References Examples

Description

Generate D matrix which is used to do polynomial trend filtering of order k

Usage

1
2
3
genDtf1d(k,n=NULL,full=FALSE)
genDtf2d(k,dim1=NULL,dim2=NULL,full=FALSE)
genD2d(dim1=NULL,dim2=NULL,full=FALSE)

Arguments

k

The order of polynomial trend filtering.

n

Length of observe sequence y for genDtf1d, only be used in the full mode.

dim1

The number of rows for genDtf2d, only be used in the full mode.

dim2

The number of columns for genDtf2d, only be used in the full mode.

full

Whether to return the full matrix, if TRUE, it gennerate a full matrix.

Details

In 1d case, D is used to do polynomial trend filtering of order k, and generated by

D_{tf,k} = D1d * D_{tf,k-1} for k >= 2,

where the nozero elements in each row is (1,-2,1) in D_tf,1 and (-1,1) in D_1d. This is usually not necessary to call directly, as AMIAS internally gennerate D, but inspection of the matrix can sometimes be useful.

Value

vecctor

Vector: return when full is FALSE, nozero elements in first row(equal to any other row) of D.

matrix

Matrix: return when full is TRUE, whole sparse D.

Author(s)

Canhong Wen, Xueqin Wang, Shijie Quan, Zelin Hong and Aijun Zhang.

Maintainer: Canhong Wen <wench@ustc.edu.cn>

References

Wen, C., Zhu, J., Wang, X., and Zhang, A. (2019) L0 trend filtering, technique report.

Examples

1
2
  genDtf1d(k = 2)
  genDtf1d(k = 1, n = 10, full = TRUE)

AMIAS documentation built on May 2, 2019, 2:10 a.m.

Related to genD in AMIAS...