khabbazian / l1ou

Detection of evolutionary shifts in Ornstein-Uhlenbeck models

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with argument alpha.upper=0

jjsolano opened this issue · comments

Hi,

I was trying to fit a straight BM model with l1ou package implementing alpha=0 in the estimate_shift_configuration function. To do that, I used the argument alpha.upper=0, but I got the following error message:

eModel <- estimate_shift_configuration(tree = lizard$tree, 
                                        lizard$Y, criterion="AICc",  
                                        alpha.upper = 0, 
                                        nCores = 3)

Error in estimate_shift_configuration(tree = lizard$tree, lizard$Y, criterion = "AICc",  : 
  alpha.upper must be strictly positive.

Follow to read this error message, I fit the alpha.upper=0.001 but I got an similar error:

eModel <- estimate_shift_configuration(tree = lizard$tree, 
                                        lizard$Y, criterion="AICc",  
                                        alpha.upper = 0.001,
                                        nCores = 3)

Starting first LASSO (alpha=0) to find a list of candidate configurations.
Error in fit_OU_model(tree, Y, result$shift.configuration, opt) : 
  model score is NA in fit_OU_model function! 
		 This should not happen. Please set quietly to false to see the reason.

Thanks,

Jaiber

Thank you Jaiber for posting your example 👍
What kind of error message do you get if you add the option quietly=FALSE in the estimate_shift_configuration command?

Hi Cécile,

If I try using alpha.upper=0 the error it's the same, but if I try with alpha.upper=0.001 the error message is:

Starting first LASSO (alpha=0) to find a list of candidate configurations.
Error in phylolm(Y ~ preds - 1, phy = tree, model = opt$root.model, upper.bound = opt$alpha.upper.bound) : 
  The starting value is not within the bounds of the parameter.
Error in fit_OU_model(tree, Y, result$shift.configuration, opt) : 
  model score is NA in fit_OU_model function! 
		 This should not happen. Please set quietly to false to see the reason.
In addition: Warning message:
In my_phylolm_interface(tr, y, s.c, opt) :
  phylolm returned error with a shift configuration
                            of size 0. You may
                            want to change alpha.upper/alpha.lower!

thank you this is useful. Could you try to add the following options: alpha.starting.value=0.0005 and perhaps also alpha.lower=0.0?

Thanks Cécile,

I tried with the parameters that you indicate me and it work very well. I will run my datasets with these parameters.

eModel <- estimate_shift_configuration(lizard$tree, lizard$Y,
                  criterion="AICc",  
                  max.nShifts = 0, nCores = 3, quietly=FALSE,
                  alpha.upper = 0.001, alpha.lower=0.0, alpha.starting.value=0.0005
                              )