Hi. I am working on paper on post inference prior swapping to predict the year of song using bayesian linear regression.
Initially i am using prior as normal model and trying to compute posterior based on the data.
‘Year ~ F1 + F6 + F3 + F63 + F40 + F7’ . This are the features.
Context for the model
with pm.Model() as normal_model:
# The prior for the model parameters will be a normal distribution
family = pm.glm.families.Normal()
# Creating the model requires a formula and data (and optionally a family)
pm.GLM.from_formula(formula, data = X_train, family = family)
# Perform Markov Chain Monte Carlo sampling
normal_trace = pm.sample(draws=2000, chains = 10)
The X_train data size is 463715.
As per the paper post inference prior swapping they have given the following
Our first set of experiments are on Bayesian linear regression models, which we can write as yi = Xiθ) N (0, σ2)
I am getting the following error when i run the model
ValueError: Mass matrix contains zeros on the diagonal.
The derivative of RV sd_log__
.ravel()[0] is zero.
The derivative of RV F7
.ravel()[0] is zero.
The derivative of RV F40
.ravel()[0] is zero.
The derivative of RV F63
.ravel()[0] is zero.
The derivative of RV F3
.ravel()[0] is zero.
The derivative of RV F6
.ravel()[0] is zero.
The derivative of RV F1
.ravel()[0] is zero.
The derivative of RV Intercept
.ravel()[0] is zero.
Some one please help why this error is coming.