fix valse pkg functions callings in src/test/generate
[valse.git] / src / test / generate_test_data / generateRunSaveTest_selectiontotale.R
CommitLineData
f1b906da
BG
1generateRunSaveTest_selectiontotale= function(n=200, p=15, m=10, k=3, mini=5, maxi=10, gamma=1.0, 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)){
2 testFolder = "data/"
3 dir.create(testFolder, showWarnings=FALSE, mode="0755")
4 delimiter = " "
5
9ade3f1b
BA
6 require(valse)
7
f1b906da 8 #Generate phiInit,piInit,...
9ade3f1b 9 params = valse:::basic_Init_Parameters(n, p, m, k)
f1b906da
BG
10
11 #Generate X and Y
9ade3f1b 12 generateIOdef = valse:::generateIOdefault(n, p, m, k)
f1b906da
BG
13
14 #save inputs
15 write.table(paste(testFolder,"phiInit",sep=""), params$phiInit, sep=delimiter)
16 write.table(paste(testFolder,"rhoInit",sep=""), params$rhoInit, sep=delimiter)
17 write.table(paste(testFolder,"piInit",sep=""), params$piInit, sep=delimiter)
18 write.table(paste(testFolder,"gamInit",sep=""), params$gamInit, sep=delimiter)
19 write.table(paste(testFolder,"mini",sep=""), mini, sep=delimiter)
20 write.table(paste(testFolder,"maxi",sep=""), maxi, sep=delimiter)
21 write.table(paste(testFolder,"gamma",sep=""), gamma, sep=delimiter)
22 write.table(paste(testFolder,"lambda",sep=""), glambda, sep=delimiter)
23 write.table(paste(testFolder,"X",sep=""), io$X, sep=delimiter)
24 write.table(paste(testFolder,"Y",sep=""), io$Y, sep=delimiter)
25 write.table(paste(testFolder,"tau",sep=""), tau, sep=delimiter)
26 write.table(paste(testFolder,"dimensions",sep=""), c(n,p,m,k), sep=delimiter)
27
28
29 selec = selectiontotale(params$phiInit,params$rhoInit,params$piInit,params$gamInit,mini,maxi,gamma,glambda,generateIOdef$X,generateIOdef$Y,seuil, tau)
30
31 #save output
32 write.table(paste(testFolder,"A1",sep=""), selec$A1, sep=delimiter)
33 write.table(paste(testFolder,"A2",sep=""), selec$A2, sep=delimiter)
34 write.table(paste(testFolder,"rho",sep=""), selec$rho, sep=delimiter)
35 write.table(paste(testFolder,"pi",sep=""), selec$pi, sep=delimiter)
36}