R/getDtfSparse.R

Defines functions getDtfSparse

Documented in getDtfSparse

getDtfSparse <- function(n,ord) {
  D = bandSparse(n, m=n, c(0,1), diagonals=list(rep(-1,n),rep(1,n-1)))
  D0 = D
  for (i in Seq(1,ord)) D = D0 %*% D
  return(D[Seq(1,n-ord-1),,drop=FALSE])
}
glmgen/genlasso documentation built on Jan. 2, 2023, 7:01 a.m.