R/get_block_penalty.R

Defines functions get_block_penalty

#' @importFrom spam bdiag.spam
# utility to calculate the block diagonal penalty matrices for spline penalisation

get_block_penalty<-function(P, blockzero, i){        
  blockzero[[i]] <- P
  b.diag         <- function(L){
    diag.spam <- L[[1]]
    for(j in 2:length(L)){
      diag.spam <- bdiag.spam(diag.spam, L[[j]])
    }
    diag.spam
  }
  b.diag(blockzero)
}	

Try the smnet package in your browser

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

smnet documentation built on Nov. 9, 2020, 9:06 a.m.