pymc-devs / pymc

Bayesian Modeling and Probabilistic Programming in Python
https://docs.pymc.io/
Other
8.69k stars 2.01k forks source link

(enhancement) implement list for starting points for pm.sample #3360

Closed aakhmetz closed 5 years ago

aakhmetz commented 5 years ago

I think it would nice to allow the parameter start in pm.sample to vary in similar manner as another parameter random.seed.

Description of your problem

The code

with model_kawaii_on_TV:
    start = [{'kawaii_broadcasting_rate': starting_point} for starting_point in starting_points]
    trace = pm.sample(1000, cores = ncores, start=start, random_seed=[1 for _ in range(ncores)])

gives the same output because start is not iterated. But it would be nice (and a bit helpful) to allow iteration in start parameter as well. At present, this has been made possible for random_seed parameter.

Versions and main components

twiecki commented 5 years ago

To initialize individual chains separately?

aakhmetz commented 5 years ago

yes - it can helpful when there are multiple equilibrium points, and then it is good to investigate the whole range of possible parameter values. It's similar to one approach recommended for POMP in R.

At least it has been done for random seed, so it could be done the same way for starting point.

twiecki commented 5 years ago

That's a reasonable request, want to give it a go and do a PR?

On Sun, Jan 27, 2019, 15:07 Andrei R. Akhmetzhanov <notifications@github.com wrote:

yes - it can helpful when there are multiple equilibrium points, and then it is good to investigate the whole range of possible parameter values. It's similar to one approach https://kingaa.github.io/sbied/mif/mif.html recommended for POMP in R.

At least it has been done for random seed, so it could be done the same way for starting point.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pymc-devs/pymc3/issues/3360#issuecomment-457920852, or mute the thread https://github.com/notifications/unsubscribe-auth/AApJmIYzEA53It4J0fM7Tvb3f4-bmbF0ks5vHbKqgaJpZM4aUpGH .

aakhmetz commented 5 years ago

@twiecki Hai - sorry, after several days thinking I have decided that such enhancement is not really something important, and after reading some more manual on stan/nuts, I concluded that it may contradict to its philosophy (like choosing a starting point close to the equilibrium may not be in the typical set). So I think it's better to put the resolution of my current issue a bit aside

aakhmetz commented 5 years ago

@twiecki Sorry, but is there any way to retrieve the number of a chain while running pymc3-model? I am asking because once I can identify it, I can assing the chain number to some model parameter, for example, the starting point or a changepoint in my process

eigenfoo commented 5 years ago

Hi @aakhmetz: we'd prefer if you directed any questions about using PyMC3 to our discourse forums. The issue tracker is solely for discussing development to PyMC3.

aakhmetz commented 5 years ago

Hi @eigenfoo, sounds good - thanks!