This function fit NEMoE model using EM algorithm.

fitNEMoE(
  NEMoE_obj,
  beta_init = NULL,
  gamma_init = NULL,
  num_restart = 5,
  restart_it = 10,
  BPPARAM = BiocParallel::SerialParam(),
  ...
)

Arguments

NEMoE_obj

a NEMoE object contain data and parameters for fitting.

beta_init

initial values of parameters in experts network.

gamma_init

initial value of parameters in gating network.

num_restart

Number of restart times.

restart_it

Maximial number of iterations during restart. the BiocParallel package is used. Default is SerialParam().

BPPARAM

A BiocParallelParam class object from.

...

other parameters can be passed to fitNEMoE. See createParameterList

Value

a NEMoE object contain fitted result including parameters beta a list contain coefficients of experts network in all levels. gamma a matrix of coefficients in gating network. r_i an array of inherit partition result in EM algorithm. pen_fac estimated penalty factor for lambda1 (adapt = T). The (balanced) lambda1 in NEMoE is lambda1*pen_fac latent estimated latent classes.

See also

Examples

data(NEMoE_example) NEMoE_example
#> Numer of samples: 168 #> Microbiome number of variables: 5, 16, 24, 36, 101, #> Nutrition dim: 168 27 #> Number of latent class K: 2 #> NEMoE output names (5): beta gamma r_i pen_fac LL #> param names (14): lambda1 lambda2 ... verbose early_stop #> cross validation param names (9): g1 lambda2_seq ... itmax_cv itmax_fit
NEMoE_example <- fitNEMoE(NEMoE_example, num_restart = 0)
#> Fitting NEMoE.... #> it: 0, PLL0:-1032.93 #> it: 1, PLL:-521.229 #> it: 2, PLL:-511.879 #> it: 3, PLL:-508.635 #> it: 4, PLL:-506.598 #> it: 5, PLL:-505.111 #> it: 6, PLL:-503.808 #> it: 7, PLL:-502.643 #> it: 8, PLL:-501.587 #> it: 9, PLL:-500.677 #> it: 10, PLL:-499.79 #> it: 11, PLL:-498.912 #> it: 12, PLL:-498.135 #> it: 13, PLL:-497.429 #> it: 14, PLL:-496.733 #> it: 15, PLL:-495.999 #> it: 16, PLL:-495.196 #> it: 17, PLL:-494.288 #> it: 18, PLL:-493.227 #> it: 19, PLL:-491.953 #> it: 20, PLL:-490.378 #> it: 21, PLL:-488.453 #> it: 22, PLL:-486.091 #> it: 23, PLL:-483.381 #> it: 24, PLL:-480.661 #> it: 25, PLL:-478.076 #> it: 26, PLL:-475.773 #> it: 27, PLL:-473.822 #> it: 28, PLL:-472.299 #> it: 29, PLL:-471.153 #> it: 30, PLL:-470.36 #> it: 31, PLL:-469.868 #> it: 32, PLL:-469.542 #> it: 33, PLL:-469.326 #> it: 34, PLL:-469.179 #> it: 35, PLL:-469.077 #> it: 36, PLL:-469.008 #> it: 37, PLL:-468.962 #> it: 38, PLL:-468.93 #> it: 39, PLL:-468.906 #> it: 40, PLL:-468.888 #> it: 41, PLL:-468.872 #> it: 42, PLL:-468.859 #> it: 43, PLL:-468.848 #> it: 44, PLL:-468.838 #> it: 45, PLL:-468.829 #> it: 46, PLL:-468.821 #> it: 47, PLL:-468.813 #> it: 48, PLL:-468.806 #> it: 49, PLL:-468.797 #> it: 50, PLL:-468.789 #> it: 51, PLL:-468.778 #> it: 52, PLL:-468.766 #> it: 53, PLL:-468.752 #> it: 54, PLL:-468.733 #> it: 55, PLL:-468.714 #> it: 56, PLL:-468.696 #> it: 57, PLL:-468.679 #> it: 58, PLL:-468.663 #> it: 59, PLL:-468.648 #> it: 60, PLL:-468.632 #> it: 61, PLL:-468.617 #> it: 62, PLL:-468.602 #> it: 63, PLL:-468.588 #> it: 64, PLL:-468.573 #> it: 65, PLL:-468.56 #> it: 66, PLL:-468.549 #> it: 67, PLL:-468.539 #> it: 68, PLL:-468.531 #> it: 69, PLL:-468.525 #> it: 70, PLL:-468.52 #> it: 71, PLL:-468.516 #> it: 72, PLL:-468.514 #> it: 73, PLL:-468.513 #> it: 74, PLL:-468.513 #> it: 75, PLL:-468.513 #> it: 76, PLL:-468.513 #> it: 77, PLL:-468.513 #> it: 78, PLL:-468.513