class tinygp.solvers.QuasisepSolver(X: tinygp.helpers.JAXArray, matrix: tinygp.solvers.quasisep.core.SymmQSM, factor: tinygp.solvers.quasisep.core.LowerTriQSM)[source]#

Bases: tinygp.solvers.solver.Solver

A scalable solver that uses quasiseparable matrices

Take a look at the documentation for the solvers.quasisep package, for more technical details.

You generally won’t instantiate this object directly but, if you do, you’ll probably want to use the QuasisepSolver.init() method instead of the usual constructor.

condition(kernel: Kernel, X_test: Optional[JAXArray], noise: Noise) Any[source]#

Compute the covariance matrix for a conditional GP

In the case where the prediction is made at the input coordinates with a tinygp.kernels.quasisep.Quasisep kernel, this will return the quasiseparable representation of the conditional matrix. Otherwise, it will use scalable methods where possible, but return a dense representation of the covariance, so be careful when predicting at a large number of test points!

  • kernel – The kernel for the covariance between the observed and predicted data.

  • X_test – The coordinates of the predicted points. Defaults to the input coordinates.

  • noise – The noise model for the predicted process.

covariance() tinygp.helpers.JAXArray[source]#

The evaluated covariance matrix

dot_triangular(y: tinygp.helpers.JAXArray) tinygp.helpers.JAXArray[source]#

Compute a matrix product with the lower triangular linear system

If the covariance matrix is K = L @ L.T for some lower triangular matrix L, this method returns L @ y for some y.

classmethod init(kernel: tinygp.kernels.base.Kernel, X: tinygp.helpers.JAXArray, noise: tinygp.noise.Noise, *, covariance: Optional[Any] = None, assume_sorted: bool = False) QuasisepSolver[source]#

Build a QuasisepSolver for a given kernel and coordinates

  • kernel – The kernel function. This must be an instance of a subclass of tinygp.kernels.quasisep.Quasisep.

  • X – The input coordinates.

  • noise – The noise model for the process.

  • covariance – Optionally, a pre-computed tinygp.solvers.quasisep.core.QSM with the covariance matrix.

  • assume_sorted – If True, assume that the input coordinates are sorted. If False, check that they are sorted and throw an error if they are not. This can introduce a runtime overhead, and you can pass assume_sorted=True to get the best performance.

normalization() tinygp.helpers.JAXArray[source]#

The multivariate normal normalization constant

This should be (log_det + n*log(2*pi))/2, where n is the size of the covariance matrix, and log_det is the log determinant of the matrix.

solve_triangular(y: tinygp.helpers.JAXArray, *, transpose: bool = False) tinygp.helpers.JAXArray[source]#

Solve the lower triangular linear system defined by this solver

If the covariance matrix is K = L @ L.T for some lower triangular matrix L, this method solves L @ x = y for some y. If the transpose parameter is True, this instead solves L.T @ x = y.

variance() tinygp.helpers.JAXArray[source]#

The diagonal of the covariance matrix