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

Best way to fix topology and branch-lengths #22

Open
sohrabsa opened this issue Aug 17, 2014 · 2 comments
Open

Best way to fix topology and branch-lengths #22

sohrabsa opened this issue Aug 17, 2014 · 2 comments
Labels

Comments

@sohrabsa
Copy link
Collaborator

Is the following the correct way to stop a variable from being sampled?

To have both the topology and branch-length variables fixed, remove the priors over them, for instance in SimplePhyloModel.java, remove the treePrior and branchLengthHyperParameter factors by removing the following lines:

@DefineFactor
NonClockTreePrior<RateParameterization> treePrior = 
NonClockTreePrior
.on(likelihood.tree);

@DefineFactor
Exponential<Exponential.MeanParameterization> branchLengthHyperPrior = 
Exponential
.on(treePrior.branchDistributionParameters.rate)
.withMean(10.0);
@jewellsean
Copy link
Collaborator

Yes, I think that this would be an effective way to stop variables from being sampled. Blang will sample stochastic nodes (which are unobserved) => if you remove the factor def'ns as you have done above those nodes will no longer be stochastic and therefore not sampled.

(NB: I have not verified this in conifer, and I think it would be easier to test if SimplePhyloModel was cleaned out as described in #24)

@zhaottcrystal
Copy link
Collaborator

@sohrabsa
yes, you are right, but make sure you provide a treeFile as the fixed tree topology,
you might also wish to remove this line:
private final PrintWriter treeWriter = BriefIO.output(Results.getFileInResultFolder("tree.nwk"));

since your tree topology is already fixed and you do not need to write them into files.

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

No branches or pull requests

3 participants