Hi, I’m new to PyMC3, working on fitting a hierarchical Bayes mixed logit model using the yogurt data. Specifically, I have the following code so far
Yogurt_Model = pm.Model() with Yogurt_Model: mu = pm.MvNormal('mu', mu = mu_mean, cov = mu_cov, shape = len(mu_mean)) packed_L = pm.LKJCholeskyCov('packed_L', n = 3, eta = 2., sd_dist = pm.HalfCauchy.dist(2.0)) L = pm.expand_packed_triangular(3,packed_L) alpha = pm.MvNormal('alpha', mu = mu, chol = L, shape = (4,len(mu_mean)))
Now my alpha matrix has 4 x 3 dimension. After this step, I’d like to expand alpha matrix vertically to repeat first alpha row 5 times, second alpha row 2 times, third alpha row 3 times, and fourth alpha row 3 times. Could anyone show me a quick way of doing that instead of using for loop?