I would like to produce random covariance matrices in order to make pairwise comparison between them. I am looking for chances of accidental similarity. These random matrices would be inspired by experimental covariance matrices, so I would like to infer the joint sd and eta parameters and make posterior predictions along the lines shown below.
I do not know how to feed multiple observed matrices to LKJCholeskyCov distribution, I get a dimension error when I trying to use more than one packed Ls.
The LKJCholeskyCov distribution does not have a random function therefore the sample_ppc does not work. This would not be problem if sd is recorded in the trace, but I do not know how to achieve that in this example.
I wonder if there are solutions or workarounds for these problems. Does it make sense what I am trying to do?
with pm.Model() as model:
packed_L = pm.LKJCholeskyCov(‘packed_L’, n=3, eta=eta, sd_dist=sd, observed=obs)
trace = pm.sample()
obs looks something like this:
array([[ 9.860e-02, -1.310e-02, 9.990e-02, 1.850e-02, -1.190e-02,
[ 9.020e-02, -1.310e-02, 1.003e-01, 2.340e-02, -1.660e-02,
[ 1.069e-01, -2.400e-03, 8.370e-02, 2.360e-02, -8.800e-03,
[ 8.000e-04, 0.000e+00, 2.400e-03, 1.000e-04, -1.000e-04,
[ 7.000e-04, 0.000e+00, 2.200e-03, 3.000e-04, 0.000e+00,
[ 1.100e-03, 0.000e+00, 1.800e-03, -1.000e-04, 2.000e-04,