Skip to content

Commit 28a4621

Browse files
add docs for interpretation of length scales in periodic kernel (#3989)
* fix the expression of periodic kernel * revert change and add doc * FIXUP: add suggested doc string * FIXUP: revertchanges in .gitignore
1 parent 9e8975f commit 28a4621

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ benchmarks/results/
4141
pytestdebug.log
4242
.dir-locals.el
4343
.pycheckers
44+

pymc3/gp/cov.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,17 @@ class Periodic(Stationary):
353353
354354
.. math::
355355
k(x, x') = \mathrm{exp}\left( -\frac{\mathrm{sin}^2(\pi |x-x'| \frac{1}{T})}{2\ell^2} \right)
356+
357+
Notes
358+
-----
359+
Note that the scaling factor for this kernel is different compared to the more common
360+
definition (see [1]_). Here, 0.5 is in the exponent instead of the more common value, 2.
361+
Divide the length-scale by 2 when initializing the kernel to recover the standard definition.
362+
363+
References
364+
----------
365+
.. [1] David Duvenaud, "The Kernel Cookbook"
366+
https://www.cs.toronto.edu/~duvenaud/cookbook/
356367
"""
357368

358369
def __init__(self, input_dim, period, ls=None, ls_inv=None, active_dims=None):

0 commit comments

Comments
 (0)