Inputparametters.R + SelecModel
[valse.git] / InputParameters / gridLambda.R
1 gridLambda = function(phiInit, rhoInit, piInit, gamInit, X, Y, gamma, mini, maxi, tau){
2 n = nrow(X)
3 p = dimension(phiInit)[1]
4 m = dimension(phiInit)[2]
5 k = dimension(phiInit)[3]
6 list_EMG = EMGLLF(phiInit,rhoInit,piInit,gamInit,mini,maxi,1,0,X,Y,tau)
7 #.C("EMGLLF", phiInit = phiInit, rhoInit = rhoInit, ...)
8 phi = list_EMG[[1]]
9 rho = list_EMG[[2]]
10 pi = list_EMG[[3]]
11 S = list_EMG[[5]]
12
13 grid = array(0, dim=c(p,m,k))
14 for(i in 1:p){
15 for(j in 1:m){
16 grid[i,j,] = abs(S[i,j,]) / (n*pi^gamma)
17 }
18 }
19 grid = unique(grid)
20 grid = grid[grid <=1 ]
21
22 return(grid)
23 }
24
25
26 #test pour voir si formatage à la fin de grid ok
27 grid= array(mvrnorm(5*5*2,1,1), dim=c(5,5,2))
28 grid = unique(grid)
29 grid = grid[grid<= 1 ]