sweeplink-plot-posteriors¶
Violin plot of the posterior of the effective population size, and optionally of the other global parameters.
$ sweeplink-plot-posteriors --prefix doc
Writes doc_posteriors.png. A single number can only say so much about a
skewed distribution; this shows the whole shape, which is the quickest way to
see how much the data actually pin N down.
Input¶
--prefix/--dirs+--run-nameThe run(s) to read. See combining several runs. Every MCMC sample from every run goes into one pooled bucket.
What to plot¶
--params <name> [<name> ...]Extra parameters to show alongside
N, one panel each. Choose fromkappa,nu,mu,betaMean,betaESS. Off by default — most analyses only wantN.A parameter the run held fixed is skipped automatically with a note saying why:
kappa,nuandmuare the linkage model’s own transition parameters and mean nothing under--linkage false;betaMeanandbetaESSonly exist if--forwardPrioror--newMutPriorwasbeta.--linearPlot
Non a linear scale. The default is log10, which is what the chain actually samples and the scale on which the posterior is roughly symmetric — on a linear axis the long right tail makes the bulk unreadable.--per-chromosomeAlso draw each run’s own violin beside the pooled one. Default is the pooled bucket alone. With one run per chromosome this is a quick check of whether they agree — genuine disagreement shows up as violins that do not overlap.
Output¶
--out <file>Where to write. Default
<prefix>_posteriors.png.--theme <light|dark>,--title <text>,--dpi <n>As for
sweeplink-plot.
Reading it¶
Each violin carries a boxplot inside it, so the shape and the numbers are in one place:
Mark |
Meaning |
|---|---|
Horizontal line |
median |
Open circle |
mean |
Shaded box |
interquartile range (25th–75th) |
Thin vertical line |
central 95% (2.5th–97.5th) |
The violin itself spans the full range of the samples, tails included, so a long spike upward is real and not a rendering artefact.
The printed summary¶
The same numbers are printed, which is usually what ends up quoted:
$ sweeplink-plot-posteriors --prefix doc
N:
Pop1 82,899 [10**mean(log10 N)]
median 58,653 IQR 27,781 - 175,700 95% 10,884 - 3,816,212
range 4,821 - 265,842,000 sd 0.6618 (on log10) n = 10,000
N is summarised on the linear scale even though it is sampled and drawn on
log10, because that is the scale it is reported on. The headline figure is
10^mean(log10 N) — the same value sweeplink-extract fixes the
second round at, so the two always agree. The standard deviation stays on the
log10 scale, where it is meaningful.
The gap between the mean and the median here is the skew made concrete: 82,899 against 58,653, with a tail reaching 265 million.
Note
The median shown here and the N that sweeplink-extract
suggests for round 2 are different summaries and will not match exactly — the
latter is 10^mean(log10N). Both describe where the bulk of the mass sits;
neither is the arithmetic mean of N, which sits far out in the tail.