Core computing function

EMtree(
  PLN.Cor,
  n = NULL,
  maxIter = 30,
  unlinked = NULL,
  random.init = FALSE,
  cond.tol = 1e-10,
  eps = 0.001,
  verbatim = TRUE,
  plot = FALSE
)

Arguments

PLN.Cor

Either an object resulting from the use of the `PLN` function from package `PLNmodels`, or an estimation of Gaussian data correlation matrix.

n

Number of samples, required if a correlation matrix is supplied

maxIter

Maximum number of iterations for EMtree

unlinked

An optional vector of nodes which are not linked with each other

random.init

A boolean for trying a random initialization of the EM

cond.tol

Tolerance parameter for the conditioning of psi matrix

eps

Precision parameter controlling the convergence of weights beta

verbatim

Talks if set to TRUE

plot

Plots likelihood if set to TRUE

Value

  • edges_prob: p x p matrix of edges probabilities

  • edges_weight: p x p matrix of edges weights for any spanning tree

  • logpY: vector of log-likelihoods

  • maxIter: final number of iterations EMtree has ran

  • timeEM: EMtree computation time

  • alpha: data signal/noise ratio

Examples

n=30 p=10 Y=data_from_scratch("tree",p=p)$data PLN_Y = PLNmodels::PLN(Y~1)
#> #> Initialization... #> Adjusting a PLN model with full covariance model #> Post-treatments... #> DONE!
EMtree(PLN.Cor=PLN_Y,verbatim=TRUE, plot=TRUE)
#> #> Convergence took 0.04 secs and 4 iterations.
#> $edges_prob #> [,1] [,2] [,3] [,4] [,5] #> [1,] 0.000000e+00 2.703099e-05 9.999972e-01 1.815177e-09 1.254817e-07 #> [2,] 2.703099e-05 0.000000e+00 9.999734e-01 2.864417e-07 2.395402e-10 #> [3,] 9.999972e-01 9.999734e-01 0.000000e+00 4.093157e-08 1.129899e-10 #> [4,] 1.815177e-09 2.864417e-07 4.093157e-08 0.000000e+00 1.000000e+00 #> [5,] 1.254817e-07 2.395402e-10 1.129899e-10 1.000000e+00 0.000000e+00 #> [6,] 2.589464e-14 2.860662e-07 1.089955e-12 9.999427e-01 6.680481e-11 #> [7,] 1.824194e-09 9.999992e-01 7.284665e-09 2.695970e-11 2.171250e-13 #> [8,] 2.764005e-14 1.200601e-08 2.039234e-12 9.999487e-01 9.657021e-10 #> [9,] 4.264622e-06 7.227053e-08 9.999978e-01 1.427830e-09 2.324378e-12 #> [10,] 2.823114e-11 6.353540e-12 5.668745e-09 1.000000e+00 1.452511e-09 #> [,6] [,7] [,8] [,9] [,10] #> [1,] 2.589464e-14 1.824194e-09 2.764005e-14 4.264622e-06 2.823114e-11 #> [2,] 2.860662e-07 9.999992e-01 1.200601e-08 7.227053e-08 6.353540e-12 #> [3,] 1.089955e-12 7.284665e-09 2.039234e-12 9.999978e-01 5.668745e-09 #> [4,] 9.999427e-01 2.695970e-11 9.999487e-01 1.427830e-09 1.000000e+00 #> [5,] 6.680481e-11 2.171250e-13 9.657021e-10 2.324378e-12 1.452511e-09 #> [6,] 0.000000e+00 7.452400e-07 1.086028e-04 1.666670e-13 1.176126e-11 #> [7,] 7.452400e-07 0.000000e+00 2.029631e-12 3.231531e-09 4.160184e-13 #> [8,] 1.086028e-04 2.029631e-12 0.000000e+00 2.626290e-15 1.913354e-13 #> [9,] 1.666670e-13 3.231531e-09 2.626290e-15 0.000000e+00 9.999994e-01 #> [10,] 1.176126e-11 4.160184e-13 1.913354e-13 9.999994e-01 0.000000e+00 #> #> $norm.cst #> [1] 0.04574459 #> #> $timeEM #> Time difference of 0.038028 secs #> #> $edges_weight #> [,1] [,2] [,3] [,4] [,5] #> [1,] 0.0000000000 0.0014344900 0.6255184655 0.0003693756 0.0002273583 #> [2,] 0.0014344900 0.0000000000 0.7326361332 0.0004523573 0.0002566469 #> [3,] 0.6255184655 0.7326361332 0.0000000000 0.0006710738 0.0003488472 #> [4,] 0.0003693756 0.0004523573 0.0006710738 0.0000000000 0.5636040088 #> [5,] 0.0002273583 0.0002566469 0.0003488472 0.5636040088 0.0000000000 #> [6,] 0.0002086555 0.0002655944 0.0003288846 0.7094018780 0.0003465707 #> [7,] 0.0002580523 0.4808940308 0.0004837664 0.0002843805 0.0001806361 #> [8,] 0.0002099167 0.0002476292 0.0003318501 0.7121271186 0.0003500244 #> [9,] 0.0007781311 0.0006565140 0.8977009776 0.0008966172 0.0003901036 #> [10,] 0.0003995989 0.0004904984 0.0008707997 0.8627640017 0.0005090056 #> [,6] [,7] [,8] [,9] [,10] #> [1,] 0.0002086555 0.0002580523 0.0002099167 0.0007781311 0.0003995989 #> [2,] 0.0002655944 0.4808940308 0.0002476292 0.0006565140 0.0004904984 #> [3,] 0.0003288846 0.0004837664 0.0003318501 0.8977009776 0.0008707997 #> [4,] 0.7094018780 0.0002843805 0.7121271186 0.0008966172 0.8627640017 #> [5,] 0.0003465707 0.0001806361 0.0003500244 0.0003901036 0.0005090056 #> [6,] 0.0000000000 0.0002045982 0.0020975425 0.0003662526 0.0004698800 #> [7,] 0.0002045982 0.0000000000 0.0001754051 0.0003445916 0.0002952816 #> [8,] 0.0020975425 0.0001754051 0.0000000000 0.0003698229 0.0004756862 #> [9,] 0.0003662526 0.0003445916 0.0003698229 0.0000000000 0.8826063532 #> [10,] 0.0004698800 0.0002952816 0.0004756862 0.8826063532 0.0000000000 #> #> $logpY #> [1] 130.2054 130.7740 130.7780 130.7780 #> #> $maxIter #> [1] 4 #>