Modifying fit object (renaming, removing pars, etc.)

I’m fitting some Stan models that uses matrix formulation for predictors. I would like to rename parameters after the fit (e.g. beta[0] ) and remove NaN and redundant parameters (e.g. upper and lower triangle from the correlation matrix). Hence is there a way to perform these changes from pystan on the fitted object while keeping the structure of the fitted object ?

In short, no. I bet you will break something while doing this.

For post processing, this could be implemented with numpy/scipy.

Sparse structure could be interesting property to be implemented in ArviZ if it is needed.

OK that was what I was afraid of, too bad.

I think that would be a nice feature in Arviz because for example I can’t use some Arviz function with parameters with nan n_eff (induced by matrix formulation).

Hi,

I added issue to address this https://github.com/arviz-devs/arviz/issues/549

Could comment on the issue what functions did you have problems with?

Hi,

I think with basically all functions, but I will comment with a sample of the errors I get.

For those who have the same issue, I figured out that you can use arviz to at least rename your index based parameters.

fitaz = az.from_pystan(posterior=fit, coords={'b': ['A','B', 'C', 'D']}, dims={'beta': ['b']})