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

constrained_gaussian type constructor for marginal-defined multivariate distributions #192

Closed
odunbar opened this issue Aug 24, 2022 · 1 comment
Assignees

Comments

@odunbar
Copy link
Collaborator

odunbar commented Aug 24, 2022

Purpose

To extend constrained_gaussian constructor to multivariate distributions, having the same constraints in every dimension. It's useful for helping to define multidimensional problems defined from marginals that arise quite often

Currently

we have

constrained_gaussian("name", mean, var, lower_bound, upper_bound)

Which finds comp_mean, comp_var based on the constraints implied by the bounds

ParameterDistribution(
    Dict(
        "distribution" => Parameterized(Normal(comp_mean, comp_var)),
        "constraint" => <implied by bounds>,
        "name" => "name",
    )
)

Extension

Called by

constrained_gaussian("name", mean, var, lower_bound, upper_bound, repeat=12)

That would produce

ParameterDistribution(
    Dict(
        "distribution" => VectorOfParameterized(repeat([Normal(comp_mean, comp_var)],12)),
        "constraint" => repeat([<implied by bounds>],12)
        "name" => "name",
    )
)
@odunbar odunbar self-assigned this Aug 24, 2022
bors bot added a commit that referenced this issue Aug 30, 2022
196: ParameterDistributions.jl improvements r=odunbar a=odunbar

## Purpose 
Fixes #184 and #192, also small update to remove warning in DataContainers/ParameterDistributions test. This works towards a better interface for ParameterDistributions. 

## Content
- Extending `constrained_gaussian` to multidimensional distirbutions by adding a `repeats=N` keyword with `N=1` default.
- Adds Types constraints into `NoConstraint` `BoundedBelow` `BoundedAbove` and `Bounded`
- Adds "parameters" to constraints, containing a Dict (or nothing). allows extraction of values of interest. for example 
`x = bounded_below(3.0)`  stores  `x.parameters = Dict("lower_bound" => 3.0)`
- extending `==` to Constraints (based on the above `parameters` and `Types`, as constraints are functions so hard to equate) 
- extending `==` to ParameterDistributions for easier testing calls
- Miscellaneous: Removed the `MvNormal(int,real)` calls that are now deprecated, replacing with `MvN(zeros(int), real*I)`



Co-authored-by: odunbar <[email protected]>
@ilopezgp
Copy link
Contributor

Closed by #196

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

2 participants