Commit | Line | Data |
---|---|---|
35b42a4b B |
1 | vec_bin = function(X,r){ |
2 | Z = c() | |
3 | indice = c() | |
4 | j=1 | |
5 | for(i in 1:length(X)){ | |
6 | if(X[i] == r){ | |
7 | Z[i] = 1 | |
8 | indice[j] = i | |
9 | j=j+1 | |
10 | } | |
11 | else{ | |
12 | Z[i] = 0 | |
13 | } | |
14 | } | |
15 | return(list(Z,indice)) | |
16 | } | |
17 | ||
18 | selectionmodele = function(vraisemblance){ | |
19 | D = vraimsemblance[,2] | |
20 | D1 = unique(D) | |
21 | ||
22 | indice = rep(1, length(D1)) | |
23 | ||
24 | #select argmax MLE | |
25 | if(length(D1)>2){ | |
26 | for(i in 1:length(D1)){ | |
27 | A = c() | |
28 | for(j in 1:length(D)){ | |
29 | if(D[[j]]==D1[[i]]){ | |
30 | a = c(a, vraimsemblance[j,1]) | |
31 | } | |
32 | } | |
33 | b = max(a) | |
34 | Content-type: text/html