#' the likelihood if there were several with the same dimension
#'
#' @param LLF a matrix, the first column corresponds to likelihoods for several models
#' the likelihood if there were several with the same dimension
#'
#' @param LLF a matrix, the first column corresponds to likelihoods for several models
- D = LLF[,2]
- D1 = unique(D)
-
- indices = rep(1, length(D1))
- #select argmax MLE
- if (length(D1)>2)
- {
- for (i in 1:length(D1))
- {
- A = c()
- for (j in 1:length(D))
- {
- if(D[[j]]==D1[[i]])
- a = c(a, LLF[j,1])
- }
- b = max(a)
- #indices[i] : first indices of the binary vector where u_i ==1
- indices[i] = which.max(vec_bin(LLF,b)[[1]])
- }
- }
-
- return (list(indices=indices,D1=D1))
+ D = LLF[,2]
+ D1 = unique(D)
+
+ indices = rep(1, length(D1))
+ #select argmax MLE
+ if (length(D1)>2)
+ {
+ for (i in 1:length(D1))
+ {
+ A = c()
+ for (j in 1:length(D))
+ {
+ if(D[[j]]==D1[[i]])
+ a = c(a, LLF[j,1])
+ }
+ b = max(a)
+ #indices[i] : first indices of the binary vector where u_i ==1
+ indices[i] = which.max(vec_bin(LLF,b)[[1]])
+ }
+ }
+
+ return (list(indices=indices,D1=D1))