coef.GIC.FuncompCGL: Extract model estimated coefficients from a...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/tools.R

Description

This function gets coefficients from a "GIC.FuncompCGL" object, using the stored "FuncompCGL.fit" object, and the optimal values of lam and k.

Usage

1
2
## S3 method for class 'GIC.FuncompCGL'
coef(object, s = "lam.min", k = NULL, ...)

Arguments

object

fitted GIC.FuncompCGL object.

s

value(s) of the regularization parameter lam at which coefficients are requested.

  • s="lam.min" (default), grid value of lam and k stored in "GIC.FuncompCGL" object such that the minimun value of GIC is achieved.

  • If s is numeric, it is taken as the value(s) of lam to be used. In this case, k must be provided.

  • If s = NULL, used the whole sequence of lam stored in the GIC.FuncompCGL object.

k

value(s) of degrees of freedom of the basis function at which coefficents are requested. k can be NULL (default) or integer(s).

  • k = NULL, s must be "lam.min".

  • if k is integer(s), it is taken as the value of k to be used and it must be one(s) of these in "GIC.FuncompCGL" model.

...

not used.

Details

s is a vector of lambda values at which the coefficients are requested. If s is not in the lam sequence used for fitting the model, the coef function will use linear interpolation, so the function should be used with caution.

Value

The coefficients at the requested tuning parameter values in s.

Author(s)

Zhe Sun and Kun Chen

References

Sun, Z., Xu, W., Cong, X., Li G. and Chen K. (2020) Log-contrast regression with functional compositional predictors: linking preterm infant's gut microbiome trajectories to neurobehavioral outcome, https://arxiv.org/abs/1808.02403 Annals of Applied Statistics

See Also

GIC.FuncompCGL and FuncompCGL, and predict and plot methods for "GIC.FuncompCGL" object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
df_beta = 5
p = 30
beta_C_true = matrix(0, nrow = p, ncol = df_beta)
beta_C_true[1, ] <- c(-0.5, -0.5, -0.5 , -1, -1)
beta_C_true[2, ] <- c(0.8, 0.8,  0.7,  0.6,  0.6)
beta_C_true[3, ] <- c(-0.8, -0.8 , 0.4 , 1 , 1)
beta_C_true[4, ] <- c(0.5, 0.5, -0.6  ,-0.6, -0.6)
n = 50
k_list <- c(4,5)
Data <- Fcomp_Model(n = n, p = p, m = 0, intercept = TRUE,
                    SNR = 4, sigma = 3, rho_X = 0.6, rho_T = 0,
                    df_beta = df_beta, n_T = 20, obs_spar = 1, theta.add = FALSE,
                    beta_C = as.vector(t(beta_C_true)))

GIC_m1 <-  GIC.FuncompCGL(y = Data$data$y, X = Data$data$Comp,
                          Zc = Data$data$Zc, intercept = Data$data$intercept,
                          k = k_list)
coef(GIC_m1)
coef(GIC_m1, s = c(0.05, 0.01), k = c(4,5))
coef(GIC_m1, s = NULL, k = c(4,5))

jiji6454/compReg documentation built on Feb. 5, 2021, 2:20 p.m.