Skip to content

Commit

Permalink
Cleaning examples, add tree dist doc
Browse files Browse the repository at this point in the history
  • Loading branch information
binho authored and binho committed Feb 13, 2024
1 parent 30ac97a commit eb275a7
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 65 deletions.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
73 changes: 49 additions & 24 deletions docs/build/html/pjdoc/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/build/html/searchindex.js

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions examples/birthdeath_incomplete_sampling.pj
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# constant-node variable ('birth_rate', etc.) assignment
birth_rate <- 1.0
death_rate <- 0.2

# deterministic-node variable ('det_birth_rate', etc.) assignment
det_birth_rate := sse_rate(name="birth_rate", value=birth_rate, event="speciation")
det_death_rate := sse_rate(name="death_rate", value=death_rate, event="extinction")

# constant-node variable ('sampling_rate') assignment
sampling_prob <- 0.5

# deterministic-node variable ('det_sampling_rate') assignment
det_sampling_prob := sse_prob(name="rho", value=sampling_prob, state=0)

# deterministic-node variable ('meh') assignment
stash := sse_stash(flat_rate_mat=[det_birth_rate, det_death_rate], flat_prob_mat=[det_sampling_prob], n_states=1, n_epochs=1)

# stochastic-node variable ('trs') assignment
ori <- 1.0
trs ~ discrete_sse(n=2, nr=2, stash=stash, start_state=[0,0], stop="age", stop_value=ori, origin="true")
3 changes: 2 additions & 1 deletion examples/birthdeath_timehet.pj
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ det_death_rate_t1 := sse_rate(name="mu_t1", value=death_rate_t1, states=[0], eve
stash := sse_stash(flat_rate_mat=[det_birth_rate_t0,det_death_rate_t0,det_birth_rate_t1,det_death_rate_t1], n_states=1, n_epochs=2, epoch_age_ends=[1.5], seed_age=3.0)

# stochastic-node variable ('trs') assignment
trs ~ discrete_sse(n=100, stash=stash, start_state=[0], stop="age", stop_value=3.0, origin="true")
ori <- 3.0
trs ~ discrete_sse(n=2, nr=2, stash=stash, start_state=[0], stop="age", stop_value=ori, origin="true")
5 changes: 3 additions & 2 deletions examples/bisse.pj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ det_death_rate1 := sse_rate(name="mu1", value=death_rate1, states=[1], event="ex
det_trans_rate_10 := sse_rate(name="q10", value=trans_rate_10, states=[1,0], event="transition")

# deterministic-node variable ('sse_stash') assignment
stash := sse_stash(flat_rate_mat=[det_birth_rate0, det_death_rate0, det_trans_rate_01, det_birth_rate1, det_death_rate1, det_trans_rate_10], n_states=2, n_epochs=1)
stash := sse_stash(flat_rate_mat=[det_birth_rate0, det_death_rate0, det_trans_rate_01, det_birth_rate1, det_death_rate1, det_trans_rate_10], n_states=2)

# stochastic-node variable ('trs') assignment
trs ~ discrete_sse(n=3, stash=stash, start_state=[0,0], stop="age", stop_value=3.0, origin="true", cond_spn="true", cond_surv="true")
ori <- 3.0
trs ~ discrete_sse(n=2, nr=2, stash=stash, start_state=[0], stop="age", stop_value=3.0, origin="true", cond_spn="true", cond_surv="true")
4 changes: 2 additions & 2 deletions examples/bisse_timehet.pj
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ det_trans_rate01_t1 := sse_rate(name="q01_t1", value=trans_rate01_t1, states=[0,
det_trans_rate10_t1 := sse_rate(name="q10_t1", value=trans_rate10_t1, states=[1,0], event="transition", epoch=2)

# deterministic-node variable ('sse_stash') assignment
# all first-epoch rates first, then all second-epoch rates!
stash := sse_stash(flat_rate_mat=[det_birth_rate0_t0, det_death_rate0_t0, det_birth_rate1_t0, det_death_rate1_t0, det_trans_rate01_t0, det_trans_rate10_t0, det_birth_rate0_t1, det_death_rate0_t1, det_birth_rate1_t1, det_death_rate1_t1, det_trans_rate01_t1, det_trans_rate10_t1], n_states=2, n_epochs=2, epoch_age_ends=[1.5], seed_age=3.0)

# stochastic-node variable ('trs') assignment
trs ~ discrete_sse(n=100, stash=stash, start_state=[0], stop="age", stop_value=3.0, origin="true")
ori <- 3.0
trs ~ discrete_sse(n=2, nr=2, stash=stash, start_state=[0,0], stop="age", stop_value=ori, origin="true")
5 changes: 3 additions & 2 deletions examples/fbd.pj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ det_death_rate := sse_rate(name="mu", value=death_rate, states=[0], event="extin
det_fossil_rate := sse_rate(name="psi", value=fossil_rate, states=[0], event="anc_sampling")

# deterministic-node variable ('sse_stash') assignment
stash := sse_stash(flat_rate_mat=[det_birth_rate, det_death_rate, det_fossil_rate], n_states=1, n_epochs=1)
stash := sse_stash(flat_rate_mat=[det_birth_rate, det_death_rate, det_fossil_rate], n_states=1)

# stochastic-node variable ('trs') assignment
trs ~ discrete_sse(n=100, stash=stash, start_state=[0], stop="age", stop_value=3.0, origin="true", cond_spn="true", cond_surv="true")
ori <- 3.0
trs ~ discrete_sse(n=2, nr=2, stash=stash, start_state=[0,0], stop="age", stop_value=ori, origin="true", cond_spn="true", cond_surv="true")
5 changes: 3 additions & 2 deletions examples/geosse.pj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ det_trans_rate_20 := sse_rate(name="q20", value=trans_rate_20, states=[2,0], eve
det_trans_rate_21 := sse_rate(name="q21", value=trans_rate_21, states=[2,1], event="transition")

# deterministic-node variable ('sse_stash') assignment
stash := sse_stash(flat_rate_mat=[det_w_birth_rate0, det_death_rate0, det_trans_rate_02, det_w_birth_rate1, det_death_rate1, det_trans_rate_12, det_b_birth_rate201, det_b_birth_rate202, det_b_birth_rate212, det_trans_rate_20, det_trans_rate_21], n_states=3, n_epochs=1)
stash := sse_stash(flat_rate_mat=[det_w_birth_rate0, det_death_rate0, det_trans_rate_02, det_w_birth_rate1, det_death_rate1, det_trans_rate_12, det_b_birth_rate201, det_b_birth_rate202, det_b_birth_rate212, det_trans_rate_20, det_trans_rate_21], n_states=3)

# stochastic-node variable ('trs') assignment
trs ~ discrete_sse(n=1, stash=stash, start_state=[0], stop="age", stop_value=3.0, origin="true", cond_spn="true", cond_surv="true")
ori <- 3.0
trs ~ discrete_sse(n=2, nr=2, stash=stash, start_state=[2,2], stop="age", stop_value=ori, origin="true", cond_spn="true", cond_surv="true")
8 changes: 5 additions & 3 deletions examples/geosse_timehet.pj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# constant-node variable ('birth_rate0_t0') assignment
# constant-node variable ('w_birth_rate0_t0') assignment
# first epoch (old)
# state 0
w_birth_rate0_t0 <- 1.5
Expand Down Expand Up @@ -35,7 +35,7 @@ b_birth_rate2_1_2_t1 <- 1.25
trans_rate2_0_t1 <- 0.75
trans_rate2_1_t1 <- 0.75

# deterministic-node variable ('det_birth_rate0_t0') assignment
# deterministic-node variable ('det_w_birth_rate0_t0') assignment
# first epoch (old)
# state 0
det_w_birth_rate0_t0 := sse_rate(name="lambda0_t0", value=w_birth_rate0_t0, states=[0,0,0], event="w_speciation", epoch=1)
Expand Down Expand Up @@ -74,5 +74,7 @@ det_trans_rate2_1_t1 := sse_rate(name="q2_1_t1", value=trans_rate2_1_t1, states=

# wrapping up all rates
stash := sse_stash(flat_rate_mat=[det_w_birth_rate0_t0, det_death_rate0_t0, det_trans_rate0_2_t0, det_w_birth_rate1_t0, det_death_rate1_t0, det_trans_rate1_2_t0, det_b_birth_rate2_0_1_t0, det_b_birth_rate2_0_2_t0, det_b_birth_rate2_1_2_t0, det_trans_rate2_0_t0, det_trans_rate2_1_t0, det_w_birth_rate0_t1, det_death_rate0_t1, det_trans_rate0_2_t1, det_w_birth_rate1_t1, det_death_rate1_t1, det_trans_rate1_2_t1, det_b_birth_rate2_0_1_t1, det_b_birth_rate2_0_2_t1, det_b_birth_rate2_1_2_t1, det_trans_rate2_0_t1, det_trans_rate2_1_t1], n_states=3, n_epochs=2, seed_age=2.0, epoch_age_ends=[1.0])

# stochastic-node variable ('trs') assignment
trs ~ discrete_sse(n=2, nr=50, stash=stash, start_state=[0], stop="age", stop_value=2.0, origin="true")
ori <- 2.0
trs ~ discrete_sse(n=2, nr=2, stash=stash, start_state=[0,0], stop="age", stop_value=2.0, origin="true")
3 changes: 2 additions & 1 deletion examples/yule.pj
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ det_birth_rate := sse_rate(name="lambda", value=birth_rate, event="speciation")
stash := sse_stash(flat_rate_mat=[det_birth_rate])

# stochastic-node variable ('trs') assignment
trs ~ discrete_sse(n=n_sim, nr=n_rep, stash=stash, start_state=[0,0], stop="age", stop_value=2.0, origin="true")
ori <- 2.0
trs ~ discrete_sse(n=n_sim, nr=n_rep, stash=stash, start_state=[0,0], stop="age", stop_value=ori, origin="true")
27 changes: 0 additions & 27 deletions examples/yule_incomplete_sampling.pj

This file was deleted.

0 comments on commit eb275a7

Please sign in to comment.