-
-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replacing PyMC3 plots w/ Arviz plots & sigma Param change [Part 1] #27
Replacing PyMC3 plots w/ Arviz plots & sigma Param change [Part 1] #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is great!
Small roadmap question, what is the plan on using return_inferencedata=True
regarding examples?
pm.traceplot( | ||
az.plot_trace( | ||
trace, varnames=["mu", "r"], lines={"mu": mu_r, "r": corr_r[np.triu_indices(n_var, k=1)]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am quite sure arviz does not accept varnames
, it should be var_names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, correct! Thanks for that. I updated to arviz 0.11
, and got this error
y:212: UserWarning: A valid var_name should be provided, found {'m'} expected from {'mu', 'r'}
warnings.warn(
Traceback (most recent call last):
File "LKJ_correlation.py", line 62, in <module>
run()
File "LKJ_correlation.py", line 56, in run
az.plot_trace(
File "/Users/CloudChaoszero/opt/anaconda3/envs/pymc3-dev-py38/lib/python3.8/site-packages/arviz/plots/traceplot.py", line 238, in plot_trace
axes = plot(**trace_plot_args)
File "/Users/CloudChaoszero/opt/anaconda3/envs/pymc3-dev-py38/lib/python3.8/site-packages/arviz/plots/backends/matplotlib/traceplot.py", line 384, in plot_trace
for _, _, vlines in (j for j in lines if j[0] == var_name and j[1] == selection):
File "/Users/CloudChaoszero/opt/anaconda3/envs/pymc3-dev-py38/lib/python3.8/site-packages/arviz/plots/backends/matplotlib/traceplot.py", line 384, in <genexpr>
for _, _, vlines in (j for j in lines if j[0] == var_name and j[1] == selection):
IndexError: string index out of range
(This error looks related arviz-devs/arviz#988)
Any thoughts why this happened?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I found out why now. It's due to the lines
param.
az.plot_trace(
trace, varnames=["mu", "r"], lines={"mu": mu_r, "r": corr_r[np.triu_indices(n_var, k=1)]}
...
I removed it to make the az.plot_trac()
work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try
lines=(("mu", {}, mu_r), ("r", {}, corr_r[np.triu_indices(n_var, k=1)]))
Yeah @OriolAbril ! I was hoping to get these ~9 PRs merged into the repo, and the proceed into that.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That timeline sounds great @CloudChaoszero! Thanks!
Description
The following is a large PR breakdown of PR #16.
Replace PyMC3 dependent plots with arviz plots in case studies & examples.
Replace parameter
sd
withsigma
(e.g. some examples havepm.Normal(...sd=...)