Problem with LKJCholeskyCov in BVAR models

Thanks @ricardoV94!

In case anyone else ends up here, a simple workaround is to not set any dimensions on the observed variable, and after sampling, extend to the model with a new variable of the specified number of rows and sample from it using the same mean and chol parameters, like so:

new_data = np.zeros((1000, n_columns)) # New desired number of obs and the number of cols to match mvnorm

with test:

    # add a new variable
    new = pm.MvNormal('new', mu=μ, chol=chol, observed=new_data)

    # sample
    predictions = pm.sample_posterior_predictive(idata, var_names=['new'], predictions=True)
1 Like