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])
}

Try the genlasso package in your browser

Any scripts or data that you put into this service are public.

genlasso documentation built on Aug. 22, 2022, 9:09 a.m.