ajout des commentaires Roxygen - anglicisme de certains noms de fonctions et de variables
[valse.git] / R / selectionmodele.R
diff --git a/R/selectionmodele.R b/R/selectionmodele.R
deleted file mode 100644 (file)
index ed32731..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-vec_bin = function(X,r)
-{
-       Z = c()
-       indice = c()
-
-       j = 1
-       for(i in 1:length(X))
-       {
-               if(X[i] == r)
-               {
-                       Z[i] = 1
-                       indice[j] = i
-                       j=j+1
-               } else
-                       Z[i] = 0
-       }
-
-       return (list(Z=Z,indice=indice))
-}
-
-selectionmodele = function(vraisemblance)
-{
-       D = vraimsemblance[,2]
-       D1 = unique(D)
-
-       indice = 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, vraimsemblance[j,1])
-                       }
-                       b = max(a)
-                       #indice[i] : premier indice du vecteur binaire où u_i ==1
-                       indice[i] = which.max(vec_bin(vraimsemblance,b)[[1]])
-               }
-       }
-
-       return (list(indice=indice,D1=D1))
-}