.. index:: pair: class; gpr::itergp::IterGP .. _doxid-classgpr_1_1itergp_1_1_iter_g_p: class gpr::itergp::IterGP ========================= .. toctree:: :hidden: Overview ~~~~~~~~ One :ref:`IterGP ` run against a fixed regularized kernel. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class IterGP { public: // methods void :ref:`run`(const Eigen::MatrixXd& K_hat, const Eigen::VectorXd& y, int iterations, :ref:`Policy` policy = :ref:`Policy::ConjugateGradient`); int :target:`iterations`() const; const Eigen::MatrixXd& :ref:`actions`() const; const Eigen::VectorXd& :ref:`representerWeights`() const; Eigen::MatrixXd :ref:`inverseApproximation`() const; double :ref:`posteriorMean`(const Eigen::VectorXd& kx) const; double :ref:`combinedVariance`(double kxx, const Eigen::VectorXd& kx) const; double :ref:`computationalVariance`(const Eigen::LDLT& exact, const Eigen::VectorXd& kx) const; double :ref:`relativeResidual`(const Eigen::MatrixXd& K_hat, const Eigen::VectorXd& y) const; }; .. _details-classgpr_1_1itergp_1_1_iter_g_p: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ One :ref:`IterGP ` run against a fixed regularized kernel. Everything is expressed through the action matrix S, so the cost of a query is set by the number of iterations rather than by the matrix size, and the uncertainty split falls out of the same factor. Methods ------- .. index:: pair: function; run .. _doxid-classgpr_1_1itergp_1_1_iter_g_p_1aaec52c58f0e458c88edba3789905a036: .. ref-code-block:: cpp :class: doxyrest-title-code-block void run(const Eigen::MatrixXd& K_hat, const Eigen::VectorXd& y, int iterations, :ref:`Policy` policy = :ref:`Policy::ConjugateGradient`) Take ``:ref:`iterations ``` actions against K_hat with right-hand side y. K_hat must be symmetric positive definite (add the noise before calling). Iterations are capped at the matrix size. .. index:: pair: function; actions .. _doxid-classgpr_1_1itergp_1_1_iter_g_p_1a07dc0bdc9c82d45033630d8f2e584aee: .. ref-code-block:: cpp :class: doxyrest-title-code-block const Eigen::MatrixXd& actions() const The actions taken, n x i. .. index:: pair: function; representerWeights .. _doxid-classgpr_1_1itergp_1_1_iter_g_p_1a63384ac66d68c4d99ac0e17c3f20d9e4: .. ref-code-block:: cpp :class: doxyrest-title-code-block const Eigen::VectorXd& representerWeights() const v_i = C_i y, the representer weights the run justifies. .. index:: pair: function; inverseApproximation .. _doxid-classgpr_1_1itergp_1_1_iter_g_p_1a6b5cc21b60b5ee2316e69022a837c6da: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::MatrixXd inverseApproximation() const C_i = S (S^T K_hat S)^{-1} S^T, the solver's approximation to K_hat^{-1}. Dense, for validation; the query paths below never form it. .. index:: pair: function; posteriorMean .. _doxid-classgpr_1_1itergp_1_1_iter_g_p_1a01ef1e9f00ae1871d7395ee1f74750ce: .. ref-code-block:: cpp :class: doxyrest-title-code-block double posteriorMean(const Eigen::VectorXd& kx) const Posterior mean at a test point with cross-covariance k(x) = K_xn. .. index:: pair: function; combinedVariance .. _doxid-classgpr_1_1itergp_1_1_iter_g_p_1aae2d5201c96209c7605bfa06762d0959: .. ref-code-block:: cpp :class: doxyrest-title-code-block double combinedVariance(double kxx, const Eigen::VectorXd& kx) const Combined (mathematical + computational) posterior variance, k(x,x) - k(x)^T C_i k(x). .. index:: pair: function; computationalVariance .. _doxid-classgpr_1_1itergp_1_1_iter_g_p_1a70905fce825216f081fed7dab40cc161: .. ref-code-block:: cpp :class: doxyrest-title-code-block double computationalVariance(const Eigen::LDLT& exact, const Eigen::VectorXd& kx) const The computational part alone, k(x)^T (K_hat^{-1} - C_i) k(x). Requires the exact inverse action and so is for diagnostics and tests, not for the hot path; it is non-negative and decreases as iterations are added. .. index:: pair: function; relativeResidual .. _doxid-classgpr_1_1itergp_1_1_iter_g_p_1a49aee4a316da4668b28a8637721aa5b4: .. ref-code-block:: cpp :class: doxyrest-title-code-block double relativeResidual(const Eigen::MatrixXd& K_hat, const Eigen::VectorXd& y) const Relative residual ||K_hat v_i - y|| / ||y||, the usual convergence view.