prepare structure for R package
[valse.git] / R / selectionmodele.R
Content-type: text/html git.auder.net Git - valse.git/blame - R/selectionmodele.R


500 - Internal Server Error

Malformed UTF-8 character (fatal) at (eval 6) line 1, <$fd> line 78.
CommitLineData
35b42a4b
B
1vec_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
18selectionmodele = 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