R: cosmetics + start translation of (selmix.m into) main.R
[valse.git] / R / gridLambda.R
1 gridLambda = function(phiInit, rhoInit, piInit, gamInit, X, Y, gamma, mini, maxi, tau)
2 {
3 n = nrow(X)
4 p = dim(phiInit)[1]
5 m = dim(phiInit)[2]
6 k = dim(phiInit)[3]
7
8 list_EMG = .Call("EMGLLF",phiInit,rhoInit,piInit,gamInit,mini,maxi,1,0,X,Y,tau)
9
10 grid = array(0, dim=c(p,m,k))
11 for (i in 1:p)
12 {
13 for (j in 1:m)
14 grid[i,j,] = abs(list_EMG$S[i,j,]) / (n*list_EMG$pi^gamma)
15 }
16 grid = unique(grid)
17 grid = grid[grid <=1]
18
19 return(grid)
20 }