.. index:: pair: class; gpr::FactorizedLikelihood .. _doxid-classgpr_1_1_factorized_likelihood: class gpr::FactorizedLikelihood =============================== .. toctree:: :hidden: Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class FactorizedLikelihood { public: // methods void :ref:`setEigendecomposition`(const Eigen::VectorXd& eigenvalues, const :ref:`EigenMatrix`& eigenvectors, const Eigen::VectorXd& targets); double :ref:`evaluateGP`(double noise_variance) const; double :ref:`evaluateTP`(double noise_variance, double a, double b) const; double :ref:`analyticalPrefactor`(double noise_variance) const; double :ref:`tpPrefactor`(double noise_variance, double a, double b) const; Eigen::Index :target:`dataSize`() const; }; .. _details-classgpr_1_1_factorized_likelihood: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Methods ------- .. index:: pair: function; setEigendecomposition .. _doxid-classgpr_1_1_factorized_likelihood_1a2b89c134cd8303fc2b23bee16e7d5bfc: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setEigendecomposition(const Eigen::VectorXd& eigenvalues, const :ref:`EigenMatrix`& eigenvectors, const Eigen::VectorXd& targets) Cache the eigendecomposition of K_XX for repeated noise sweeps. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - eigenvalues - D from eigh(K_XX), shape (n,) * - eigenvectors - U from eigh(K_XX), shape (n, n) * - targets - y vector, shape (n,) .. index:: pair: function; evaluateGP .. _doxid-classgpr_1_1_factorized_likelihood_1a13b4ca2f3e3c42934aac024417b7ab2e: .. ref-code-block:: cpp :class: doxyrest-title-code-block double evaluateGP(double noise_variance) const GP negative log marginal likelihood at given noise level. Uses the analytical prefactor: prefactor = mean(UTY^2 / D_n). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - noise_variance - sigma_n^2 in linear space .. rubric:: Returns: NLML value (lower is better) .. index:: pair: function; evaluateTP .. _doxid-classgpr_1_1_factorized_likelihood_1a250515f7ee38fe5fa845106d86fbbe16: .. ref-code-block:: cpp :class: doxyrest-title-code-block double evaluateTP(double noise_variance, double a, double b) const TP negative log marginal likelihood at given noise level. Uses the inverse-gamma hyperprior on the signal variance. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - noise_variance - sigma_n^2 in linear space * - a - inverse-gamma shape parameter * - b - inverse-gamma scale parameter .. rubric:: Returns: NLML value (lower is better) .. index:: pair: function; analyticalPrefactor .. _doxid-classgpr_1_1_factorized_likelihood_1a2ff95558ebe15ef99aa4a6580e92538c: .. ref-code-block:: cpp :class: doxyrest-title-code-block double analyticalPrefactor(double noise_variance) const Analytically optimal GP prefactor (signal variance). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - noise_variance - sigma_n^2 .. rubric:: Returns: prefactor = mean(UTY^2 / D_n) .. index:: pair: function; tpPrefactor .. _doxid-classgpr_1_1_factorized_likelihood_1a95fd252e82f1b33b438583694b25d04d: .. ref-code-block:: cpp :class: doxyrest-title-code-block double tpPrefactor(double noise_variance, double a, double b) const TP prefactor from inverse-gamma hyperprior. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - noise_variance - sigma_n^2 * - a - shape parameter * - b - scale parameter .. rubric:: Returns: prefactor = (2b + S) / (2a + n - 2)