venelin / PCMFit

An R-package for maximum likelihood inference of Gaussian phylogenetic models with shifts
https://venelin.github.io/PCMFit
4 stars 3 forks source link

QuadraticPoly.h:InitNode:: The matrix V for node X is nearly singular #5

Closed huatengh closed 4 years ago

huatengh commented 4 years ago

I tried to fit a global BM model using PCMFit. It generates output, but showing ~50 or so warnings, something like: In PCMLik.GaussianPCM(X, tree, model, SE, metaI, log = log) : PCMLik.GaussianPCM:: There was a problem calculating the coefficients L,m,r. Error message from call to PCMLmr: Error in PCMLmr.PCMInfoCpp(X = X, tree = tree, model = model, SE = SE, : QuadraticPoly.h:InitNode:: The matrix V for node 11 (branch length=0.137877) is nearly singular or not positive definite; near 0 or negative eigenvalue found

I also tested the example script on https://venelin.github.io/PCMFit/articles/pcmfit.html. The step fitting a global BM also gives similar warning messages.

Is it something I should be concerned? Can I still use the results?

Thanks!

venelin commented 4 years ago

This warning occurs for combinations of branch length and model parameters resulting in singular variance-covariance matrix. The answer depends on the log-likelihood value of the final model: if it is finite and bigger than -1e20 (an artificially set numerical value to replace NA), then you can safely ignore the warnings; Conversely, if it is -1e20, then the method failed to find a valid fit.

huatengh commented 4 years ago

Great, thanks!