GerryChain
GerryChain copied to clipboard
Seed methods
We have a bunch of seed methods sitting in #248 that we should clean up, merge in, and document. But we'll also want to think about how we can present those methods in the clearest, most responsible manner.
Basic outlines of the current versions: https://www.overleaf.com/read/zpmyzqmpvmnx plus some additional code for context: https://github.com/drdeford/Tree_Partitions_Preliminary
This also fits into #296 as the construction of new seeds sits somewhere in between chain runs, data processing, and implementation details.
-
Do we include seed building in GerryChain? (The underlying graph and data objects are the same + you can use any such method as an i.i.d. proposal)
-
Is it closer to MAUP style preprocessing? (Could be a separate project taking that just also happens to make use of make graph)
-
Should we offer the opportunity to generate a new seed every time you generate an ensemble? (I've used this approach on some states)
I'm intrigued by the idea of making it a separate project. That would make it easier to include additional seed methods without having to worry about putting too many things in GerryChain.
Being able to generate a new seed every time you generate an ensemble would be useful. I suppose MarkovChain could optionally take a seed method as a parameter instead of an initial plan? Figuring out a standard interface for seed methods (and bipartitioning methods) would be helpful, although probably impossible.
Here's an idea I had about the bipartitioning methods. Suppose we make our constraints into callable classes instead of functions, looking something like this:
>>> pop_constraint = PopulationConstraint("TOTPOP", ideal=1250, epsilon=0.05)
>>> pop_constraint(initial_partition)
True
Then maybe we could standardize the bipartitioning methods to always be callables with the signature (graph, population constraint) -> partition
?
Independent of this specific example, I think it would be good to explore using callable objects for the situations where we find ourselves using partial
.
Now a week 6 project for vrdi 2019.