X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=R%2FmodelSelection.R;h=86e2efd563829e9474b6769a03a76803b907be16;hb=31ef8a5c9bbaefcf40d2c2bad43b27d469c28c34;hp=bc7eeaeda3d6732426dc8f6cfabb28e7b88711f2;hpb=e166ed4e1370aa7961f0d8609936591cfc6808cc;p=valse.git diff --git a/R/modelSelection.R b/R/modelSelection.R index bc7eeae..86e2efd 100644 --- a/R/modelSelection.R +++ b/R/modelSelection.R @@ -1,11 +1,11 @@ #' Among a collection of models, this function constructs a subcollection of models with -#' models having strictly different dimensions, keeping the model which minimizes +#' models having strictly different dimensions, keeping the model which minimizes #' the likelihood if there were several with the same dimension #' #' @param LLF a matrix, the first column corresponds to likelihoods for several models #' the second column corresponds to the dimensions of the corresponding models. #' -#' @return a list with indices, a vector of indices selected models, +#' @return a list with indices, a vector of indices selected models, #' and D1, a vector of corresponding dimensions #' @export #' @@ -28,9 +28,13 @@ modelSelection = function(LLF) } b = max(a) #indices[i] : first indices of the binary vector where u_i ==1 - indices[i] = which.max(vec_bin(LLF,b)[[1]]) + indices[i] = which.max(LLF == b) } } return (list(indices=indices,D1=D1)) } + +#TODO: +## Programme qui sélectionne un modèle +## proposer à l'utilisation différents critères (BIC, AIC, slope heuristic)