Skip to content

Commit

Permalink
add docs for interpretation of length scales in periodic kernel (pymc…
Browse files Browse the repository at this point in the history
…-devs#3989)

* fix the expression of periodic kernel

* revert change and add doc

* FIXUP: add suggested doc string

* FIXUP: revertchanges in .gitignore
  • Loading branch information
tirthasheshpatel authored Jul 17, 2020
1 parent 9e8975f commit 28a4621
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ benchmarks/results/
pytestdebug.log
.dir-locals.el
.pycheckers

11 changes: 11 additions & 0 deletions pymc3/gp/cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,17 @@ class Periodic(Stationary):
.. math::
k(x, x') = \mathrm{exp}\left( -\frac{\mathrm{sin}^2(\pi |x-x'| \frac{1}{T})}{2\ell^2} \right)
Notes
-----
Note that the scaling factor for this kernel is different compared to the more common
definition (see [1]_). Here, 0.5 is in the exponent instead of the more common value, 2.
Divide the length-scale by 2 when initializing the kernel to recover the standard definition.
References
----------
.. [1] David Duvenaud, "The Kernel Cookbook"
https://www.cs.toronto.edu/~duvenaud/cookbook/
"""

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

0 comments on commit 28a4621

Please sign in to comment.