tensor.prod.X: tensor model matrix

tensor.prod.XR Documentation

tensor model matrix

Description

Computes the model matrix of tensor product smooth from the marginal bases.

Usage

tensor.prod.X(X)

Arguments

X

list of m design matrices with n rows and p1, p2, ... pm columns respectively

Value

T

Matrix of dimensions n*(p1*p2*...*pm) representing the row tensor product of the matrices in X

Examples


library(survPen)

# row-wise tensor product between three design matrices
set.seed(15)

X1 <- matrix(rnorm(10*3),nrow=10,ncol=3)
X2 <- matrix(rnorm(10*2),nrow=10,ncol=2)
X3 <- matrix(rnorm(10*2),nrow=10,ncol=2)
tensor.prod.X(list(X1,X2,X3))


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