get_indices {CARRoT} | R Documentation |
Function which identifies regressions with the highest predictive power
get_indices(predsp,nvar,c,we,st,minx)
predsp |
An M x N matrix of averaged out predictive power values. M is maximum feasible number of variables included in a regression, N is the maximum feasible number of regressions of the fixed size; the row index indicates the number of variables included in a regression. |
nvar |
array of maximal number of variables for each cross-validation |
c |
array of all indices of the prediction variables |
we |
array of all weights of the prediction variables |
st |
a subset of predictors to be always included into a predictive model |
minx |
minimum number of predictors, defaults to 1 |
A list of arrays which contain indices of the predictors corresponfing to the best regressions
Uses sum_weights_sub
, find_sub
, combn
#creating a set of averaged out predictive powers
predsp<-matrix(NA,ncol=3,nrow=3)
predsp[1,]=runif(3,0.7,0.8)
predsp[2,]=runif(3,0.65,0.85)
predsp[3,1]=runif(1,0.4,0.5)
#running the function
get_indices(predsp,c(3,3,3),1:3,c(1,1,1))