invenia / invenia/KeyedDistributions.jl

Have `rekey` update the keys of the distribution parameters to match the KeyedDistribution

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Julia
Stars
4
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Noted in https://github.com/invenia/KeyedDistributions.jl/pull/15:

> If the parent distribution is constructed with a KeyedArray but the KeyedDistribution is given a new set of keys there is no expectation that these should match, e.g.

```
ka = KeyedArray(ones(3); id=[:a, :b, :c])

kd = KeyedDistribution(MvNormal(ka), [:x, :y, :z])
```

I don't think this explicitly goes against documentation, so not a bug. Maybe against the principles of the package - `AxisKeys` and `AxisSets` don't allow inconsistent keys, but there isn't a direct analogy to this, where some inner type (array) and the outer type should have the same keys but they are able to differ.

In any case, it would be useful to check. We could just add the option for `rekey` to update the "inner" keys to match the "outer" keys.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the `rekey` operation and the `KeyedDistribution` construction shown in the issue, including how a `KeyedArray` is used as the parent distribution. Determine how an option should synchronize the inner distribution parameters with the outer keys. Done means `rekey` can make the parameter keys match the `KeyedDistribution` keys without changing the default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.