This function picks the solution along the solution path based on a pre-specified number of covariates
Usage
Number_Pick(
y_vec,
x_mat,
solution_path,
real_logit_vec,
kn,
given_number = 5,
upper_bound = TRUE
)
Arguments
- y_vec
response vector, 0 for control, 1 for case. n = length(y_vec) is the number of observations.
- x_mat
covariate matrix, consists of two parts. dim(x_mat) = (n, h + p * kn) First h columns are for demographical covariates(can include an intercept term) Rest columns are for p functional covariates, each being represented by a set of basis functions resulting kn covariates.
- solution_path
A solution path from function
Logistic_FAR_Path
- real_logit_vec
NOT used in this function
- kn
number of basis functions.(This is also number of covariates in each group)
- given_number
A pre-specified number. This function will pick the
given_number
of functional covariates which enter the solution path first.- upper_bound
Logical, default to
TRUE
. Whether thegiven_number
is a strict upper bound. IfTRUE
, the picked model will have number of active functional covariates closest to it and never exceeds it.