tensor.prod.S: Tensor product for penalty matrices

tensor.prod.SR Documentation

Tensor product for penalty matrices

Description

Computes the penalty matrices of a tensor product smooth from the marginal penalty matrices. The code is from function tensor.prod.penalties in mgcv package.

Usage

tensor.prod.S(S)

Arguments

S

list of m marginal penalty matrices

Value

TS

List of the penalty matrices associated with the tensor product smooth

Examples


library(survPen)

# tensor product between three penalty matrices
set.seed(15)

S1 <- matrix(rnorm(3*3),nrow=3,ncol=3)
S2 <- matrix(rnorm(2*2),nrow=2,ncol=2)

S1 <- 0.5*(S1 + t(S1) ) ; S2 <- 0.5*(S2 + t(S2) )

tensor.prod.S(list(S1,S2))


survPen documentation built on Sept. 14, 2023, 1:06 a.m.