Skip to content

add docs for interpretation of length scales in periodic kernel #3989

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 4 commits into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
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
env/
9 changes: 9 additions & 0 deletions pymc3/gp/cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,15 @@ class Periodic(Stationary):

.. math::
k(x, x') = \mathrm{exp}\left( -\frac{\mathrm{sin}^2(\pi |x-x'| \frac{1}{T})}{2\ell^2} \right)

The interpretation of length-scale for this kernel is different than the
one used normally (see [1]_). Priors on length scale must be put keeping
this in mind.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The interpretation of length-scale for this kernel is different than the
one used normally (see [1]_). Priors on length scale must be put keeping
this in mind.
The scaling factor for this kernel is different compare to the other standard
definition (see [1]_), thus change the interpretation of length-scale in a subtle
way. Please keep that in mind when you are defining priors on length scale,
especially when you are trying to replicate other results.
You can divided the length-scale by 2 in the kernel initialization to recover the
standard definition.

@bwengals is this correct?

Copy link
Contributor

@bwengals bwengals Jul 9, 2020

Choose a reason for hiding this comment

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

If I read that it's different, how should one interpret it? I think it'd be good to be specific.

Also small wording suggestion, how does this sound?

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, 4. Divide the length-scale by 2 when initializing the kernel to recover the standard definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for not replying earlier. I missed @bwengals's reply.

Here, 0.5 is in the exponent instead of the more common value, 4.

I think what you meant here was:

Here, 0.5 is in the exponent instead of the more common value, 2.

Right?

Copy link
Contributor

Choose a reason for hiding this comment

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

whoops, yep you're right!


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