.. index:: pair: group; Scalar surrogate and parameter search (ABI 1.26) .. _doxid-group__gpr__capi__sgp: Scalar surrogate and parameter search (ABI 1.26) ================================================ .. toctree:: :hidden: A :ref:`gpr_sgp_t ` is a Gaussian process on a ``dimension`` -dimensional parameter vector with one scalar output, for an oracle that returns a value and, optionally, the variance of its noise. The kernel is a radial shape of the scaled Euclidean distance with one length scale per coordinate. A :ref:`gpr_psearch_t ` minimizes such an oracle over a box by ask and tell: the caller reports evaluated rows and receives the next batch to evaluate. Kernel. Both handles take a :ref:`gpr_bq_kernel_t ` value and accept GPR_BQ_KERNEL_SE, GPR_BQ_KERNEL_MATERN32_ISOTROPIC and GPR_BQ_KERNEL_MATERN52_ISOTROPIC. The product kernels are refused with GPR_ERR_UNSUPPORTED. Noise. Rows are observed either all with a noise variance each or all without one. Without, every row shares the noise variance hyperparameter. A call that would mix the two returns GPR_ERR_INVALID_ARG. Ownership. A create call returns a handle that the caller owns until it passes it to the matching destroy call. Every pointer argument is read or written during the call and stays with the caller. Arrays are row-major, one row per point, and every length counts elements. Single writer. A handle has one writer at a time. A destroyed handle is refused: a second destroy sets GPR_ERR_INVALID_ARG in :ref:`gpr_last_status() `, and any other call returns GPR_ERR_NULL_HANDLE (gpr_sgp_n_observations returns 0). Failure. Every function that returns int, except gpr_sgp_n_observations, returns GPR_SUCCESS (0) or a negative status, leaves its outputs unwritten on failure and keeps the previous state of the handle. GPR_ERR_CHOLESKY means a covariance did not factor, GPR_ERR_OPTIMIZER that no start of a hyperparameter fit had a finite likelihood, and GPR_ERR_NOT_TRAINED that the call needs observations, a fit or a feasible observation that the handle does not have yet.