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

Reducing speciation rate after a certain time (from a distribution to a fixed value) #19

Open
TGuillerme opened this issue Nov 20, 2023 · 0 comments
Labels
simulation template Share your simulation template

Comments

@TGuillerme
Copy link
Owner

Reducing speciation rate after a certain time (from a distribution to a fixed value)

Generates a birth death tree with a random speciation rate (from a uniform distributuion (1; 2)) but changing it to a fixed value of 0.25 after four time units

What does it do?

What function does it uses? yes/no comments
Uses make.bd.params using a distribution of rates
Uses make.traits
Uses make.modifications
Uses make.events

bd.params

A birth death parameter with a uniform speciation distribution between 1 and 2:

random_speciation <- make.bd.params(speciation = runif, 
                                    speciation.args = list(min = 1,
                                                           max = 2))

events

Reducing the speciation rate to a fixed rate of 0.25 after time 4.

reduced.speciation <- make.events(
                      condition = time.condition(4),
                      target = "bd.params",
                      modification = bd.params.update(speciation = 0.25))

A running example

## My favorite seed
set.seed(42)

## Some stopping rules
my_stop.rule <- list(max.time = 6)

## The simulation
my_simulation <- treats(stop.rule = my_stop.rule,
                        bd.params = random_speciation,
                        events    = reduced.speciation)
plot(my_simulation, show.tip.label = FALSE)

Reference

If you use this template in a publication, please cite:

  • treats
  • R
@TGuillerme TGuillerme added the simulation template Share your simulation template label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
simulation template Share your simulation template
Projects
None yet
Development

No branches or pull requests

1 participant