init_params_additive | R Documentation |
Initialize the parameters for an additive model, which may contain both linear and nonlinear predictors. The nonlinear terms are modeled using orthogonalized splines.
init_params_additive(y, X_lin, X_nonlin, B_all = NULL)
y |
|
X_lin |
|
X_nonlin |
|
B_all |
optional |
a named list params
containing
mu
: vector of conditional means (fitted values)
sigma
: the conditional standard deviation
coefficients
: a named list of parameters that determine mu
The parameters in coefficients
are:
beta
: the p x 1
linear coefficients, including the linear terms from X_nonlin
f_j
: the n x pNL
matrix of fitted values for each nonlinear function
theta_j
: the pNL
-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
# Simulate data for illustration:
sim_dat = simulate_nb_friedman(n = 100, p = 5)
y = sim_dat$y; X = sim_dat$X
# Linear and nonlinear components:
X_lin = as.matrix(X[,-(1:3)])
X_nonlin = as.matrix(X[,(1:3)])
# Initialize:
params = init_params_additive(y = y,
X_lin = X_lin,
X_nonlin = X_nonlin)
names(params)
names(params$coefficients)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.