ericgoolsby / Rphylopars

Phylogenetic Comparative Tools for Missing Data and Within-Species Variation
28 stars 11 forks source link

error for mvOU #35

Open itchyshin opened 4 years ago

itchyshin commented 4 years ago

I get this error message

> system.time(m_mvOU <- phylopars(dat_imp, tree, model = "mvOU"))
Error: $ operator is invalid for atomic vectors
Timing stopped at: 2442 19.7 2468

These other things run fine.

system.time(m_BM <- phylopars(dat_imp, tree, model = "BM")) # takes around 1 h
system.time(m_OU <- phylopars(dat_imp, tree, model = "OU"))

My tree is pretty big ~10,000 and the dataset has a lot of missing values.

Have you had similar issues with mvOU? @ericgoolsby

Thanks!

ericgoolsby commented 4 years ago

I'm guessing it's the result of a numerical optimization issue causing NA values in the OU alpha matrix or one of the trait covariance matrices. How many traits are in the data?

Rphylopars needs better error handling in general, which is anticipated for the next major update, but will likely be a couple of months. Do you have multiple observations per species for this data, or just one? This might not be an ideal workaround for your purposes, but if there are multiple observations per species, you might consider reducing the number of parameters that need to be estimated by setting pheno_correlated=FALSE (i.e., this assumes that within-species error is uncorrelated across traits) or pheno_error=FALSE (i.e., this takes species means for each traits and does not estimate intraspecific error).

aeiche01 commented 2 years ago

I'm also getting this error, but oddly it's for a data table that worked with mvOU before.