Dear all,
I think I made some small mistake and I found the solution.
r = pm.StudentT(‘r’, nu, mu=mus, lam=1/np.exp(-2*corr), observed=returns.values[:-1])
change the np.exp to pm.math.exp will solve the error of sample posterior predictive after load .nc file.
Maybe due to numpy and pymc compatibility, so better standardise and use all pymc functions if possible.
Besides that, I found another mistake that done by me is as follow:
with pm.Model() as new_model:
y_test2 = pm.sample_posterior_predictive(loaded_model, samples=500, model=new_model)
since I defined new_model after load the .nc file.
I once again define new model by pm.Model() as new_model which overwrote my defined model.
So, it is a silly mistake by myself.
correct is
with new_model:
y_test2 = pm.sample_posterior_predictive(loaded_model, samples=500, model=new_model)