Cosine#
- class tinygp.kernels.quasisep.Cosine(scale: JAXArray | float, sigma: JAXArray | float = <factory>)[source]#
Bases:
QuasisepA scalable implementation of
tinygp.kernels.stationary.CosineThis kernel takes the form:
\[k(\tau)=\sigma^2\,\cos(-2\,\pi\,\tau/\ell)\]for \(\tau = |x_i - x_j|\).
- Parameters:
scale – The parameter \(\ell\).
sigma (optional) – The parameter \(\sigma\). Defaults to a value of 1. Specifying the explicit value here provides a slight performance boost compared to independently multiplying the kernel with a prefactor.
- coord_to_sortable(X: tinygp.helpers.JAXArray) tinygp.helpers.JAXArray#
A helper function used to convert coordinates to sortable 1-D values
By default, this is the identity, but in cases where
Xis structured (e.g. multivariate inputs), this can be used to appropriately unwrap that structure.
- evaluate(X1: tinygp.helpers.JAXArray, X2: tinygp.helpers.JAXArray) tinygp.helpers.JAXArray#
The kernel evaluated via the quasiseparable representation
- evaluate_diag(X: tinygp.helpers.JAXArray) tinygp.helpers.JAXArray#
For quasiseparable kernels, the variance is simple to compute
- observation_model(X: tinygp.helpers.JAXArray) tinygp.helpers.JAXArray[source]#
The observation model for the process
- to_general_qsm(X1: tinygp.helpers.JAXArray, X2: tinygp.helpers.JAXArray) GeneralQSM#
The generalized quasiseparable representation of this kernel
- to_symm_qsm(X: tinygp.helpers.JAXArray) SymmQSM#
The symmetric quasiseparable representation of this kernel
- transition_matrix(X1: tinygp.helpers.JAXArray, X2: tinygp.helpers.JAXArray) tinygp.helpers.JAXArray[source]#
The adjoint transition matrix between two coordinates.
If a column-state mean propagates from
X1toX2asm2 = F @ m1, this method must returnF.T. Equivalently, tinygp’s Kalman implementation propagates means usingtransition_matrix(X1, X2).T @ m1.