.. index:: pair: class; gpr::capi::ScalarSurrogate .. _doxid-classgpr_1_1capi_1_1_scalar_surrogate: class gpr::capi::ScalarSurrogate ================================ .. toctree:: :hidden: struct_gpr_capi_ScalarSurrogate_Hyperparameters.rst struct_gpr_capi_ScalarSurrogate_Prediction.rst Overview ~~~~~~~~ Owner of a :ref:`gpr_sgp_t ` : a scalar GP for a noisy oracle. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class ScalarSurrogate { public: // structs struct :ref:`Hyperparameters`; struct :ref:`Prediction`; // construction :target:`ScalarSurrogate`(); :target:`ScalarSurrogate`(:ref:`gpr_sgp_t` h, :ref:`adopt_t`); :target:`ScalarSurrogate`(const ScalarSurrogate&); :target:`ScalarSurrogate`(ScalarSurrogate&& other); :target:`~ScalarSurrogate`(); // methods :ref:`ScalarSurrogate`& :target:`operator=`(const :ref:`ScalarSurrogate`&); :ref:`ScalarSurrogate`& :target:`operator=`(:ref:`ScalarSurrogate`&& other); void :target:`reset`(); :ref:`gpr_sgp_t` :target:`handle`() const; :target:`operator bool`() const; int :target:`dimension`() const; int :target:`n_observations`() const; void :target:`set_kernel`(:ref:`BqKernel` kernel); void :target:`set_mean_basis`(:ref:`BqBasis` basis); void :target:`set_hyperparameters`(const :ref:`Hyperparameters`& hyper); :ref:`Hyperparameters` :target:`hyperparameters`() const; void :ref:`observe`(const std::vector& x, const std::vector& y, const std::vector& noise_var, int n_obs); double :ref:`fit`(bool optimize = false, int n_starts = 8); :ref:`Prediction` :ref:`predict`(const std::vector& x_queries, int n_queries, double query_noise_var = 0.0) const; static :ref:`ScalarSurrogate` :target:`create`(int dimension, :ref:`BqKernel` kernel = :ref:`BqKernel::SquaredExponential`); }; .. _details-classgpr_1_1capi_1_1_scalar_surrogate: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Owner of a :ref:`gpr_sgp_t ` : a scalar GP for a noisy oracle. Arrays are row-major, one row per point. Methods ------- .. index:: pair: function; observe .. _doxid-classgpr_1_1capi_1_1_scalar_surrogate_1a1f75171cb01b593b6471985be1e937fc: .. ref-code-block:: cpp :class: doxyrest-title-code-block void observe(const std::vector& x, const std::vector& y, const std::vector& noise_var, int n_obs) noise_var is empty for rows that share the noise variance. .. index:: pair: function; fit .. _doxid-classgpr_1_1capi_1_1_scalar_surrogate_1aa2847e5f3cc5ca47bdea9d4402eff435: .. ref-code-block:: cpp :class: doxyrest-title-code-block double fit(bool optimize = false, int n_starts = 8) Returns the log marginal likelihood of the conditioned surrogate. .. index:: pair: function; predict .. _doxid-classgpr_1_1capi_1_1_scalar_surrogate_1aaa359000a81bac9d94c664654734bd4b: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Prediction` predict(const std::vector& x_queries, int n_queries, double query_noise_var = 0.0) const query_noise_var of zero gives the latent standard deviation.