Thanks a lot for your reply.
I would like to avoid using the piece of script you provided above, as it increases the runtime. Just for context, I am running a Hierarchical Bayesian Model with several units and I need a correlation matrix per unit. Using the beta spike appeared as a computationally cheaper approach.
At the moment, the correlation matrix per unit is 5x5. The beta spike method didnt work even when running the model for just 1 unit. I should also mention that testing LKJ_sd_dist=pm.Beta.dist(2,2) also lead to “Bad initial energy”. I am posting the model below (please note that my data has been standardized):
LKJ_sd_dist=pm.Beta.dist(10** 3,10**-3)
eta=2with pm.Model() as train_model:
chol_packed = pm.LKJCholeskyCov(‘chol_packed’, n=data.shape[1], eta=eta, sd_dist=LKJ_sd_dist)
chol = pm.expand_packed_triangular(n=data.shape[1], packed=chol_packed)
obs = pm.MvNormal(‘obs’, mu=0, chol=chol, observed=data)