.. index:: pair: class; gpr::ski::DerivativeSKI .. _doxid-classgpr_1_1ski_1_1_derivative_s_k_i: class gpr::ski::DerivativeSKI ============================= .. toctree:: :hidden: Overview ~~~~~~~~ D-SKI for one dimension of a squared-exponential factor. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class DerivativeSKI { public: // construction :ref:`DerivativeSKI`(const Eigen::VectorXd& x, double lengthscale, Eigen::Index m); // methods Eigen::Index :target:`numPoints`() const; Eigen::Index :target:`gridSize`() const; Eigen::Index :target:`outOfGrid`() const; const Eigen::VectorXd& :ref:`gridKernelRow`() const; Eigen::VectorXd :ref:`applyGridKernel`(const Eigen::VectorXd& v) const; Eigen::MatrixXd :ref:`denseJoint`() const; double :ref:`approximationError`() const; static Eigen::MatrixXd :ref:`exactJoint`(const Eigen::VectorXd& x, double lengthscale); }; .. _details-classgpr_1_1ski_1_1_derivative_s_k_i: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ D-SKI for one dimension of a squared-exponential factor. k(x,x') = exp(-(x-x')^2 / (2 l^2)) Holds W, dW and the grid kernel K_UU. The grid kernel is symmetric Toeplitz (a uniform grid and a stationary kernel), which is what makes the multiply cheap; it is stored by its first row. Construction ------------ .. index:: pair: function; DerivativeSKI .. _doxid-classgpr_1_1ski_1_1_derivative_s_k_i_1abe95dfa99fde6d5452b0848cef0a3ab0: .. ref-code-block:: cpp :class: doxyrest-title-code-block DerivativeSKI(const Eigen::VectorXd& x, double lengthscale, Eigen::Index m) Build the interpolant for inputs x on a grid of m points. lengthscale must be positive; m must be at least 4 for the cubic stencil to fit. A positive input range needs one interior step, which five points lack. Methods ------- .. index:: pair: function; gridKernelRow .. _doxid-classgpr_1_1ski_1_1_derivative_s_k_i_1aa4dad073708bc38916931edcd9b26479: .. ref-code-block:: cpp :class: doxyrest-title-code-block const Eigen::VectorXd& gridKernelRow() const First row of the symmetric Toeplitz grid kernel. .. index:: pair: function; applyGridKernel .. _doxid-classgpr_1_1ski_1_1_derivative_s_k_i_1a71e4ec1e9f45a40fc6384f53ed4b6e81: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::VectorXd applyGridKernel(const Eigen::VectorXd& v) const y = K_UU v, using the Toeplitz structure. .. index:: pair: function; denseJoint .. _doxid-classgpr_1_1ski_1_1_derivative_s_k_i_1ad729f6e07f5d2b327b6b1fb1d99f67af: .. ref-code-block:: cpp :class: doxyrest-title-code-block Eigen::MatrixXd denseJoint() const The 2n x 2n joint value/derivative matrix this interpolant represents. Dense, and only for validation against the exact kernel the point of D-SKI is never to form it. .. index:: pair: function; approximationError .. _doxid-classgpr_1_1ski_1_1_derivative_s_k_i_1aae5e5b62502016be933b09ec22132e2c: .. ref-code-block:: cpp :class: doxyrest-title-code-block double approximationError() const Relative Frobenius error ||A_ski - A_exact|| / ||A_exact||. .. index:: pair: function; exactJoint .. _doxid-classgpr_1_1ski_1_1_derivative_s_k_i_1aa4087072f20a4473f3bf12e714482c65: .. ref-code-block:: cpp :class: doxyrest-title-code-block static Eigen::MatrixXd exactJoint(const Eigen::VectorXd& x, double lengthscale) Exact joint value/derivative SE matrix for the same inputs, in the same block layout, so the two can be compared entry for entry.