Functions | |
| gpr_bq_t | gpr_bq_create (const gpr_bq_config_t *config) |
| Create a scalar GP / Bayesian quadrature handle. | |
| void | gpr_bq_destroy (gpr_bq_t bq) |
| Destroy a handle from gpr_bq_create. Destroying NULL or a live handle clears gpr_last_status() and gpr_last_error(), while preserving a pending GPR_ERR_ORACLE during cleanup. A handle that is already destroyed is not touched and sets GPR_ERR_INVALID_ARG in gpr_last_status(). | |
| int | gpr_bq_reset (gpr_bq_t bq, const gpr_bq_config_t *config) |
| Replace the configuration and drop every observation and any stored integration box. | |
| int | gpr_bq_dimension (gpr_bq_t bq) |
| Input dimension of the configuration; 0 for NULL or a dead handle. | |
| int | gpr_bq_n_observations (gpr_bq_t bq) |
| Number of stored observations; 0 for NULL or a dead handle. | |
| int | gpr_bq_n_lengthscales (gpr_bq_t bq) |
| Number of length scales: dimension when the configuration is ARD, otherwise 1; 0 for NULL or a dead handle. | |
| int | gpr_bq_train_checked (gpr_bq_t bq, const double *X, size_t X_len, const double *y, size_t y_len, const double *noise_var, size_t noise_var_len, int n_obs, int n_dims) |
| Train on n_obs points and infer the integration box from the training extrema. | |
| int | gpr_bq_train_bounded_checked (gpr_bq_t bq, const double *X, size_t X_len, const double *y, size_t y_len, const double *noise_var, size_t noise_var_len, const double *lower, size_t lower_len, const double *upper, size_t upper_len, int n_obs, int n_dims) |
| Train and store an explicit integration box. Each lower[d] is finite and strictly below upper[d], and every training coordinate lies in the closed interval. Null noise_var with a zero length stores zero noise, as gpr_bq_train_checked does. The box is kept for later refits and for appended rows. | |
| int | gpr_bq_append_checked (gpr_bq_t bq, const double *X_new, size_t X_len, const double *y_new, size_t y_len, const double *noise_var_new, size_t noise_var_len, int n_new, int n_dims, int refit) |
| Append n_new observations to a trained model. | |
| int | gpr_bq_fit_hyperparameters_checked (gpr_bq_t bq, gpr_bq_hyper_mode_t mode, gpr_bq_fit_report_t *report, double *lengthscales_out, size_t lengthscales_len) |
| Re-infer the hyperparameters of a trained model with the given treatment, which then becomes the configured treatment. | |
| int | gpr_bq_get_lengthscales_checked (gpr_bq_t bq, double *out, size_t out_len) |
| Copy the current length scales out. | |
| int | gpr_bq_set_lengthscales_checked (gpr_bq_t bq, const double *values, size_t values_len) |
| Pin the length scales. A trained model is rebuilt with them held and the signal variance kept at its current value; the observations and the configured hyperparameter treatment stay unchanged. | |
| int | gpr_bq_get_magn_sigma2 (gpr_bq_t bq, double *out) |
| Signal variance of the posterior (squared output unit). out receives one double. | |
| int | gpr_bq_set_magn_sigma2 (gpr_bq_t bq, double value) |
| Pin the signal variance. A trained model is rebuilt with it held and the length scales kept (an ARD set stays anisotropic); the configured hyperparameter treatment stays unchanged. | |
| int | gpr_bq_get_extra_sigma2 (gpr_bq_t bq, double *out) |
| Extra observation-noise variance added to every observation. out receives one double. | |
| int | gpr_bq_set_extra_sigma2 (gpr_bq_t bq, double value) |
| Set the extra observation-noise variance. A trained model is refit with its configured hyperparameter treatment. | |
| int | gpr_bq_predict_batch_checked (gpr_bq_t bq, const double *X_queries, size_t X_len, double *mean_out, size_t mean_len, double *var_out, size_t var_len, int n_queries, int n_dims) |
| Posterior mean and variance at n_queries points. | |
| int | gpr_bq_kernel_mean_checked (gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper, size_t upper_len, const double *X, size_t X_len, int n_points, int n_dims, double *z_out, size_t z_len) |
| Kernel mean z_i = integral over the box [lower, upper] of k(x, X_i) dx, at the training points or at explicit points. | |
| int | gpr_bq_kernel_double_integral_checked (gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper, size_t upper_len, int n_dims, double *omega_out) |
| Kernel double integral of k over the box, written to *omega_out (output unit squared times volume squared). Same readiness rule as gpr_bq_kernel_mean_checked. | |
| int | gpr_bq_integrate_checked (gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper, size_t upper_len, int n_dims, double *mean_out, double *var_out) |
| Integral mean and variance over a box. Equivalent to gpr_bq_integrate_report_checked keeping only mean and variance. | |
| int | gpr_bq_integrate_report_checked (gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper, size_t upper_len, int n_dims, gpr_bq_integral_report_t *report) |
| Integral over a box with the full decomposition of the variance. | |
| int | gpr_bq_integrate_measure_checked (gpr_bq_t bq, int kind, const double *lower, size_t lower_len, const double *upper, size_t upper_len, const double *mean, size_t mean_len, const double *covariance, size_t covariance_len, int n_dims, double *mean_out, double *var_out, double *mass_out) |
| Integrate against a Lebesgue box, the uniform probability on that box, or a Gaussian. | |
| int | gpr_bq_integrate_uncertainty_checked (gpr_bq_t bq, int kind, const double *lower, size_t lower_len, const double *upper, size_t upper_len, const double *mean, size_t mean_len, const double *covariance, size_t covariance_len, int n_dims, gpr_bq_uncertainty_t *report) |
| As gpr_bq_integrate_measure_checked, with the uncertainty split by source. Same measure arguments and failures. | |
| int | gpr_bq_set_basis (gpr_bq_t bq, int basis) |
| Select the Bayes-Sard mean model with a gpr_bq_basis_t value; GPR_BQ_BASIS_FOLLOW_CONFIG (-1) follows the configuration (use_prior_mean: constant when set, none otherwise). A trained model is rebuilt with the new basis. | |
| int | gpr_bq_get_basis (gpr_bq_t bq, int *basis_out) |
| Active basis selection, a gpr_bq_basis_t value written to *basis_out (GPR_BQ_BASIS_FOLLOW_CONFIG until a basis is set). | |
| int | gpr_bq_integrate_cumulative_checked (gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper_limits, size_t upper_limits_len, int n_limits, int n_dims, double *mean_out, size_t mean_len, double *covariance_out, size_t covariance_len) |
| Joint posterior of the integrals over [lower, upper_limits[j]] for n_limits nested upper limits. | |
| int | gpr_bq_sample_cumulative_checked (gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper_limits, size_t upper_limits_len, int n_limits, int n_dims, int n_draws, uint64_t seed, double *draws_out, size_t draws_len) |
| Draw n_draws joint samples of the cumulative integrals, deterministic in seed. | |
| int | gpr_bq_candidate_variance_reduction_checked (gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper, size_t upper_len, const double *X_candidates, size_t X_cand_len, const double *cand_noise_var, size_t cand_noise_len, int n_candidates, int n_dims, double *delta_var_out, size_t delta_var_len) |
| Variance reduction of the integral from one extra observation at each candidate. | |
| int | gpr_bq_select_batch_candidates_checked (gpr_bq_t bq, const double *lower, size_t lower_len, const double *upper, size_t upper_len, const double *X_candidates, size_t X_cand_len, const double *cand_noise_var, size_t cand_noise_len, int n_candidates, int n_dims, int batch_size, int *selected_indices_out, size_t selected_indices_len, double *step_reductions_out, size_t step_reductions_len) |
| Greedily choose batch_size candidates, each conditioned on the ones chosen before it. | |
| int | gpr_bq_calibrate_loo_checked (gpr_bq_t bq, double nominal_probability, gpr_calibration_report_t *report) |
| Closed-form leave-one-out calibration summary at the given central probability in (0, 1). It makes no oracle call and does not change the model. | |
| int | gpr_bq_calibrate_loo_scores_checked (gpr_bq_t bq, double nominal_probability, gpr_bq_loo_report_t *report, double *z_scores_out, size_t z_scores_len) |
| As gpr_bq_calibrate_loo_checked, and also write every standardized leave-one-out score. | |
A gpr_bq_t holds one scalar Gaussian process over dimension inputs and integrates it in closed form over a box or a Gaussian measure.
Ownership. gpr_bq_create returns a handle that the caller owns until it passes it to gpr_bq_destroy. Every pointer argument is read or written during the call and stays with the caller; the library copies what it keeps. Row-major flat arrays hold points, one row per point.
Single writer. A gpr_bq_t has one writer at a time. A call that changes the handle (gpr_bq_reset, the train, append and fit calls, the set_* calls and gpr_bq_destroy) must not overlap any other call on the same handle. The library takes no lock on the handle; the table that tells a live handle from a destroyed one has its own mutex, so calls on distinct handles may run on different threads at once. A destroyed handle is refused: a second gpr_bq_destroy sets GPR_ERR_INVALID_ARG in gpr_last_status(), and any other call returns GPR_ERR_NULL_HANDLE (the query functions return 0).
Failure. Every function that returns int returns GPR_SUCCESS (0) or a negative status and leaves its output buffers unwritten on failure. A _checked function takes the length of each caller buffer in doubles and returns GPR_ERR_INVALID_ARG for a short one. GPR_ERR_NOT_TRAINED means the call needs observations. GPR_ERR_CHOLESKY means that the covariance is singular or not positive definite at the hyperparameters the call uses, as when two observations share a location and the noise is zero; a train, append or set function returns it with the model unchanged. Other BayesianQuadratureInferenceError failures, including an eigensolver failure, return GPR_ERR_OPTIMIZER. GPR_ERR_OPTIMIZER means that hyperparameter inference failed (including the case that every trial point of the optimizer failed) and the model kept its previous state; the library does not substitute another treatment.
| int gpr_bq_append_checked | ( | gpr_bq_t | bq, |
| const double * | X_new, | ||
| size_t | X_len, | ||
| const double * | y_new, | ||
| size_t | y_len, | ||
| const double * | noise_var_new, | ||
| size_t | noise_var_len, | ||
| int | n_new, | ||
| int | n_dims, | ||
| int | refit ) |
Append n_new observations to a trained model.
| refit | Nonzero re-infers the hyperparameters with the configured treatment; zero keeps the current length scales and signal variance. |
| bq | Bayesian quadrature handle. |
| X_new | Row-major coordinates of the observations to append. |
| X_len | Length of X_new in elements. |
| y_new | Values at the coordinates to append. |
| y_len | Length of y_new in elements. |
| noise_var_new | New observation variances, or NULL with length zero for zero noise. |
| noise_var_len | Length of noise_var_new in elements. |
| n_new | Number of observations to append. |
| n_dims | Number of coordinates per point; equals the handle dimension. |
| int gpr_bq_calibrate_loo_checked | ( | gpr_bq_t | bq, |
| double | nominal_probability, | ||
| gpr_calibration_report_t * | report ) |
Closed-form leave-one-out calibration summary at the given central probability in (0, 1). It makes no oracle call and does not change the model.
| report | One struct written on success. |
| bq | Bayesian quadrature handle. |
| nominal_probability | Central interval probability, strictly between zero and one. |
| int gpr_bq_calibrate_loo_scores_checked | ( | gpr_bq_t | bq, |
| double | nominal_probability, | ||
| gpr_bq_loo_report_t * | report, | ||
| double * | z_scores_out, | ||
| size_t | z_scores_len ) |
As gpr_bq_calibrate_loo_checked, and also write every standardized leave-one-out score.
| z_scores_out | gpr_bq_n_observations() doubles (z_scores_len). |
| bq | Bayesian quadrature handle. |
| nominal_probability | Central interval probability, strictly between zero and one. |
| report | Calibration summary written on success. |
| z_scores_len | Length of z_scores_out in elements. |
| int gpr_bq_candidate_variance_reduction_checked | ( | gpr_bq_t | bq, |
| const double * | lower, | ||
| size_t | lower_len, | ||
| const double * | upper, | ||
| size_t | upper_len, | ||
| const double * | X_candidates, | ||
| size_t | X_cand_len, | ||
| const double * | cand_noise_var, | ||
| size_t | cand_noise_len, | ||
| int | n_candidates, | ||
| int | n_dims, | ||
| double * | delta_var_out, | ||
| size_t | delta_var_len ) |
Variance reduction of the integral from one extra observation at each candidate.
| X_candidates | n_candidates * n_dims row-major. |
| cand_noise_var | n_candidates non-negative variances, or NULL with length 0 for the configured candidate noise. |
| delta_var_out | n_candidates doubles (delta_var_len). |
| bq | Bayesian quadrature handle. |
| lower | Lower integration bounds, one per coordinate. |
| lower_len | Length of lower in elements. |
| upper | Upper integration bounds, one per coordinate. |
| upper_len | Length of upper in elements. |
| X_cand_len | Length of X_candidates in elements. |
| cand_noise_len | Length of cand_noise_var in elements. |
| n_candidates | Number of candidate points. |
| n_dims | Number of coordinates per point; equals the handle dimension. |
| delta_var_len | Length of delta_var_out in elements. |
| gpr_bq_t gpr_bq_create | ( | const gpr_bq_config_t * | config | ) |
Create a scalar GP / Bayesian quadrature handle.
| config | Copied; NULL selects gpr_bq_config_defaults(). Fields are validated (positive dimension, finite non-negative scales). |
| void gpr_bq_destroy | ( | gpr_bq_t | bq | ) |
Destroy a handle from gpr_bq_create. Destroying NULL or a live handle clears gpr_last_status() and gpr_last_error(), while preserving a pending GPR_ERR_ORACLE during cleanup. A handle that is already destroyed is not touched and sets GPR_ERR_INVALID_ARG in gpr_last_status().
| int gpr_bq_dimension | ( | gpr_bq_t | bq | ) |
Input dimension of the configuration; 0 for NULL or a dead handle.
| int gpr_bq_fit_hyperparameters_checked | ( | gpr_bq_t | bq, |
| gpr_bq_hyper_mode_t | mode, | ||
| gpr_bq_fit_report_t * | report, | ||
| double * | lengthscales_out, | ||
| size_t | lengthscales_len ) |
Re-infer the hyperparameters of a trained model with the given treatment, which then becomes the configured treatment.
| report | Optional fit report (may be NULL); see gpr_bq_fit_report_t, including failed_trials. |
| lengthscales_out | Optional; receives gpr_bq_n_lengthscales() values (lengthscales_len doubles). NULL needs length 0. |
| bq | Bayesian quadrature handle. |
| mode | Hyperparameter treatment to use for the fit. |
| lengthscales_len | Length of lengthscales_out in elements. |
| int gpr_bq_get_basis | ( | gpr_bq_t | bq, |
| int * | basis_out ) |
Active basis selection, a gpr_bq_basis_t value written to *basis_out (GPR_BQ_BASIS_FOLLOW_CONFIG until a basis is set).
| int gpr_bq_get_extra_sigma2 | ( | gpr_bq_t | bq, |
| double * | out ) |
Extra observation-noise variance added to every observation. out receives one double.
| int gpr_bq_get_lengthscales_checked | ( | gpr_bq_t | bq, |
| double * | out, | ||
| size_t | out_len ) |
Copy the current length scales out.
| out | gpr_bq_n_lengthscales() doubles (out_len doubles). Before a train these are the configured values. |
| bq | Bayesian quadrature handle. |
| out_len | Length of out in elements. |
| int gpr_bq_get_magn_sigma2 | ( | gpr_bq_t | bq, |
| double * | out ) |
Signal variance of the posterior (squared output unit). out receives one double.
| int gpr_bq_integrate_checked | ( | gpr_bq_t | bq, |
| const double * | lower, | ||
| size_t | lower_len, | ||
| const double * | upper, | ||
| size_t | upper_len, | ||
| int | n_dims, | ||
| double * | mean_out, | ||
| double * | var_out ) |
Integral mean and variance over a box. Equivalent to gpr_bq_integrate_report_checked keeping only mean and variance.
| mean_out,var_out | One double each. |
| bq | Bayesian quadrature handle. |
| lower | Lower integration bounds, one per coordinate. |
| lower_len | Length of lower in elements. |
| upper | Upper integration bounds, one per coordinate. |
| upper_len | Length of upper in elements. |
| n_dims | Number of coordinates per point; equals the handle dimension. |
| int gpr_bq_integrate_cumulative_checked | ( | gpr_bq_t | bq, |
| const double * | lower, | ||
| size_t | lower_len, | ||
| const double * | upper_limits, | ||
| size_t | upper_limits_len, | ||
| int | n_limits, | ||
| int | n_dims, | ||
| double * | mean_out, | ||
| size_t | mean_len, | ||
| double * | covariance_out, | ||
| size_t | covariance_len ) |
Joint posterior of the integrals over [lower, upper_limits[j]] for n_limits nested upper limits.
| upper_limits | n_limits * n_dims row-major (upper_limits_len). |
| mean_out | n_limits doubles (mean_len). |
| covariance_out | n_limits * n_limits row-major (covariance_len); symmetric positive semidefinite, its diagonal the marginal variances of gpr_bq_integrate_checked to roundoff. |
| bq | Bayesian quadrature handle. |
| lower | Lower integration bounds, one per coordinate. |
| lower_len | Length of lower in elements. |
| upper_limits_len | Length of upper_limits in elements. |
| n_limits | Number of nested upper limits. |
| n_dims | Number of coordinates per point; equals the handle dimension. |
| mean_len | Length of mean_out in elements. |
| covariance_len | Length of covariance_out in elements. |
| int gpr_bq_integrate_measure_checked | ( | gpr_bq_t | bq, |
| int | kind, | ||
| const double * | lower, | ||
| size_t | lower_len, | ||
| const double * | upper, | ||
| size_t | upper_len, | ||
| const double * | mean, | ||
| size_t | mean_len, | ||
| const double * | covariance, | ||
| size_t | covariance_len, | ||
| int | n_dims, | ||
| double * | mean_out, | ||
| double * | var_out, | ||
| double * | mass_out ) |
Integrate against a Lebesgue box, the uniform probability on that box, or a Gaussian.
| kind | A gpr_bq_measure_kind_t value; any other value is GPR_ERR_INVALID_ARG. |
| lower,upper | For a box, n_dims values each; ignored for a Gaussian. |
| mean | For a Gaussian, n_dims values; ignored for a box. |
| covariance | For a Gaussian, n_dims * n_dims row-major symmetric positive definite values; ignored for a box. |
| mean_out,var_out,mass_out | One double each. mass_out receives the measure mass: the volume, one, or one. |
| bq | Bayesian quadrature handle. |
| lower_len | Length of lower in elements. |
| upper_len | Length of upper in elements. |
| mean_len | Length of mean in elements. |
| covariance_len | Length of covariance in elements. |
| n_dims | Number of coordinates per point; equals the handle dimension. |
| int gpr_bq_integrate_report_checked | ( | gpr_bq_t | bq, |
| const double * | lower, | ||
| size_t | lower_len, | ||
| const double * | upper, | ||
| size_t | upper_len, | ||
| int | n_dims, | ||
| gpr_bq_integral_report_t * | report ) |
Integral over a box with the full decomposition of the variance.
| report | One struct written on success. |
| bq | Bayesian quadrature handle. |
| lower | Lower integration bounds, one per coordinate. |
| lower_len | Length of lower in elements. |
| upper | Upper integration bounds, one per coordinate. |
| upper_len | Length of upper in elements. |
| n_dims | Number of coordinates per point; equals the handle dimension. |
| int gpr_bq_integrate_uncertainty_checked | ( | gpr_bq_t | bq, |
| int | kind, | ||
| const double * | lower, | ||
| size_t | lower_len, | ||
| const double * | upper, | ||
| size_t | upper_len, | ||
| const double * | mean, | ||
| size_t | mean_len, | ||
| const double * | covariance, | ||
| size_t | covariance_len, | ||
| int | n_dims, | ||
| gpr_bq_uncertainty_t * | report ) |
As gpr_bq_integrate_measure_checked, with the uncertainty split by source. Same measure arguments and failures.
| report | One struct written on success. |
| bq | Bayesian quadrature handle. |
| kind | Integration measure, a gpr_bq_measure_kind_t value. |
| lower | Lower integration bounds, one per coordinate. |
| lower_len | Length of lower in elements. |
| upper | Upper integration bounds, one per coordinate. |
| upper_len | Length of upper in elements. |
| mean | Gaussian mean, one value per coordinate; ignored for a box. |
| mean_len | Length of mean in elements. |
| covariance | Row-major Gaussian covariance; ignored for a box. |
| covariance_len | Length of covariance in elements. |
| n_dims | Number of coordinates per point; equals the handle dimension. |
| int gpr_bq_kernel_double_integral_checked | ( | gpr_bq_t | bq, |
| const double * | lower, | ||
| size_t | lower_len, | ||
| const double * | upper, | ||
| size_t | upper_len, | ||
| int | n_dims, | ||
| double * | omega_out ) |
Kernel double integral of k over the box, written to *omega_out (output unit squared times volume squared). Same readiness rule as gpr_bq_kernel_mean_checked.
| int gpr_bq_kernel_mean_checked | ( | gpr_bq_t | bq, |
| const double * | lower, | ||
| size_t | lower_len, | ||
| const double * | upper, | ||
| size_t | upper_len, | ||
| const double * | X, | ||
| size_t | X_len, | ||
| int | n_points, | ||
| int | n_dims, | ||
| double * | z_out, | ||
| size_t | z_len ) |
Kernel mean z_i = integral over the box [lower, upper] of k(x, X_i) dx, at the training points or at explicit points.
| X | n_points * n_dims row-major points (X_len doubles), or NULL with X_len 0 to use the stored training points (n_points must then equal gpr_bq_n_observations()). |
| z_out | n_points doubles (z_len). |
| bq | Bayesian quadrature handle. |
| lower | Lower integration bounds, one per coordinate. |
| lower_len | Length of lower in elements. |
| upper | Upper integration bounds, one per coordinate. |
| upper_len | Length of upper in elements. |
| X_len | Length of X in elements. |
| n_points | Number of points at which to evaluate the kernel mean. |
| n_dims | Number of coordinates per point; equals the handle dimension. |
| z_len | Length of z_out in elements. |
| int gpr_bq_n_lengthscales | ( | gpr_bq_t | bq | ) |
Number of length scales: dimension when the configuration is ARD, otherwise 1; 0 for NULL or a dead handle.
| int gpr_bq_n_observations | ( | gpr_bq_t | bq | ) |
Number of stored observations; 0 for NULL or a dead handle.
| int gpr_bq_predict_batch_checked | ( | gpr_bq_t | bq, |
| const double * | X_queries, | ||
| size_t | X_len, | ||
| double * | mean_out, | ||
| size_t | mean_len, | ||
| double * | var_out, | ||
| size_t | var_len, | ||
| int | n_queries, | ||
| int | n_dims ) |
Posterior mean and variance at n_queries points.
| X_queries | n_queries * n_dims row-major (X_len doubles). |
| mean_out | n_queries doubles (mean_len). |
| var_out | n_queries doubles (var_len), or NULL with var_len 0 to skip the variance. Variances are of the latent function. |
| bq | Bayesian quadrature handle. |
| X_len | Length of X_queries in elements. |
| mean_len | Length of mean_out in elements. |
| var_len | Length of var_out in elements. |
| n_queries | Number of query points. |
| n_dims | Number of coordinates per point; equals the handle dimension. |
| int gpr_bq_reset | ( | gpr_bq_t | bq, |
| const gpr_bq_config_t * | config ) |
Replace the configuration and drop every observation and any stored integration box.
| config | Copied; NULL selects gpr_bq_config_defaults(). |
| bq | Bayesian quadrature handle. |
| int gpr_bq_sample_cumulative_checked | ( | gpr_bq_t | bq, |
| const double * | lower, | ||
| size_t | lower_len, | ||
| const double * | upper_limits, | ||
| size_t | upper_limits_len, | ||
| int | n_limits, | ||
| int | n_dims, | ||
| int | n_draws, | ||
| uint64_t | seed, | ||
| double * | draws_out, | ||
| size_t | draws_len ) |
Draw n_draws joint samples of the cumulative integrals, deterministic in seed.
| draws_out | n_draws * n_limits row-major (draws_len doubles). |
| bq | Bayesian quadrature handle. |
| lower | Lower integration bounds, one per coordinate. |
| lower_len | Length of lower in elements. |
| upper_limits | Row-major array of nested upper bounds, one row per limit. |
| upper_limits_len | Length of upper_limits in elements. |
| n_limits | Number of nested upper limits. |
| n_dims | Number of coordinates per point; equals the handle dimension. |
| n_draws | Number of joint posterior draws. |
| seed | Seed for the reproducible random stream. |
| draws_len | Length of draws_out in elements. |
| int gpr_bq_select_batch_candidates_checked | ( | gpr_bq_t | bq, |
| const double * | lower, | ||
| size_t | lower_len, | ||
| const double * | upper, | ||
| size_t | upper_len, | ||
| const double * | X_candidates, | ||
| size_t | X_cand_len, | ||
| const double * | cand_noise_var, | ||
| size_t | cand_noise_len, | ||
| int | n_candidates, | ||
| int | n_dims, | ||
| int | batch_size, | ||
| int * | selected_indices_out, | ||
| size_t | selected_indices_len, | ||
| double * | step_reductions_out, | ||
| size_t | step_reductions_len ) |
Greedily choose batch_size candidates, each conditioned on the ones chosen before it.
| selected_indices_out | batch_size candidate indices. |
| step_reductions_out | batch_size variance reductions, one per step. |
| bq | Bayesian quadrature handle. |
| lower | Lower integration bounds, one per coordinate. |
| lower_len | Length of lower in elements. |
| upper | Upper integration bounds, one per coordinate. |
| upper_len | Length of upper in elements. |
| X_candidates | Row-major candidate coordinates, one row per candidate. |
| X_cand_len | Length of X_candidates in elements. |
| cand_noise_var | Candidate variances; NULL with length zero uses the configured noise. |
| cand_noise_len | Length of cand_noise_var in elements. |
| n_candidates | Number of candidate points. |
| n_dims | Number of coordinates per point; equals the handle dimension. |
| batch_size | Number of candidates to choose, at most n_candidates. |
| selected_indices_len | Length of selected_indices_out in elements. |
| step_reductions_len | Length of step_reductions_out in elements. |
| int gpr_bq_set_basis | ( | gpr_bq_t | bq, |
| int | basis ) |
Select the Bayes-Sard mean model with a gpr_bq_basis_t value; GPR_BQ_BASIS_FOLLOW_CONFIG (-1) follows the configuration (use_prior_mean: constant when set, none otherwise). A trained model is rebuilt with the new basis.
| int gpr_bq_set_extra_sigma2 | ( | gpr_bq_t | bq, |
| double | value ) |
Set the extra observation-noise variance. A trained model is refit with its configured hyperparameter treatment.
| int gpr_bq_set_lengthscales_checked | ( | gpr_bq_t | bq, |
| const double * | values, | ||
| size_t | values_len ) |
Pin the length scales. A trained model is rebuilt with them held and the signal variance kept at its current value; the observations and the configured hyperparameter treatment stay unchanged.
| values | gpr_bq_n_lengthscales() positive finite doubles (values_len doubles). |
| bq | Bayesian quadrature handle. |
| values_len | Length of values in elements. |
| int gpr_bq_set_magn_sigma2 | ( | gpr_bq_t | bq, |
| double | value ) |
Pin the signal variance. A trained model is rebuilt with it held and the length scales kept (an ARD set stays anisotropic); the configured hyperparameter treatment stays unchanged.
| int gpr_bq_train_bounded_checked | ( | gpr_bq_t | bq, |
| const double * | X, | ||
| size_t | X_len, | ||
| const double * | y, | ||
| size_t | y_len, | ||
| const double * | noise_var, | ||
| size_t | noise_var_len, | ||
| const double * | lower, | ||
| size_t | lower_len, | ||
| const double * | upper, | ||
| size_t | upper_len, | ||
| int | n_obs, | ||
| int | n_dims ) |
Train and store an explicit integration box. Each lower[d] is finite and strictly below upper[d], and every training coordinate lies in the closed interval. Null noise_var with a zero length stores zero noise, as gpr_bq_train_checked does. The box is kept for later refits and for appended rows.
| lower,upper | n_dims values each (lower_len, upper_len doubles). |
| bq | Bayesian quadrature handle. |
| X | Row-major training coordinates, one row per observation. |
| X_len | Length of X in elements. |
| y | Values at the training coordinates. |
| y_len | Length of y in elements. |
| noise_var | Observation variances, or NULL with length zero for zero noise. |
| noise_var_len | Length of noise_var in elements. |
| lower_len | Length of lower in elements. |
| upper_len | Length of upper in elements. |
| n_obs | Number of training observations. |
| n_dims | Number of coordinates per point; equals the handle dimension. |
| int gpr_bq_train_checked | ( | gpr_bq_t | bq, |
| const double * | X, | ||
| size_t | X_len, | ||
| const double * | y, | ||
| size_t | y_len, | ||
| const double * | noise_var, | ||
| size_t | noise_var_len, | ||
| int | n_obs, | ||
| int | n_dims ) |
Train on n_obs points and infer the integration box from the training extrema.
| X | n_obs * n_dims row-major coordinates (X_len doubles). |
| y | n_obs values (y_len doubles). |
| noise_var | n_obs non-negative observation variances, or NULL with noise_var_len 0 for zero noise. |
| n_dims | Must equal gpr_bq_dimension(). |
| bq | Bayesian quadrature handle. |
| X_len | Length of X in elements. |
| y_len | Length of y in elements. |
| noise_var_len | Length of noise_var in elements. |
| n_obs | Number of training observations. |