Skip to content

Commit 43e4ed4

Browse files
committed
small updates to notebook
1 parent a8ade40 commit 43e4ed4

File tree

3 files changed

+74
-189
lines changed

3 files changed

+74
-189
lines changed

docs/source/notebooks/GP-Latent.ipynb

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"source": [
2020
"## `.prior`\n",
2121
"\n",
22-
"Concretely, what this means is that with some data set of finite size, the `prior` method places a multivariate normal prior distribution on the vector of function values, $\\mathbf{f}$,\n",
22+
"With some data set of finite size, the `prior` method places a multivariate normal prior distribution on the vector of function values, $\\mathbf{f}$,\n",
2323
"\n",
2424
"$$\n",
2525
"\\mathbf{f} \\sim \\text{MvNormal}(\\mathbf{m}_{x},\\, \\mathbf{K}_{xx}) \\,,\n",
@@ -42,10 +42,10 @@
4242
" gp = pm.gp.Latent(cov_func=cov_func)\n",
4343
" \n",
4444
" # Place a GP prior over the function f.\n",
45-
" f = gp.prior(\"f\", n_points=10, X=X)\n",
45+
" f = gp.prior(\"f\", X=X)\n",
4646
"```\n",
4747
"\n",
48-
"By default, PyMC3 reparameterizes the prior on `f` by rotating it with the Cholesky factor. This helps to reduce covariances in the posterior of the transformed GP, `v`. The reparameterized model is,\n",
48+
"By default, PyMC3 reparameterizes the prior on `f` under the hood by rotating it with the Cholesky factor of its covariance matrix. This helps to reduce covariances in the posterior of the transformed random variable, `v`. The reparameterized model is,\n",
4949
"\n",
5050
"$$\n",
5151
"\\begin{aligned}\n",
@@ -64,29 +64,23 @@
6464
"source": [
6565
"## `.conditional`\n",
6666
"\n",
67-
"The conditional method implements the \"predictive\" distribution for function values that were not part of the original data set. This distribution is,\n",
67+
"The conditional method implements the predictive distribution for function values that were not part of the original data set. This distribution is,\n",
6868
"\n",
6969
"$$\n",
7070
"\\mathbf{f}_* \\mid \\mathbf{f} \\sim \\text{MvNormal} \\left(\n",
7171
" \\mathbf{m}_* + \\mathbf{K}_{*x}\\mathbf{K}_{xx}^{-1} \\mathbf{f} ,\\,\n",
7272
" \\mathbf{K}_{**} - \\mathbf{K}_{*x}\\mathbf{K}_{xx}^{-1}\\mathbf{K}_{x*} \\right)\n",
7373
"$$\n",
7474
"\n",
75-
"Using the same `gp` object we defined above, this is specified as,\n",
75+
"Using the same `gp` object we defined above, we can construct a random variable with this\n",
76+
"distribution by,\n",
7677
"\n",
7778
"```python\n",
7879
"# vector of new X points we want to predict the function at\n",
7980
"X_star = np.linspace(0, 2, 100)[:, None]\n",
8081
"\n",
8182
"with latent_gp_model:\n",
8283
" f_star = gp.conditional(\"f_star\", n_points=100, X_star)\n",
83-
"```\n",
84-
"\n",
85-
"If `gp` is part of a sum of GP objects, it can be conditioned on different components of that sum using the optional keyword argument `given`,\n",
86-
"\n",
87-
"```python\n",
88-
" f_star_diff = gp.conditional(\"f_star_diff\", n_points=100, X_star, \n",
89-
" gp=a_different_gp)\n",
9084
"```"
9185
]
9286
},

0 commit comments

Comments
 (0)