Skip to content

Commit

Permalink
Merge pull request #358 from hyanwong/correct-posterior-docs
Browse files Browse the repository at this point in the history
Update docs for posterior
  • Loading branch information
hyanwong authored Jan 6, 2024
2 parents 8f02268 + c93435a commit 2b43821
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ posteriors_df.head() # Show the dataframe
Since we are using a {ref}`sec_methods_discrete_time` method, each node
(numbered column of the dataframe) is associated with a vector of probabilities
that sum to one: each cell gives the probability that the time of the node
whose ID is given by the column header lies within the
timeslice specified by the `start_time` and `end_time` columns.
whose ID is given by the column header lies at the specific timepoint
given by the `time` column.

For the continuous-time `variational_gamma` method, the posterior for
each node is represented by the shape and rate parameter of the gamma approximation,
and the `start_time` and `end_time` entries may be ignored.
as described by the `parameter` column.

(sec_usage_popsize)=

Expand All @@ -193,6 +193,14 @@ over a number of contiguous time intervals. Functions of this sort are captured
{class}`~demography.PopulationSizeHistory` class: see the {ref}`sec_variable_popsize` page
for its use and interpretation.

If you don't have an established estimate for the effective population size of your data,
a rough approximation is to use the (sitewise) genetic diversity divided by
four-times the mutation rate:

```{code-cell} ipython3
print("A rough estimate of the effective population size is", sim_ts.diversity() / (4 * 1e-6))
```

(sec_usage_popsize_timescale)=

### Timescale adjustment
Expand Down

0 comments on commit 2b43821

Please sign in to comment.