You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the arguments for the function az.from_pystan() is "observed_data". According to the docs "observed data" is extracted from the posterior.data.
My Stan model uses the "transformed data"-section extensively and I would like to extract variables defined here intoaz.InferenceData-object.
Is it possible to make sure that also the data from "transformed data" can be selected for "observed data"?
The corresponding error-log:
File "/Users/HJA/PycharmProjects/ufc/scripts/sample.py", line 58, in sample
return az.from_pystan(
File "/Users/HJA/opt/anaconda3/envs/ufc/lib/python3.10/site-packages/arviz/data/io_pystan.py", line 1079, in from_pystan
).to_inference_data()
File "/Users/HJA/opt/anaconda3/envs/ufc/lib/python3.10/site-packages/arviz/data/io_pystan.py", line 609, in to_inference_data
obs_const_dict = self.observed_and_constant_data_to_xarray()
File "/Users/HJA/opt/anaconda3/envs/ufc/lib/python3.10/site-packages/arviz/data/base.py", line 65, in wrapped
return func(cls)
File "/Users/HJA/opt/anaconda3/envs/ufc/lib/python3.10/site-packages/arviz/data/base.py", line 65, in wrapped
return func(cls)
File "/Users/HJA/opt/anaconda3/envs/ufc/lib/python3.10/site-packages/arviz/data/io_pystan.py", line 573, in observed_and_constant_data_to_xarray
vals = np.atleast_1d(posterior_model.data[key])
KeyError: 'y1'
The text was updated successfully, but these errors were encountered:
Are we talking about pystan 2.x or 3.x? I need to refresh my memory (I nowdays mostly use cmdstanpy), but if the transformed data is available then we can pull it from the sampling object.
Hi,
One of the arguments for the function
az.from_pystan()
is "observed_data". According to the docs "observed data" is extracted from theposterior.data
.My Stan model uses the "transformed data"-section extensively and I would like to extract variables defined here into
az.InferenceData
-object.Is it possible to make sure that also the data from "transformed data" can be selected for "observed data"?
The corresponding error-log:
The text was updated successfully, but these errors were encountered: