Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options for sampling discrete parameters? #5

Open
erccarls opened this issue Dec 16, 2015 · 4 comments
Open

Options for sampling discrete parameters? #5

erccarls opened this issue Dec 16, 2015 · 4 comments

Comments

@erccarls
Copy link

Any chance this could be added? Is this even a possibility for the Multinest Algorithm in general?

@andrewfowlie
Copy link

Your could implement this yourself in your prior function. You must map the MultiNest unit hypercube to your parameter space. To map to a discrete parameter p taking values from 1 ... n from a MultiNest parameter from a unit hypercube, i.e. x \sim U(0,1), consider the following pseudo-code:

for i in 1 ... n:
    if x < i / n:
        p = i
        return p

i.e. divide 0 to 1 into n equal intervals and map each interval to a value of p. This could be generalized any discrete parameter y_p indexed by p, where all values of p are equally probable.

I see no problems with mapping from a continuous to a discrete parameter space, as you can always rewrite the evidence, Z, in terms of a continuous parameter. That is, instead of a discrete sum over i

Z = \sum_i like(i) prior(i)

you could write an integral with a continuous parameter x

Z = \int like(x) prior(x) dx = \sum_i like(i) prior(i)

where prior(x) and like(x) are constant for values of the continuous parameter x that correspond to the discrete parameter i. A small caveat: I don't know whether MultiNest would be the quickest algorithm to perform a sum for an evidence (rather than an integral for an evidence).

@rjw57
Copy link
Owner

rjw57 commented Feb 8, 2016

Hi @innisfree and @erccarls

@rjw57
Copy link
Owner

rjw57 commented Feb 8, 2016

Thanks for your interest in MultiNest but this is just a personal fork of the project. The project's home page is https://ccpforge.cse.rl.ac.uk/gf/project/multinest/ and there should be contact info there.

@andrewfowlie
Copy link

@rjw57 sure no worries. I just realized I could answer the question pretty easily so why not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants