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

Require new parameter type for "vector of parameterized" distributions #142

Closed
odunbar opened this issue Apr 8, 2022 · 0 comments · Fixed by #145
Closed

Require new parameter type for "vector of parameterized" distributions #142

odunbar opened this issue Apr 8, 2022 · 0 comments · Fixed by #145
Assignees
Labels
enhancement New feature or request

Comments

@odunbar
Copy link
Collaborator

odunbar commented Apr 8, 2022

Issue

Currently Parameterized has limitations to types that Julia specified. A new type that appears in practice e.g. for specifying independent priors for a function at 100 points, we may wish to define

distribution = repeat([Parameterized(Normal(0,1))],100)
constraint = repeat([no_constraint()],100)
name = "function_at_100_points"

Our current setup can do either

  1. replace repeat([Parameterized(Normal(0,1))],100) with a single Parameterized(MvNormal(100,1.0)). This is restrictive to only Multivariate distributions from Distributions
  2. replace name with the array of names name = [string("function_at_point_",i) for i =1:100]. This means that each of the 100 distributions have different names, and may require additional parsing.

Proposal: VectorOfParameterized distribution type

distribution = VectorOfParameterized( repeat([Normal(0,1)],100) )
constraint = repeat([no_constraint()],100)
name = "function_at_100_points"

when provided with corresponding functions sample/var/cov etc. this fits within the current framework. The stacked distributions can have different priors and be different dimensions.

@odunbar odunbar added the enhancement New feature or request label Apr 8, 2022
@odunbar odunbar self-assigned this Apr 8, 2022
bors bot added a commit that referenced this issue Apr 18, 2022
145: [WIP] VectorOfParameterized distribution type r=odunbar a=odunbar

## Purpose
Resolves #142 

## In the PR
- New `VectorOfParameterized` distribution struct. Can create a single distribution from an array of (possibly different, univariate and multivariate) Distributions from `Distributions.jl` 
- Accompanying sampling/statistical/shape functions
- Unit tests
- Docs in parameter distributions
## Also
- removed a bug where input dictionary is modified
## Simple example
Creating a full `ParameterDistribution` from 100 univariate normals (e.g. often used in  parameters)
```julia
distribution = VectorOfParameterized(repeat([Normal(0,1)],100)
constraint = repeat([no_constraint()],100)
name = "100 normals"
ParameterDistribution(distribution, constraint, name)
```
Key observation: only one name is required for the distribution vector - this for example is a useful addition for parsing array-style parameterrs e.g. the representation and discretization of functions.

Co-authored-by: odunbar <[email protected]>
Co-authored-by: odunbar <[email protected]>
@bors bors bot closed this as completed in #145 Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant