pbastide / PhylogeneticEM

Implementation of the EM algorithm for the detection of shifts in a phylogeny.
https://pbastide.github.io/PhylogeneticEM/
GNU General Public License v2.0
16 stars 4 forks source link

Quadrupen and lambda1 parameter #3

Closed pbastide closed 8 years ago

pbastide commented 10 years ago

Quadrupen does not behave as expected in the following sequence :

  1. fit <- elastic.net(x = 0 + Xp, y = Yp, lambda2 = 0, penscale = penscale) df <- rowSums(fit@active.set) Result : df = [0, ..., 49, 53, ...]
  2. find df closest to K=50 from below (K_inf < K) and above (K_sup > K) and lambdas corresponding : lambda_inf <- fit@lambda1[tail(which(K_inf == df), n=1)] lambda_sup <- fit@lambda1[head(which(K_sup == df), n=1)]
  3. Do a new fit in hope that K will appear in df, using the lambdas found above : lambda <- seq(from = lambda_inf, to = lambda_sup, length.out = 100) fit <-elastic.net(x = 0 + Xp, y = Yp, lambda1 = lambda, lambda2 = 0, penscale = penscale) df <- rowSums(fit@active.set) Result : df = [43, ..., 43]
pbastide commented 8 years ago

Old version of code, that tried to be too precise.