fix generateRunTest for constructionModelesEMGrank; remove man pages (will be roxygen...
[valse.git] / src / test / generate_test_data / generateRunSaveTest_selectiontotale.R
CommitLineData
c3bc4705
BA
1generateRunSaveTest_selectiontotale= function(n=200, p=15, m=10, k=3, mini=5, maxi=10, gamma=1.0,
2 glambda=list(0.0,0.01,0.02,0.03,0.05,0.1,0.2,0.3,0.5,0.7,0.85,0.99))
3{
ef67d338
BA
4 tau = 1e-6;
5 seuil = 1e-15;
c3bc4705 6 require(valse)
ef67d338
BA
7 params = valse:::basicInitParameters(n, p, m, k)
8 xy = valse:::generateXYdefault(n, p, m, k)
9 L = length(glambda)
c3bc4705 10
ef67d338
BA
11 testFolder = "data/"
12 dir.create(testFolder, showWarnings=FALSE, mode="0755")
f1b906da 13 #save inputs
c3bc4705
BA
14 write.table(as.double(params$phiInit), paste(testFolder,"phiInit",sep=""),
15 row.names=F, col.names=F)
16 write.table(as.double(params$rhoInit), paste(testFolder,"rhoInit",sep=""),
17 row.names=F, col.names=F)
18 write.table(as.double(params$piInit), paste(testFolder,"piInit",sep=""),
19 row.names=F, col.names=F)
20 write.table(as.double(params$gamInit), paste(testFolder,"gamInit",sep=""),
21 row.names=F, col.names=F)
22 write.table(as.integer(mini), paste(testFolder,"mini",sep=""),
23 row.names=F, col.names=F)
24 write.table(as.integer(maxi), paste(testFolder,"maxi",sep=""),
25 row.names=F, col.names=F)
26 write.table(as.double(gamma), paste(testFolder,"gamma",sep=""),
27 row.names=F, col.names=F)
28 write.table(as.double(glambda), paste(testFolder,"lambda",sep=""),
29 row.names=F, col.names=F)
ef67d338
BA
30 write.table(as.double(xy$X), paste(testFolder,"X",sep=""),
31 row.names=F, col.names=F)
32 write.table(as.double(xy$Y), paste(testFolder,"Y",sep=""),
c3bc4705 33 row.names=F, col.names=F)
ef67d338 34 write.table(as.double(seuil), paste(testFolder,"seuil",sep=""),
c3bc4705
BA
35 row.names=F, col.names=F)
36 write.table(as.double(tau), paste(testFolder,"tau",sep=""),
37 row.names=F, col.names=F)
ef67d338 38 write.table(as.integer(c(n,p,m,k,L)), paste(testFolder,"dimensions",sep=""),
c3bc4705
BA
39 row.names=F, col.names=F)
40
41 res = selectiontotale(params$phiInit,params$rhoInit,params$piInit,params$gamInit,
ef67d338 42 mini,maxi,gamma,glambda,xy$X,xy$Y,seuil, tau)
c3bc4705 43
f1b906da 44 #save output
c3bc4705
BA
45 write.table(as.double(res$A1), paste(testFolder,"A1",sep=""), row.names=F, col.names=F)
46 write.table(as.double(res$A2), paste(testFolder,"A2",sep=""), row.names=F, col.names=F)
47 write.table(as.double(res$rho), paste(testFolder,"rho",sep=""), row.names=F, col.names=F)
48 write.table(as.double(res$pi), paste(testFolder,"pi",sep=""), row.names=F, col.names=F)
f1b906da 49}