tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Tutorial: generating parameters from priors in msprime

Open jeromekelleher opened this issue 6 years ago • 7 comments

People often need to run simulations with parameters drawn from some distribution. Add a simple example of this to the tutorial. Include an example where we draw times from a distribution and we sort the list by time after generation to ensure they're in the right order.

Pinging @gtsambos (@agladstein mentioned you were interested in this)

jeromekelleher avatar Oct 09 '19 09:10 jeromekelleher

Hi Jerome, yes, I have some code that does this and I'd be happy to put up something on the tutorial somewhere. (perhaps while I do this general revamp of the tutorial) -- happy to be assigned to this task.

There's a simple and a complicated case to consider here. The simple case is when all the priors are independent of each other -- then this is fairly easy.

In practice though, most parameters in demographic models will have some dependencies and the priors are represented by a DAG. For example, if a source population is 'created' by a MassMigration event from a destination population at some time, any other demographic times relating to the history of this source population must be later than this time. In my own code, I've found it useful to create some checks of consistency before I run a simulation with the parameters.

gtsambos avatar Oct 09 '19 09:10 gtsambos

Btw - we have enough documentation-related tasks that it might be worth opening a Project to collate them all, I think? I don't know how far the msprime 2.0 paper is from publication, but I think it would be wonderful to have shiny new docs ready for this occasion ✨

gtsambos avatar Oct 09 '19 09:10 gtsambos

I think we can just start with the simple version. And I also have code that does this, or can whip something up.

agladstein avatar Oct 09 '19 09:10 agladstein

Great, thanks @gtsambos and @agladstein --- can you coordinate with each other on this please? We'll want the simple version definitely, and if the complicated version is generally useful and won't take up too much space then that sounds good too.

Good call on the project, I've made it "1.0 Documentation".

jeromekelleher avatar Oct 09 '19 09:10 jeromekelleher

This sounds like a topic much more suited to the "tskit tutorials" site. See proposal here: https://github.com/tskit-dev/tutorials/issues/10

Shall we migrate this issue to the "tutorials" repo?

jeromekelleher avatar Nov 03 '20 15:11 jeromekelleher

Shall we migrate this issue to the "tutorials" repo?

Assuming https://github.com/tskit-dev/tutorials is also for msprime tutorials, then yes!

agladstein avatar Nov 03 '20 15:11 agladstein

Transferred from msprime. This would be a good tutorial.

jeromekelleher avatar Jan 28 '21 09:01 jeromekelleher