Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taxon-specific measurement error #20

Open
wrshoemaker opened this issue May 3, 2019 · 4 comments
Open

Taxon-specific measurement error #20

wrshoemaker opened this issue May 3, 2019 · 4 comments

Comments

@wrshoemaker
Copy link

Hello,

I'm a big fan of the package and have enjoyed using it for a number of projects.

I had a question regarding the measurement_error optional argument that can be passed to phylolm. The documentation suggests that the variance of the measurement error is inferred and then included in the full covariance matrix. Is it possible to supply a string containing variance of the measurement error for each taxon so that the full covariance matrix includes taxon-specific measurement errors?

Best,
Will

@lamho86
Copy link
Owner

lamho86 commented May 3, 2019

Hello Will,

The current implementation assumes that the variance of measurement errors are the same for all species. So, this quantity can be estimated from the data.

You want to supply a vector of variances of the measurement error. Does that mean you assume that they are known?

@wrshoemaker
Copy link
Author

Hi Lam,

Thank you for responding. Basically my species-level observations represent the mean of means, so for each species-level observation I have a pooled variance term that takes into account the variation of biological replicates and the technical replicate variation for each biological replicate. My understanding is that I can supply a dataframe containing the biological replicates for each species and set measurement_error =TRUE and phylolm will estimate the error term. But I would like to take into account the technical replicate variation for each biological replicate.

My thought is that I could pass the pooled variances as a vector. This may not be optimal, but it would allow me to take into account measurement error.

@lamho86
Copy link
Owner

lamho86 commented May 5, 2019

If I don't misunderstand, you would like to fit a model where the variance of a specie i is:

sigma^2 v_{ii} + sigma^2_err + sigma^2_rep_i

where sigma^2 v_{ii} is the variance of the model (need to be estimated), sigma^2_err is the variance of the measurement errors (need to be estimated) and sigma^2_rep_i is the variance of the replicate (input by you).

If it is correct, I can add this into phylolm. It shouldn't take too long.

@wrshoemaker
Copy link
Author

Apologies for the delay in getting back to you,

Yes, sigma^2 v_{ii} + sigma^2_err + sigma^2_rep_i is a good representation. Thank you for incorporating it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants