R/assemble.hero_bspline.R

Defines functions assemble.hero_bspline

Documented in assemble.hero_bspline

#' @rdname assemble
#' @export
assemble.hero_bspline = function(object, x, m = 2,
                                 sparse = TRUE, ...) {
  nbasis = object$nbasis

  # penalty matrix
  P = Matrix::crossprod(diffpen(x = object, m = m, sparse = sparse))

  # design matrix
  B = predict(object, newx = x, sparse = sparse)

  # precompute stuff
  precompute(B, P, m = m)
}

Try the hero package in your browser

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

hero documentation built on July 26, 2023, 5:11 p.m.