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

model.data for pgls is tricky #54

Closed
richfitz opened this issue Dec 4, 2013 · 2 comments
Closed

model.data for pgls is tricky #54

richfitz opened this issue Dec 4, 2013 · 2 comments

Comments

@richfitz
Copy link
Member

richfitz commented Dec 4, 2013

I may be wrong in some of the logic here...

Usually model.data does not depend on the parameters; it's just the data. However, that's not the case for the PGLS fits, where we care about the residuals. This is fine and easy for ML fits, and I have written a residuals method in diversitree that will get this for us.

However, for Bayesian fits, we will need to get new data for every sample that we care about.

Within as.unit.tree.mcmcsamples, produces a multiPhylo object along the samples, so the high level interface will work fine. However, this function currently works by a single call to model.info which produces a single data object, and then going through make.model.phylo, which assumes that the data object is scalar.

I see two options

  1. Define a new as.unit.tree.mcmcsamples.pgls (cumbersome, but that is the full method name!)
  2. Set things up to work with non-scalar 'data' objects.

There are plusses and negatives to both. If we take the first route then the bits around sampling from the mcmc object need to abstracted or duplicated anyway. If we take the second, then the design gets more complicated if this is only going to affect a single type of fit.

Something to think about.

@mwpennell
Copy link
Collaborator

personally i am in favor of option (1) as i think this way it will be simpler for people to add additional model.data objects for new models. prefer just to make things more complex for special cases but am open to being swayed on this if you are in favor of (2)

@richfitz
Copy link
Member Author

richfitz commented Dec 9, 2013

Mostly through implementing (1) now. It's simpler with the new mcmc interface.

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