Processes the tmbdat
object for a specific dataset, using the provided smoothing variables,
standard errors, and precision matrix. This function generates spline basis matrices,
penalty matrices, and other quantities required for modeling.
fash_set_tmbdat(
data_i,
Si = NULL,
Omegai = NULL,
num_basis = 30,
betaprec = 1e-06,
order = 2
)
A single dataset extracted from the data_list
component of fash_set_data
.
Must be a list containing y
, x
, and offset
.
A numeric vector representing the standard errors for the dataset.
A numeric precision matrix for the dataset.
An integer specifying the number of O-Spline basis functions to use for the approximation.
A numeric value representing the precision of the fixed effects coefficients.
An integer specifying the order of the Integrated Wiener Process (IWP) prior.
A list formatted as a tmbdat
object, containing:
A numeric vector of response variables for the dataset.
A sparse matrix representing the design matrix for fixed effects.
A sparse matrix representing the penalty matrix for the spline coefficients.
A sparse matrix representing the design matrix for random effects.
A numeric vector of offsets for the dataset.
The log determinant of the penalty matrix.
The precision for the fixed effects coefficients.
The standard errors for the dataset, if provided as Si
.
The precision matrix for the dataset as a sparse matrix, if provided as Omegai
.
The log determinant of the precision matrix, if Omegai
is provided.
# Example usage
set.seed(1)
Y <- matrix(rnorm(20), nrow = 4, ncol = 5)
smooth_var <- matrix(runif(20), nrow = 4, ncol = 5)
offset <- 1
S <- c(0.5, 0.8, 1.2, 1.0, 0.9)
Omega <- diag(5)
data <- fash_set_data(Y, smooth_var, offset, S, Omega)
tmbdat <- fash_set_tmbdat(data$data_list[[1]], Si = S[[1]], Omegai = Omega)