`LKJCholeskyCov` requires `dist_params`? (v4.0)

As a follow up to a previous question, I stumbled over a problem with LKJCholeskyCov.
(note that I am running on v4.0 in order to solve the previous issue in posterior predictive sampling)

Apparently distributions/multivariate.py/_LKJCholeskyCov should be initialized with dist_params in the LKJCholeskyCov wrapper. That dist_params should be some “RandomVariable” “Op” and requires a ndim_supp, among other things.
However, I don’t understand what to put there and cannot figure out from the aesara or pymc code which is involved. So far I found no example with the latest implementation of LKJCholeskyCov, and I would guess this affects the LKJ examples in the docs which will probably not work with the current build (acknowledged: it is a dev build).

Is there an example which shows what to enter as dist_params?

Minimal example:

import pymc3 as pm
with pm.Model() as model:
    packed_cholesky = pm.LKJCholeskyCov( f'pchol' , n = 2 , eta = 1. , sd_dist = pm.HalfCauchy.dist(1.))
    vals = pm.MvStudentT('vals', mu=intercept_shared, chol=packed_cholesky, nu = dof, observed = data)

pymc version: ‘4.0’
traceback:

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "pymc3/pymc3/distributions/multivariate.py", line 1346, in LKJCholeskyCov
    packed_chol = _LKJCholeskyCov(name, eta=eta, n=n, sd_dist=sd_dist)
  File "/pymc3/pymc3/distributions/distribution.py", line 216, in __new__
    rv_out = cls.dist(*args, rng=rng, **kwargs)
TypeError: dist() missing 1 required positional argument: 'dist_params'

Hi
I think the Pull Request that refactors LKJCholeskyCov has not been merged into main/v4 branch yet.

1 Like

Oh, fantastic, thank you for the pointer @Sayam753 ! I’ll try to merge it locally and see if I can work on.

There’s been so much great work towards v4 already, looking forward to the release :slight_smile:
Kudos to all the devs!

1 Like