sample_bam_orthog {countSTAR} | R Documentation |
Sample the parameters for an additive model
Description
Sample the parameters for an additive model, which may contain both linear and nonlinear predictors. The nonlinear terms are modeled using orthogonalized splines. The sampler draws the linear terms jointly and then samples each vector of nonlinear coefficients using Bayesian backfitting (i.e., conditional on all other nonlinear and linear terms).
Usage
sample_bam_orthog(
y,
X_lin,
X_nonlin,
params,
A = 10^4,
B_all = NULL,
diagBtB_all = NULL,
XtX = NULL
)
Arguments
y |
|
X_lin |
|
X_nonlin |
|
params |
the named list of parameters containing
|
A |
the prior scale for |
B_all |
optional |
diagBtB_all |
optional |
XtX |
optional |
Value
The updated named list params
with draws from the full conditional distributions
of sigma
and coefficients
(and updated mu
).
Note
The parameters in coefficients
are:
-
beta_lin
: thep x 1
linear coefficients, including the linear terms fromX_nonlin
-
f_j
: then x pNL
matrix of fitted values for each nonlinear function -
theta_j
: thepNL
-dimensional of nonlinear basis coefficients -
sigma_beta
:p x 1
vector of linear regression coefficient standard deviations -
sigma_theta_j
:pNL x 1
vector of nonlinear coefficient standard deviations