runlmc.kern.std_periodic module

class runlmc.kern.std_periodic.StdPeriodic(inv_lengthscale=1, period=1, name='std_periodic', active_dims=None)[source]

Bases: runlmc.kern.stationary_kern.StationaryKern

This class defines the standard periodic kernel \(k\).

\[k(r) = \exp \left(\frac{-\gamma}{2}\sin^2 \frac{\pi r}{T}\right)\]
Parameters:
from_dist(dists)[source]
Parameters:distsN-size numpy array of positive (Euclidean) distances.
Returns:kernel value at each of the given distances
kernel_gradient(dists)[source]

Let this kernel be parameterized by some parameters \(\boldsymbol\theta\in\mathbb{R}^p\). For every \(\theta_j\in\boldsymbol\theta\), at any given distance \(d\), we can compute the derivative \(\partial_{\theta_j}k(d)\). For the evaluation of this partial derivative at multiple places, \(\textbf{d}\), we call the vector of partial derivatives \(\partial_{\theta_j}k(\textbf{d})\).

Parameters:dists – a one-dimensional array of distances corresponding to \(\textbf{d}\), above.
Returns:An iterable whose \(j\)-th entry is \(\partial_{\theta_j}k(\textbf{d})\).
to_gpy()[source]
Returns:GPy version of this kernel.
update_gradient(grad)[source]
Parameters:grad – a one-dimensional array, representing the gradient vector \(\nabla_{\boldsymbol\theta}L\) for the likelihood with respect to this kernel’s parameters, in the same order of parameters as the row order returned by kernel_gradient().