class lcgp.LCGP(y: ~numpy.ndarray | None = <class 'tensorflow.python.framework.tensor.Tensor'>, x: ~numpy.ndarray | None = <class 'tensorflow.python.framework.tensor.Tensor'>, q: int = None, var_threshold: float = None, diag_error_structure: list = None, parameter_clamp_flag: bool = False, robust_mean: bool = True, submethod: str = 'full', rep_standardize_ybar: bool = True, verbose: bool = False)[source]#

Latent Component Gaussian Process (LCGP)

Supports two training/prediction paths:
  • submethod=’full’: uses all observations (x, y)

  • submethod=’rep’ : groups replicated x rows, uses (x_unique, ybar) structures

compute_aux_predictive_quantities()[source]#

Compute auxiliary quantities for predictions using full posterior approach.

get_param()[source]#

Returns the parameters for LCGP instance.

init_params()[source]#

Initializes parameters for LCGP.

init_phi(var_threshold: float = None)[source]#

Initialization of orthogonal basis, computed with SVD. Uses ybar_s if replication, else y.

static init_standard_x(x)[source]#

Standardizes training inputs and collects summary information.

init_standard_y(y)[source]#

Standardizes outputs and collects summary information.

loss()[source]#

Computes the loss based on the submethod.

neglpost_rep()[source]#

Replicated negative log marginal (up to constants), matching your working rep file.

predict_full(x0, return_fullcov=False)[source]#

Returns predictions using full posterior approach.

preprocess(y_raw=None, x_raw=None)[source]#

Returns a tuple of replication structures

tx_x(xs)[source]#

Reverts standardization of inputs.

tx_y(ys)[source]#

Reverts output standardization.

verify_dim(y, x)[source]#

Verifies if input and output dimensions match. Sets class variables for dimensions. Throws error if the dimensions do not match.

static verify_error_structure(diag_error_structure, y)[source]#

Verifies if diagonal error structure input, if any, is valid.

lcgp.Matern32(x1, x2, llmb, llmb0, lnug, diag_only: bool = False)[source]#

Returns the Matern 3/2 covariance matrix.

Parameters:
  • x1 – input 1 of size (number of inputs in x1, dimension of input)

  • x2 – input 2 of size (number of inputs in x2, dimension of input)

  • llmb – log-lengthscale hyperparameter for each dimension

  • llmb0 – log-scale hyperparameter

  • lnug – parameter to tune the nugget, nugget = exp(lnug) / (1 + exp(lnug))

  • diag_only – returns diagonal of covariance matrix if True. Default to False.

Returns:

covariance matrix of size (n1, n2)

lcgp.test(level=0)[source]#

Run full set of surmise tests.

Parameters:

level (int) – Smaller values indicate less logging

Returns:

True if all tests passed; False, otherwise.

Return type:

bool