Skip to content

replace optimisation function argument of find_MAP #396

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 2 commits into from
Nov 5, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion examples/gaussian_processes/GP-smoothing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
"def infer_z(smoothing):\n",
" with model:\n",
" smoothing_param.set_value(smoothing)\n",
" res = pm.find_MAP(vars=[z], fmin=optimize.fmin_l_bfgs_b)\n",
" res = pm.find_MAP(vars=[z], method=\"L-BFGS-B\")\n",
" return res[\"z\"]"
]
},
Expand Down
4 changes: 2 additions & 2 deletions myst_nbs/gaussian_processes/GP-smoothing.myst.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Let's also make a helper function for inferring the most likely values of $z$:
def infer_z(smoothing):
with model:
smoothing_param.set_value(smoothing)
res = pm.find_MAP(vars=[z], fmin=optimize.fmin_l_bfgs_b)
res = pm.find_MAP(vars=[z], method="L-BFGS-B")
return res["z"]
```

Expand Down Expand Up @@ -155,7 +155,7 @@ title(f"Smoothing={smoothing}");

### Smoothing "to the limits"

By increasing the smoothing parameter, we can gradually make the inferred values of the hidden Brownian motion approach the average value of the data. This is because as we increase the smoothing parameter, we allow less and less of the variance to be allocated to the Brownian motion, so eventually it approaches the process which almost doesn't change over the domain of $x$:
By increasing the smoothing parameter, we can gradually make the inferred values of the hidden Brownian motion approach the average value of the data. This is because as we increase the smoothing parameter, we allow less and less of the variance to be allocated to the Brownian motion, so eventually it approaches the process which almost doesn't change over the domain of $x$:

```{code-cell} ipython3
fig, axes = subplots(2, 2)
Expand Down