API documentation

class specgp.terms.KronTerm(term, **kwargs)

A Kronecker-structured covariance matrix of the form

\[K = \Sigma + T \otimes R\]

with T defined by a celerite term and R either an outer product of the form

\[R = \alpha\ \alpha^\mathrm{T}\]

or an arbitrary covariance matrix.

Parameters:
  • term (Term) – A celerite term.
  • alpha or R (tensor) – a vector if alpha or matrix if R. If alpha is provided the matrix R is defined as the outer product of alpha with itself and the correlation between the GPs is a simple scaling relation with the scale factors given by the entries in alpha.
posdef(x, diag)

Check to determine postive definiteness of the Kronecker-structured covariance matrix. This operation is slow, and is thus not recommended to be called repeatedly as a check during optimization. Rather, the user should use this function as a guide to ensuring positive definiteness of the model for varying values of the kernel parameters.

Parameters:
  • x (tensor) – The input coordinates.
  • diag (tensor) – The white noise variances. This should be an NxM array where N is the length of x and M is the size of alpha.
Returns:

A boolean that is True if the covariance matrix

is positive definite and False otherwise. The user will need to call isposdef.eval() to compute the returned value from the theano tensor variable.

Return type:

isposdef

psd(omega)

The power spectrum of the Kronecker-structured kernel.

Parameters:omega (tensor) –

A vector of frequencies.

Returns:
psd: A matrix with each row the power spectrum
for one of the correlated processes.
value(tau)

This is not yet implemented, meaning that computing the GP prediction for a 2D GP won’t work. This will be implemented in an upcoming release.

class specgp.distributions.MvUniform(lower, upper, *args, **kwargs)

A multivariate uniform distribution.

Parameters:
  • lower – an array of lower bounds
  • upper – an array of upper bounds
class specgp.means.KronMean(values)

A constant mean for use with Kronecker-structured kernels.

Parameters:values (tensor) – A matrix with each row containing the mean for each of the correlated processes.