.. index:: pair: namespace; gpr::bo .. _doxid-namespacegpr_1_1bo: namespace gpr::bo ================= .. toctree:: :hidden: namespace_gpr_bo_testing.rst enum_gpr_bo_BayesianQuadratureBasis.rst enum_gpr_bo_BayesianQuadratureHyperMode.rst enum_gpr_bo_BayesianQuadratureKernel.rst enum_gpr_bo_BayesianQuadratureMeasureKind.rst enum_gpr_bo_MeanBasisKind.rst enum_gpr_bo_ParameterAcquisition.rst enum_gpr_bo_RadialKind.rst struct_gpr_bo_BayesianQuadratureCalibration.rst struct_gpr_bo_BayesianQuadratureConfig.rst struct_gpr_bo_BayesianQuadratureCumulative.rst struct_gpr_bo_BayesianQuadratureFitReport.rst struct_gpr_bo_BayesianQuadratureIntegral.rst struct_gpr_bo_BayesianQuadratureIntegralReport.rst struct_gpr_bo_BayesianQuadratureMeasure.rst struct_gpr_bo_BayesianQuadratureSelection.rst struct_gpr_bo_FreeEnergyFitReport.rst struct_gpr_bo_FreeEnergyObservations.rst struct_gpr_bo_FreeEnergyPathPosterior.rst struct_gpr_bo_FreeEnergySurrogateConfig.rst struct_gpr_bo_KramersRateConfig.rst struct_gpr_bo_KramersRateSummary.rst struct_gpr_bo_MaternMixture.rst struct_gpr_bo_ParameterBound.rst struct_gpr_bo_ParameterObservation.rst struct_gpr_bo_ParameterSearchConfig.rst struct_gpr_bo_ParameterSearchResult.rst struct_gpr_bo_ScalarFitBounds.rst struct_gpr_bo_ScalarFitConfig.rst struct_gpr_bo_ScalarFitResult.rst struct_gpr_bo_ScalarHyperparameters.rst struct_gpr_bo_ScalarLikelihoodData.rst class_gpr_bo_BayesianQuadratureCholeskyError.rst class_gpr_bo_BayesianQuadratureInferenceError.rst class_gpr_bo_BayesianQuadratureModel.rst class_gpr_bo_BayesianQuadratureNumericalError.rst class_gpr_bo_FreeEnergyCholeskyError.rst class_gpr_bo_FreeEnergyInferenceError.rst class_gpr_bo_FreeEnergyRateUnsupportedError.rst class_gpr_bo_FreeEnergySaddleNotFoundError.rst class_gpr_bo_FreeEnergySurrogate.rst class_gpr_bo_Matern32.rst class_gpr_bo_Matern52.rst class_gpr_bo_ParameterSearch.rst class_gpr_bo_ProductRadial.rst class_gpr_bo_RadialShape.rst class_gpr_bo_ScalarGaussianProcess.rst class_gpr_bo_ScalarSurrogate.rst class_gpr_bo_ScaledEuclideanDistance.rst class_gpr_bo_ScaledRadial.rst class_gpr_bo_SplitMix64.rst class_gpr_bo_SquaredExponential.rst class_gpr_bo_StationaryKernel.rst class_gpr_bo_SumRadial.rst Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block namespace bo { // namespaces namespace :ref:`gpr::bo::testing`; // typedefs typedef std::function&)> :ref:`MeanBasis`; typedef Eigen::AutoDiffScalar> :target:`Dual`; // enums enum :ref:`BayesianQuadratureBasis`; enum :ref:`BayesianQuadratureHyperMode`; enum :ref:`BayesianQuadratureKernel`; enum :ref:`BayesianQuadratureMeasureKind`; enum :ref:`MeanBasisKind`; enum :ref:`ParameterAcquisition`; enum :ref:`RadialKind`; // structs struct :ref:`BayesianQuadratureCalibration`; struct :ref:`BayesianQuadratureConfig`; struct :ref:`BayesianQuadratureCumulative`; struct :ref:`BayesianQuadratureFitReport`; struct :ref:`BayesianQuadratureIntegral`; struct :ref:`BayesianQuadratureIntegralReport`; struct :ref:`BayesianQuadratureMeasure`; struct :ref:`BayesianQuadratureSelection`; struct :ref:`FreeEnergyFitReport`; struct :ref:`FreeEnergyObservations`; struct :ref:`FreeEnergyPathPosterior`; struct :ref:`FreeEnergySurrogateConfig`; struct :ref:`KramersRateConfig`; struct :ref:`KramersRateSummary`; struct :ref:`MaternMixture`; struct :ref:`ParameterBound`; struct :ref:`ParameterObservation`; struct :ref:`ParameterSearchConfig`; struct :ref:`ParameterSearchResult`; struct :ref:`ScalarFitBounds`; struct :ref:`ScalarFitConfig`; struct :ref:`ScalarFitResult`; struct :ref:`ScalarHyperparameters`; struct :ref:`ScalarLikelihoodData`; // classes class :ref:`BayesianQuadratureCholeskyError`; class :ref:`BayesianQuadratureInferenceError`; class :ref:`BayesianQuadratureModel`; class :ref:`BayesianQuadratureNumericalError`; class :ref:`FreeEnergyCholeskyError`; class :ref:`FreeEnergyInferenceError`; class :ref:`FreeEnergyRateUnsupportedError`; class :ref:`FreeEnergySaddleNotFoundError`; class :ref:`FreeEnergySurrogate`; class :ref:`Matern32`; class :ref:`Matern52`; class :ref:`ParameterSearch`; template class :ref:`ProductRadial`; class :ref:`RadialShape`; template class :ref:`ScalarGaussianProcess`; class :ref:`ScalarSurrogate`; class :ref:`ScaledEuclideanDistance`; template class :ref:`ScaledRadial`; class :ref:`SplitMix64`; class :ref:`SquaredExponential`; template class :ref:`StationaryKernel`; template class :ref:`SumRadial`; // global variables double :ref:`kMaxProductMixtureNodes` = 2.0e5; // global functions double :target:`squaredExponentialBoxMean`(const Eigen::VectorXd& point, const Eigen::VectorXd& lower, const Eigen::VectorXd& upper, const Eigen::VectorXd& lengthscales); double :target:`squaredExponentialBoxDouble`(const Eigen::VectorXd& lower, const Eigen::VectorXd& upper, const Eigen::VectorXd& lengthscales); double :target:`squaredExponentialBoxCross`(const Eigen::VectorXd& lower, const Eigen::VectorXd& first_upper, const Eigen::VectorXd& second_upper, const Eigen::VectorXd& lengthscales); double :target:`maternMixtureUnit`(double squared_distance, double nu, const Eigen::VectorXd& nodes, const Eigen::VectorXd& weights); double :target:`analyticUnitMatern`(double squared_distance, double nu); void :target:`gaussLegendreInterval`(int order, std::vector& nodes, std::vector& weights); :ref:`MaternMixture` :ref:`maternMixture`(double nu); const :ref:`MaternMixture`& :target:`matern32Mixture`(); const :ref:`MaternMixture`& :target:`matern52Mixture`(); double :target:`mixtureScale`(double node, double nu); double :target:`maternMixtureBoxMean`(const :ref:`MaternMixture`& rule, const Eigen::VectorXd& point, const Eigen::VectorXd& lower, const Eigen::VectorXd& upper, const Eigen::VectorXd& lengthscales); double :target:`maternMixtureBoxDouble`(const :ref:`MaternMixture`& rule, const Eigen::VectorXd& lower, const Eigen::VectorXd& upper, const Eigen::VectorXd& lengthscales); double :target:`maternMixtureBoxCross`(const :ref:`MaternMixture`& rule, const Eigen::VectorXd& lower, const Eigen::VectorXd& first_upper, const Eigen::VectorXd& second_upper, const Eigen::VectorXd& lengthscales); void :ref:`requireSymmetricCovariance`(const Eigen::MatrixXd& covariance); double :target:`squaredExponentialGaussianMean`(const Eigen::VectorXd& point, const Eigen::VectorXd& mean, const Eigen::MatrixXd& covariance, const Eigen::VectorXd& lengthscales); double :target:`squaredExponentialGaussianDouble`(const Eigen::MatrixXd& covariance, const Eigen::VectorXd& lengthscales); double :target:`squaredExponentialGaussian1D`(double point, double mean, double variance, double lengthscale); double :target:`squaredExponentialGaussianDouble1D`(double variance, double lengthscale); std::vector :ref:`activeMixtureNodes`(const :ref:`MaternMixture`& rule); void :target:`requireProductMixtureBudget`(const :ref:`MaternMixture`& rule, Eigen::Index dimension); template void :ref:`forEachProductMixtureNode`(const :ref:`MaternMixture`& rule, const std::vector& active, Eigen::Index dimension, Visitor&& visit); Eigen::VectorXd :ref:`maternProductGaussianMeans`(const :ref:`MaternMixture`& rule, const Eigen::MatrixXd& points, const Eigen::VectorXd& mean, const Eigen::MatrixXd& covariance, const Eigen::VectorXd& lengthscales); double :target:`maternProductGaussianDouble`(const :ref:`MaternMixture`& rule, const Eigen::MatrixXd& covariance, const Eigen::VectorXd& lengthscales); bool :target:`covarianceIsDiagonal`(const Eigen::MatrixXd& covariance); double :ref:`expectedImprovementScore`(double mu, double mu_best, double sigma); double :ref:`expectedImprovementForMinimum`(double mu, double best, double sigma); double :ref:`probabilityOfFeasibility`(double mu, double sigma, double threshold = 0.0); double :ref:`constrainedExpectedImprovementForMinimum`(double mu, double best, double sigma, double constraint_mu, double constraint_sigma); double :ref:`lowerConfidenceBound`(double mu, double sigma, double kappa); Eigen::VectorXd :ref:`freeEnergyNoiseFromWeights`(const Eigen::VectorXd& weights, double reference_variance, double min_relative_weight); bool :ref:`isDiscrete`(const :ref:`ParameterBound`& bound); void :ref:`validateBound`(const :ref:`ParameterBound`& bound); double :ref:`unitToParameter`(double unit, const :ref:`ParameterBound`& bound); double :ref:`parameterToUnit`(double parameter, const :ref:`ParameterBound`& bound); double :ref:`snapUnit`(double unit, const :ref:`ParameterBound`& bound); template :ref:`ParameterSearchResult` :target:`minimize`(Objective&& objective, const std::vector<:ref:`ParameterBound`>& bounds, const :ref:`ParameterSearchConfig`& config, const Kernel& kernel); template :ref:`ParameterSearchResult` :ref:`minimize`(Objective&& objective, const std::vector<:ref:`ParameterBound`>& bounds, const :ref:`ParameterSearchConfig`& config); :ref:`ScalarFitBounds` :ref:`defaultScalarFitBounds`(const :ref:`ScalarLikelihoodData`& data); :ref:`ScalarFitResult` :ref:`fitScalarHyperparameters`(const :ref:`ScalarLikelihoodData`& data, const :ref:`ScalarHyperparameters`& initial, const :ref:`ScalarFitConfig`& config = {}); Eigen::Index :ref:`scalarParameterCount`(const :ref:`ScalarLikelihoodData`& data); double :ref:`scalarLogMarginalLikelihood`(const :ref:`ScalarLikelihoodData`& data, const :ref:`ScalarHyperparameters`& hyper, Eigen::VectorXd* gradient = nullptr); void :ref:`fillStandardNormal`(:ref:`SplitMix64`& generator, Eigen::VectorXd& normal); double :target:`kernelMean1D`(const :ref:`SquaredExponential`& radial, double point, double lower, double upper, double lengthscale); double :target:`kernelMean1D`(const :ref:`Matern32`& radial, double point, double lower, double upper, double lengthscale); double :target:`kernelMean1D`(const :ref:`Matern52`& radial, double point, double lower, double upper, double lengthscale); double :target:`kernelDoubleIntegral1D`(const :ref:`SquaredExponential`& radial, double lower, double upper, double lengthscale); double :target:`kernelDoubleIntegral1D`(const :ref:`Matern32`& radial, double lower, double upper, double lengthscale); double :target:`kernelDoubleIntegral1D`(const :ref:`Matern52`& radial, double lower, double upper, double lengthscale); template double :target:`kernelMean1DLogLengthDerivative`(const Radial& radial, double point, double lower, double upper, double lengthscale); template double :target:`kernelDoubleIntegral1DLogLengthDerivative`(const Radial& radial, double lower, double upper, double lengthscale); template :ref:`ScaledRadial` :target:`scaledRadial`(double scale, Radial radial); template :ref:`SumRadial` :target:`sumRadial`(Left left, Right right); template :ref:`ProductRadial` :target:`productRadial`(Left left, Right right); template :ref:`StationaryKernel` :target:`stationaryKernel`(Distance distance, Radial radial); template T :target:`lift`(const Value& value); } // namespace bo .. _details-namespacegpr_1_1bo: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Typedefs -------- .. index:: pair: typedef; MeanBasis .. _doxid-namespacegpr_1_1bo_1a916a4dcd894878003c2e49ea97dfc96d: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef std::function&)> MeanBasis Basis functions phi(x) of the parametric mean. The returned vector has the same length at every x. Global Variables ---------------- .. index:: pair: variable; kMaxProductMixtureNodes .. _doxid-namespacegpr_1_1bo_1a0d2222c6773ecddf6328960051c9fd09: .. ref-code-block:: cpp :class: doxyrest-title-code-block double kMaxProductMixtureNodes = 2.0e5 Largest number of joint mixture nodes the product-Matérn moments under a non-diagonal Gaussian will evaluate. With the nodes of the accurate one-dimensional rule this admits two dimensions and no more. Global Functions ---------------- .. index:: pair: function; maternMixture .. _doxid-namespacegpr_1_1bo_1aac99b0db589a68c804a1bdbfd512fcf4: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`MaternMixture` maternMixture(double nu) Plain generalized Gauss–Laguerre at a few hundred nodes leaves a relative kernel error near 5e-5, because exp(-a/t) is not a polynomial in t. The substitution t = exp(u) makes the gamma-mixture integrand smooth, and a fixed Gauss–Legendre panel rule then matches the closed-form Matérn to a small multiple of machine epsilon. The window and panel count are the smallest values in the search below that meet that test. .. index:: pair: function; requireSymmetricCovariance .. _doxid-namespacegpr_1_1bo_1a93dc8bbe746b3b4121cc066a85241174: .. ref-code-block:: cpp :class: doxyrest-title-code-block void requireSymmetricCovariance(const Eigen::MatrixXd& covariance) A covariance is read through its lower triangle by the Cholesky factor, so an asymmetric matrix would be integrated as a different, symmetric one. Reject it instead. The tolerance is roundoff of the matrix's own scale. .. index:: pair: function; activeMixtureNodes .. _doxid-namespacegpr_1_1bo_1a09d0c86680c358b8de5e6caadeef416a: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::vector activeMixtureNodes(const :ref:`MaternMixture`& rule) Indices of the mixture nodes whose weight is above the cut that keeps the pruned mass below the kernel error budget. .. index:: pair: function; forEachProductMixtureNode .. _doxid-namespacegpr_1_1bo_1ac5bbf6636420e990227b8602c7e02e04: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void forEachProductMixtureNode(const :ref:`MaternMixture`& rule, const std::vector& active, Eigen::Index dimension, Visitor&& visit) Visits every joint node of a product mixture. ``visit(weight, scales)`` receives the product weight and the per-axis scale factors. .. index:: pair: function; maternProductGaussianMeans .. _doxid-namespacegpr_1_1bo_1a74293f03b74f9558f64fab6627f9ce94: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd maternProductGaussianMeans(const :ref:`MaternMixture`& rule, const Eigen::MatrixXd& points, const Eigen::VectorXd& mean, const Eigen::MatrixXd& covariance, const Eigen::VectorXd& lengthscales) Product Matérn kernel mean under a Gaussian with any covariance. Each axis is a gamma scale mixture of squared exponentials, so the product is a joint mixture of squared exponentials with diagonal scales, and each term has the closed full-covariance Gaussian moment. .. index:: pair: function; expectedImprovementScore .. _doxid-namespacegpr_1_1bo_1a3855f254501bf9c6e9d0cacba2551cc8: .. ref-code-block:: cpp :class: doxyrest-title-code-block double expectedImprovementScore(double mu, double mu_best, double sigma) Jones expected improvement for a maximizer. EI = (mu - mu_best) Phi(z) + sigma phi(z), with z = (mu - mu_best) / sigma. The score is zero when sigma is not positive or the inputs are not finite. .. index:: pair: function; expectedImprovementForMinimum .. _doxid-namespacegpr_1_1bo_1a1982cc942164f6a628b4a9f08f5c6785: .. ref-code-block:: cpp :class: doxyrest-title-code-block double expectedImprovementForMinimum(double mu, double best, double sigma) Expected improvement for a minimizer. The maximizer score on negated values. best is the smallest loss seen so far. .. index:: pair: function; probabilityOfFeasibility .. _doxid-namespacegpr_1_1bo_1a17e5068de5460b6be040ae54f5c1c749: .. ref-code-block:: cpp :class: doxyrest-title-code-block double probabilityOfFeasibility(double mu, double sigma, double threshold = 0.0) Probability that a normal constraint value is feasible. P(c <= threshold) for c normal with mean mu and standard deviation sigma, which is Phi((threshold - mu) / sigma). A zero sigma gives one when mu is at most the threshold and zero otherwise. A non-finite input or a negative sigma gives zero. .. index:: pair: function; constrainedExpectedImprovementForMinimum .. _doxid-namespacegpr_1_1bo_1a740d2b74cfbe30fc317fbda324c768f5: .. ref-code-block:: cpp :class: doxyrest-title-code-block double constrainedExpectedImprovementForMinimum(double mu, double best, double sigma, double constraint_mu, double constraint_sigma) Constrained expected improvement for a minimizer. Expected improvement of the loss times the probability that an independent constraint model is feasible: Gardner et al. (2014) and Gelbart, Snoek and Adams (2014). The constraint is feasible at or below zero. .. index:: pair: function; lowerConfidenceBound .. _doxid-namespacegpr_1_1bo_1ac5ab5be2f5e1beaa0d142a12b9ffaefa: .. ref-code-block:: cpp :class: doxyrest-title-code-block double lowerConfidenceBound(double mu, double sigma, double kappa) Lower confidence bound for a minimizer, mu - kappa \* sigma. A non-finite input returns +infinity so a minimizer skips the point. .. index:: pair: function; freeEnergyNoiseFromWeights .. _doxid-namespacegpr_1_1bo_1a73566b40ed5d4d1ba184e9f93dc03817: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd freeEnergyNoiseFromWeights(const Eigen::VectorXd& weights, double reference_variance, double min_relative_weight) noise[i] = reference \* max(w) / max(w[i], min_relative \* max(w)). Scale-invariant in the weights. Every weight is positive and finite, reference is positive and finite, and min_relative lies in (0, 1]. Throws std::domain_error when a noise variance overflows. .. index:: pair: function; isDiscrete .. _doxid-namespacegpr_1_1bo_1a917a62eccf2488acb896d0b30fe5076b: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isDiscrete(const :ref:`ParameterBound`& bound) True for an integer axis or an axis with allowed values. .. index:: pair: function; validateBound .. _doxid-namespacegpr_1_1bo_1a5f9797204ba14bacf61c75b83206cfbf: .. ref-code-block:: cpp :class: doxyrest-title-code-block void validateBound(const :ref:`ParameterBound`& bound) Throw std::invalid_argument unless the axis is well formed. .. index:: pair: function; unitToParameter .. _doxid-namespacegpr_1_1bo_1a34b128d403ba91cc6a62f9b37a00be07: .. ref-code-block:: cpp :class: doxyrest-title-code-block double unitToParameter(double unit, const :ref:`ParameterBound`& bound) Map a unit-cube coordinate to the parameter of its axis. An axis with k allowed values splits [0, 1] into k equal cells. An integer axis maps as the continuous one does and rounds to the nearest whole number in the interval. .. index:: pair: function; parameterToUnit .. _doxid-namespacegpr_1_1bo_1a2b27394cb3b969951b9b6d5fa8248403: .. ref-code-block:: cpp :class: doxyrest-title-code-block double parameterToUnit(double parameter, const :ref:`ParameterBound`& bound) Unit-cube coordinate of a parameter, the inverse of :ref:`unitToParameter() `. Allowed value i of k sits at i / (k - 1), and at 0.5 when k is one. A parameter that is not an allowed value takes the coordinate of the nearest one. Other axes are clamped to [0, 1]. .. index:: pair: function; snapUnit .. _doxid-namespacegpr_1_1bo_1a4c2ab7dee5f208146b0fe8b27163ac35: .. ref-code-block:: cpp :class: doxyrest-title-code-block double snapUnit(double unit, const :ref:`ParameterBound`& bound) The unit-cube coordinate of the lattice point a coordinate rounds to. A continuous axis returns the clamped coordinate. .. index:: pair: function; minimize .. _doxid-namespacegpr_1_1bo_1a8e00506973726f0f052b88725a317693: .. ref-code-block:: cpp :class: doxyrest-title-code-block template :ref:`ParameterSearchResult` minimize(Objective&& objective, const std::vector<:ref:`ParameterBound`>& bounds, const :ref:`ParameterSearchConfig`& config) Default kernel: one length scale on every unit-cube axis, squared exponential. A categorical axis is compared for equality. .. index:: pair: function; defaultScalarFitBounds .. _doxid-namespacegpr_1_1bo_1a9ce2f86d01e70343fc78bf5a7ceeacb8: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`ScalarFitBounds` defaultScalarFitBounds(const :ref:`ScalarLikelihoodData`& data) Default box of the fit, from the spread of the observations. Length scale of an axis: 0.02 to 20 times the range of that column of x. Signal variance: 1e-4 to 1e3 times the sample variance of y. Noise variance: 1e-8 to 10 times the sample variance of y. A column or a y without spread uses one as its scale. .. index:: pair: function; fitScalarHyperparameters .. _doxid-namespacegpr_1_1bo_1ae7fc5ac879312d7184bf74c77b5a2ddf: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`ScalarFitResult` fitScalarHyperparameters(const :ref:`ScalarLikelihoodData`& data, const :ref:`ScalarHyperparameters`& initial, const :ref:`ScalarFitConfig`& config = {}) Maximize the log marginal likelihood over the hyperparameters. Every start runs the rgmin L-BFGS solver on the logarithms of the hyperparameters with the analytic gradient, inside the box. The start with the largest likelihood is returned. A noise variance supplied per row is kept and only the length scales and the signal variance move. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - initial - First start, clipped into the box. A single length scale applies to every axis. * - std::invalid_argument - for inconsistent sizes or an empty box. * - std::runtime_error - when no start has a finite likelihood. .. index:: pair: function; scalarParameterCount .. _doxid-namespacegpr_1_1bo_1ad69309b3bb09966bd9fe0019249d38bd: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::Index scalarParameterCount(const :ref:`ScalarLikelihoodData`& data) Number of fitted parameters: the length scales, the signal variance and, without per-row variances, the noise variance. .. index:: pair: function; scalarLogMarginalLikelihood .. _doxid-namespacegpr_1_1bo_1ae0f6d56c7029b3272f6ec518b76840ea: .. ref-code-block:: cpp :class: doxyrest-title-code-block double scalarLogMarginalLikelihood(const :ref:`ScalarLikelihoodData`& data, const :ref:`ScalarHyperparameters`& hyper, Eigen::VectorXd* gradient = nullptr) Log marginal likelihood log p(y | X, theta) and its gradient. With K = k(X, X) + diag(noise), the value is -1/2 y^T K^-1 y - 1/2 log|K| - n/2 log(2 pi). With a basis H of p columns it is -1/2 y^T P y - 1/2 log|K| - 1/2 log|H^T K^-1 H| * (n - p)/2 log(2 pi), P = K^-1 - K^-1 H (H^T K^-1 H)^-1 H^T K^-1. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - gradient - Optional. Receives :ref:`scalarParameterCount() ` derivatives with respect to the logarithms of the length scales, of the signal variance and, without per-row variances, of the noise variance, in that order: 1/2 tr((a a^T - P) dK/dtheta), a = P y. .. rubric:: Returns: The value, or minus infinity when K or H^T K^-1 H is not positive definite. The gradient is then not written. .. index:: pair: function; fillStandardNormal .. _doxid-namespacegpr_1_1bo_1abe0d1943919e04196d147bd72e037eba: .. ref-code-block:: cpp :class: doxyrest-title-code-block void fillStandardNormal(:ref:`SplitMix64`& generator, Eigen::VectorXd& normal) Independent standard normals, two per pair of uniforms (Box-Muller).