Skip to content

fix #2108 #2110

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

Merged
merged 3 commits into from
May 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pymc3/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,8 @@ def init_nuts(init='ADVI', njobs=1, n_init=500000, model=None,
progressbar=progressbar
) # type: pm.MeanField
start = approx.sample(draws=njobs)
cov = approx.cov.eval()
Copy link
Member

@ferrine ferrine May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's more pretty

stds = mf.gbij.rmap((tt.diag(mf.cov).eval()))
cov = model.dict_to_array(stds)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! I will go with this.
If I understand correctly the posterior cov of advi is a diagonal matrix right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

stds = approx.gbij.rmap(np.diag(approx.cov.eval()))
cov = model.dict_to_array(stds)
if njobs == 1:
start = start[0]
elif init == 'advi_map':
Expand Down