Skip to content

Commit 910c3f9

Browse files
authored
Matern Covariance Documentation
1 parent 9629256 commit 910c3f9

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

pymc/gp/cov.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,13 +617,27 @@ def full_from_distance(self, dist: TensorLike, squared: bool = False) -> TensorV
617617

618618
class Matern52(Stationary):
619619
r"""
620-
The Matern kernel with nu = 5/2.
620+
The Matérn kernel with :math:`\nu = \frac{5}{2}`.
621621
622622
.. math::
623623
624624
k(x, x') = \left(1 + \frac{\sqrt{5(x - x')^2}}{\ell} +
625625
\frac{5(x-x')^2}{3\ell^2}\right)
626626
\mathrm{exp}\left[ - \frac{\sqrt{5(x - x')^2}}{\ell} \right]
627+
628+
Read more `here <https://en.wikipedia.org/wiki/Mat%C3%A9rn_covariance_function>`_.
629+
630+
Parameters
631+
----------
632+
input_dim : int
633+
The number of input dimensions
634+
ls : scalar or array, optional
635+
Lengthscale parameter :math:`\ell`; if `input_dim` > 1, a list or array of scalars.
636+
If `input_dim` == 1, a scalar.
637+
ls_inv : scalar or array, optional
638+
Inverse lengthscale :math:`1 / \ell`. One of `ls` or `ls_inv` must be provided.
639+
active_dims : list of int, optional
640+
The dimension(s) the covariance function operates on.
627641
"""
628642

629643
def full_from_distance(self, dist: TensorLike, squared: bool = False) -> TensorVariable:
@@ -657,12 +671,26 @@ def power_spectral_density(self, omega: TensorLike) -> TensorVariable:
657671

658672
class Matern32(Stationary):
659673
r"""
660-
The Matern kernel with nu = 3/2.
674+
The Matérn kernel with :math:`\nu = \frac{3}{2}`.
661675
662676
.. math::
663677
664678
k(x, x') = \left(1 + \frac{\sqrt{3(x - x')^2}}{\ell}\right)
665679
\mathrm{exp}\left[ - \frac{\sqrt{3(x - x')^2}}{\ell} \right]
680+
681+
Read more `here <https://en.wikipedia.org/wiki/Mat%C3%A9rn_covariance_function>`_.
682+
683+
Parameters
684+
----------
685+
input_dim : int
686+
The number of input dimensions
687+
ls : scalar or array, optional
688+
Lengthscale parameter :math:`\ell`; if `input_dim` > 1, a list or array of scalars.
689+
If `input_dim` == 1, a scalar.
690+
ls_inv : scalar or array, optional
691+
Inverse lengthscale :math:`1 / \ell`. One of `ls` or `ls_inv` must be provided.
692+
active_dims : list of int, optional
693+
The dimension(s) the covariance function operates on.
666694
"""
667695

668696
def full_from_distance(self, dist: TensorLike, squared: bool = False) -> TensorVariable:

0 commit comments

Comments
 (0)