varsel.Rd
Perform the projection predictive variable selection for generalized linear models using generic reference models.
varsel(object, d_test = NULL, method = NULL, ns = NULL, nc = NULL, nspred = NULL, ncpred = NULL, relax = NULL, nv_max = NULL, intercept = NULL, penalty = NULL, verbose = F, lambda_min_ratio = 1e05, nlambda = 150, thresh = 1e06, regul = 1e04, ...)
object  Either a 

d_test  A test dataset, which is used to evaluate model performance. If not provided, training data is used. Currently this argument is for internal use only. 
method  The method used in the variable selection. Possible options are

ns  Number of posterior draws used in the variable selection. Cannot be larger than the number of draws in the reference model. Ignored if nc is set. 
nc  Number of clusters to use in the clustered projection.
Overrides the 
nspred  Number of samples used for prediction (after selection). Ignored if ncpred is given. 
ncpred  Number of clusters used for prediction (after selection). Default is 5. 
relax  If TRUE, then the projected coefficients after L1selection are computed
without any penalization (or using only the regularization determined by 
nv_max  Maximum number of varibles until which the selection is continued. Defaults to min(20, D, floor(0.4*n)) where n is the number of observations and D the number of variables. 
intercept  Whether to use intercept in the submodels. Defaults to TRUE. 
penalty  Vector determining the relative penalties or costs for the variables. Zero means that those variables have no cost and will therefore be selected first, whereas Inf means that those variables will never be selected. Currently works only if method == 'L1'. By default 1 for each variable. 
verbose  If TRUE, may print out some information during the selection. Defaults to FALSE. 
lambda_min_ratio  Ratio between the smallest and largest lambda in the L1penalized search. This parameter essentially determines how long the search is carried out, i.e., how large submodels are explored. No need to change the default value unless the program gives a warning about this. 
nlambda  Number of values in the lambda grid for L1penalized search. No need to change unless the program gives a warning about this. 
thresh  Convergence threshold when computing L1path. Usually no need to change this. 
regul  Amount of regularization in the projection. Usually there is no need for regularization, but sometimes for some models the projection can be illbehaved and we need to add some regularization to avoid numerical problems. 
...  Additional arguments to be passed to the 
An object of type vsel
that contains information about the feature selection. The fields are not
meant to be accessed directly by the user but instead via the helper functions (see the vignettes or type ?projpred
to see the main functions in the package.)
### Usage with stanreg objects fit < stan_glm(y~x, binomial())#> Error in stan_glm(y ~ x, binomial()): could not find function "stan_glm"vs < varsel(fit)#> Error in get_refmodel(object, ...): object 'fit' not foundvarsel_plot(vs)#> Error in "vsel" %in% class(object): object 'vs' not found