LKJCholeskyCov with different standard deviation distributions

Hi!

I am trying to implement a model with a Multivariate Normal likelihood and I am estimating the covariance matrix using the LKJCholeskyCov prior. However, I would like to define a different distribution for each one of the standard deviations. I read in the documentation that the sd_dist parameter must be a positive scalar or vector distribution for the standard deviations. So, I am defining a different distribution for each one and I am combining them using at.stack.

Here is the code:

with pm.Model() as model:
  sigmas_dists= [ pm.InverseGamma.dist(alpha= 40, beta=80), pm.InverseGamma.dist(alpha= 100, beta=500) ]
  stds = at.stack( sigmas_dists )  
    
  
  packed_L = pm.LKJCholeskyCov('packed_L', n=2, eta=2., sd_dist= stds , compute_corr=False)
  L = pm.expand_packed_triangular(2, packed_L)
  cov = L.dot(L.T) 
  
  ...

But I am getting the following error

TypeError: sd_dist must be a scalar or vector distribution variable

What am I doing wrong?

Thank you in advance!

Try

stds= pm.InverseGamma.dist(alpha= [40, 100], beta=[80, 500]) 
    
1 Like

It works! Thanks!