X-Git-Url: https://git.auder.net/?p=valse.git;a=blobdiff_plain;f=R%2FbasicInitParameters.R;fp=R%2FbasicInitParameters.R;h=0000000000000000000000000000000000000000;hp=3583e6829ab721e14b43ab1be4687635a55ec0db;hb=ef67d338c7f28ba041abe40ca9a8ab69f8365a90;hpb=c3bc47052f3ccb659659c59a82e9a99ea842398d diff --git a/R/basicInitParameters.R b/R/basicInitParameters.R deleted file mode 100644 index 3583e68..0000000 --- a/R/basicInitParameters.R +++ /dev/null @@ -1,28 +0,0 @@ -#----------------------------------------------------------------------- -#' Initialize the parameters in a basic way (zero for the conditional mean, -#' uniform for weights, identity for covariance matrices, and uniformly distributed forthe clustering) -#' @param n sample size -#' @param p number of covariates -#' @param m size of the response -#' @param k number of clusters -#' @return list with phiInit, rhoInit,piInit,gamInit -#' @export -#----------------------------------------------------------------------- -basic_Init_Parameters = function(n,p,m,k) -{ - phiInit = array(0, dim=c(p,m,k)) - - piInit = (1./k)*rep.int(1,k) - - rhoInit = array(0, dim=c(m,m,k)) - for(i in 1:k) - rhoInit[,,i] = diag(m) - - gamInit = 0.1*array(1, dim=c(n,k)) - R = sample(1:k,n, replace=TRUE) - for(i in 1:n) - gamInit[i,R[i]] = 0.9 - gamInit = gamInit/sum(gamInit[1,]) - - return (data = list(phiInit = phiInit, rhoInit = rhoInit, piInit = piInit, gamInit = gamInit)) -}