JuliaStats / Klara.jl

MCMC inference in Julia
Other
166 stars 38 forks source link

Add option to bound parameters #161

Closed axsk closed 6 years ago

axsk commented 7 years ago

I believe in practice the parameter spaces to be sampled are often bounded. It would be nice to be able to declare bounds to the parameters in their constructors, according to which these are then transformed to and from the unbounded space for sampling and evaluation, automatically taking care of the transformation of variables formula in the likelihood. E.g. for the unit square:

BasicContMuvParameter(:p, logtarget=plogtarget, bounds = ([0,0,0], [1, 1, 1]))
papamarkou commented 7 years ago

Hi @axsk, I started working on parameters with bounded support under #155, and committed some relevant code in the gibbs branch of the repo a couple of months ago. I am away, will be back on the 12th of July, and my hope is that I will manage to find some time in my busy schedule from that point onwards to catch up with Klara and press on with this issue.

axsk commented 7 years ago

c.f. https://github.com/brian-j-smith/Mamba.jl/blob/master/src/distributions/transformdistribution.jl

Anybody got opinions on the syntax for declaring the bounds? A tuple of low/up vectors? A vector of low/up tuples? (Or Array of Arrays?) What about a matrix like [low up; low up; ...]?

papamarkou commented 6 years ago

Thanks @axsk. I am in the process of upgrading Klara to work with Julia v0.6, about 95% of the functionality is not operational with the new Julia version (not pushed to metadata yet though). I have two more issue to close, and then i can look at the matter of dealing with bounded parameters.

The software engineering behind Klara and Mamba are not aligned to have interoperable solutions for the same problem, but I have already an idea of how to set out and solve bounded parameters in Klara in a principled way. This question is actually part of #155, so I will close the current issue to avoid duplication (I will deal with bounded parameters as part of #155).