MUQ  0.4.3
muq::Approximation::ConstantKernel Class Reference

#include <ConstantKernel.h>

Inheritance diagram for muq::Approximation::ConstantKernel:

Detailed Description

This class implements a constant kernel of the form

\[ k(x,y) = \sigma^2 \]

where, \(\sigma^2\) is the variance.

Definition at line 24 of file ConstantKernel.h.

Public Member Functions

 ConstantKernel (unsigned dim, const double sigma2In, const Eigen::Vector2d sigmaBounds={0.0, std::numeric_limits< double >::infinity()})
 
 ConstantKernel (unsigned dim, std::vector< unsigned > dimInds, const double sigma2In, const Eigen::Vector2d sigmaBounds={0.0, std::numeric_limits< double >::infinity()})
 
 ConstantKernel (unsigned dim, Eigen::MatrixXd const &sigma2In, const Eigen::Vector2d sigmaBounds={0.0, std::numeric_limits< double >::infinity()})
 
 ConstantKernel (unsigned dim, std::vector< unsigned > dimInds, Eigen::MatrixXd const &sigma2In, const Eigen::Vector2d sigmaBounds={0.0, std::numeric_limits< double >::infinity()})
 
virtual ~ConstantKernel ()=default
 
template<typename ScalarType1 , typename ScalarType2 , typename ScalarType3 >
void FillBlockImpl (Eigen::Ref< const Eigen::Matrix< ScalarType1, Eigen::Dynamic, 1 >> const &x1, Eigen::Ref< const Eigen::Matrix< ScalarType1, Eigen::Dynamic, 1 >> const &x2, Eigen::Ref< const Eigen::Matrix< ScalarType2, Eigen::Dynamic, 1 >> const &params, Eigen::Ref< Eigen::Matrix< ScalarType3, Eigen::Dynamic, Eigen::Dynamic >> block) const
 
virtual std::tuple< std::shared_ptr< muq::Modeling::LinearSDE >, std::shared_ptr< muq::Modeling::LinearOperator >, Eigen::MatrixXd > GetStateSpace (boost::property_tree::ptree sdeOptions=boost::property_tree::ptree()) const override
 Returns a state space representation of the covariance kernel. More...
 
 ConstantKernel (unsigned dim, const double sigma2In, const Eigen::Vector2d sigmaBounds={0.0, std::numeric_limits< double >::infinity()})
 
 ConstantKernel (unsigned dim, std::vector< unsigned > dimInds, const double sigma2In, const Eigen::Vector2d sigmaBounds={0.0, std::numeric_limits< double >::infinity()})
 
 ConstantKernel (unsigned dim, Eigen::MatrixXd const &sigma2In, const Eigen::Vector2d sigmaBounds={0.0, std::numeric_limits< double >::infinity()})
 
 ConstantKernel (unsigned dim, std::vector< unsigned > dimInds, Eigen::MatrixXd const &sigma2In, const Eigen::Vector2d sigmaBounds={0.0, std::numeric_limits< double >::infinity()})
 
virtual ~ConstantKernel ()
 
template<typename ScalarType1 , typename ScalarType2 , typename ScalarType3 >
void FillBlockImpl (Eigen::Ref< const Eigen::Matrix< ScalarType1, Eigen::Dynamic, 1 >> const &x1, Eigen::Ref< const Eigen::Matrix< ScalarType1, Eigen::Dynamic, 1 >> const &x2, Eigen::Ref< const Eigen::Matrix< ScalarType2, Eigen::Dynamic, 1 >> const &params, Eigen::Ref< Eigen::Matrix< ScalarType3, Eigen::Dynamic, Eigen::Dynamic >> block) const
 
- Public Member Functions inherited from muq::Approximation::KernelImpl< ConstantKernel >
 KernelImpl (unsigned inputDimIn, unsigned coDimIn, unsigned numParamsIn)
 
 KernelImpl (unsigned inputDimIn, std::vector< unsigned > dimIndsIn, unsigned coDimIn, unsigned numParamsIn)
 
virtual ~KernelImpl ()
 
virtual std::shared_ptr< KernelBaseClone () const override
 
virtual void FillBlock (Eigen::Ref< const Eigen::VectorXd > const &x1, Eigen::Ref< const Eigen::VectorXd > const &x2, Eigen::Ref< const Eigen::VectorXd > const &params, Eigen::Ref< Eigen::MatrixXd > block) const override
 
virtual void FillPosDerivBlock (Eigen::Ref< const Eigen::VectorXd > const &x1, Eigen::Ref< const Eigen::VectorXd > const &x2, Eigen::Ref< const Eigen::VectorXd > const &params, std::vector< int > const &wrts, Eigen::Ref< Eigen::MatrixXd > block) const override
 
void FillPosDerivBlockImpl (Eigen::Ref< const Eigen::VectorXd > const &x1, Eigen::Ref< const Eigen::VectorXd > const &x2, Eigen::Ref< const Eigen::VectorXd > const &params, std::vector< int > const &wrts, Eigen::Ref< Eigen::MatrixXd > block) const
 
Eigen::Matrix< ScalarType, Eigen::Dynamic, 1 > GetSegment (Eigen::Ref< const Eigen::Matrix< ScalarType, Eigen::Dynamic, 1 >> const &input) const
 
- Public Member Functions inherited from muq::Approximation::KernelBase
 KernelBase (unsigned int inputDimIn, unsigned int coDimIn, unsigned int numParamsIn)
 
 KernelBase (unsigned int inputDimIn, std::vector< unsigned int > dimIndsIn, unsigned int coDimIn, unsigned int numParamsIn)
 
virtual ~KernelBase ()
 
virtual std::vector< std::shared_ptr< KernelBase > > GetSeperableComponents ()
 Overridden by ProductKernel. More...
 
virtual Eigen::MatrixXd Evaluate (Eigen::VectorXd const &x1, Eigen::VectorXd const &x2) const
 
virtual Eigen::MatrixXd BuildCovariance (Eigen::MatrixXd const &x) const
 
virtual Eigen::MatrixXd BuildCovariance (Eigen::MatrixXd const &x1, Eigen::MatrixXd const &x2) const
 
virtual void FillCovariance (Eigen::MatrixXd const &xs, Eigen::MatrixXd const &ys, Eigen::Ref< Eigen::MatrixXd > cov) const
 
virtual void FillCovariance (Eigen::MatrixXd const &xs, Eigen::Ref< Eigen::MatrixXd > cov) const
 
virtual void FillDerivCovariance (Eigen::MatrixXd const &xs, Eigen::MatrixXd const &ys, std::vector< int > const &wrts, Eigen::Ref< Eigen::MatrixXd > cov) const
 
virtual Eigen::MatrixXd GetPosDerivative (Eigen::VectorXd const &x1, Eigen::VectorXd const &x2, std::vector< int > const &wrts) const
 Returns derivatives of the kernel with respect to the first input, x1. More...
 
virtual Eigen::MatrixXd GetParamBounds () const
 
virtual Eigen::VectorXd GetParams () const
 
virtual void SetParams (Eigen::VectorXd const &params)
 

Additional Inherited Members

- Public Attributes inherited from muq::Approximation::KernelBase
const std::vector< unsigned int > dimInds
 
const unsigned int inputDim
 
const unsigned int coDim
 
const unsigned int numParams
 

Constructor & Destructor Documentation

◆ ConstantKernel() [1/8]

ConstantKernel::ConstantKernel ( unsigned  dim,
const double  sigma2In,
const Eigen::Vector2d  sigmaBounds = {0.0, std::numeric_limits<double>::infinity()} 
)

Definition at line 8 of file ConstantKernel.cpp.

◆ ConstantKernel() [2/8]

ConstantKernel::ConstantKernel ( unsigned  dim,
std::vector< unsigned >  dimInds,
const double  sigma2In,
const Eigen::Vector2d  sigmaBounds = {0.0, std::numeric_limits<double>::infinity()} 
)

Definition at line 12 of file ConstantKernel.cpp.

◆ ConstantKernel() [3/8]

ConstantKernel::ConstantKernel ( unsigned  dim,
Eigen::MatrixXd const &  sigma2In,
const Eigen::Vector2d  sigmaBounds = {0.0, std::numeric_limits<double>::infinity()} 
)

◆ ConstantKernel() [4/8]

ConstantKernel::ConstantKernel ( unsigned  dim,
std::vector< unsigned >  dimInds,
Eigen::MatrixXd const &  sigma2In,
const Eigen::Vector2d  sigmaBounds = {0.0, std::numeric_limits<double>::infinity()} 
)

◆ ~ConstantKernel() [1/2]

virtual muq::Approximation::ConstantKernel::~ConstantKernel ( )
virtualdefault

◆ ConstantKernel() [5/8]

muq::Approximation::ConstantKernel::ConstantKernel ( unsigned  dim,
const double  sigma2In,
const Eigen::Vector2d  sigmaBounds = {0.0, std::numeric_limits<double>::infinity()} 
)
inline

Definition at line 29 of file LinearKernel.h.

◆ ConstantKernel() [6/8]

muq::Approximation::ConstantKernel::ConstantKernel ( unsigned  dim,
std::vector< unsigned >  dimInds,
const double  sigma2In,
const Eigen::Vector2d  sigmaBounds = {0.0, std::numeric_limits<double>::infinity()} 
)
inline

Definition at line 33 of file LinearKernel.h.

◆ ConstantKernel() [7/8]

muq::Approximation::ConstantKernel::ConstantKernel ( unsigned  dim,
Eigen::MatrixXd const &  sigma2In,
const Eigen::Vector2d  sigmaBounds = {0.0, std::numeric_limits<double>::infinity()} 
)
inline

Definition at line 39 of file LinearKernel.h.

◆ ConstantKernel() [8/8]

muq::Approximation::ConstantKernel::ConstantKernel ( unsigned  dim,
std::vector< unsigned >  dimInds,
Eigen::MatrixXd const &  sigma2In,
const Eigen::Vector2d  sigmaBounds = {0.0, std::numeric_limits<double>::infinity()} 
)
inline

Definition at line 57 of file LinearKernel.h.

◆ ~ConstantKernel() [2/2]

virtual muq::Approximation::ConstantKernel::~ConstantKernel ( )
inlinevirtual

Definition at line 76 of file LinearKernel.h.

Member Function Documentation

◆ FillBlockImpl() [1/2]

template<typename ScalarType1 , typename ScalarType2 , typename ScalarType3 >
void muq::Approximation::ConstantKernel::FillBlockImpl ( Eigen::Ref< const Eigen::Matrix< ScalarType1, Eigen::Dynamic, 1 >> const &  x1,
Eigen::Ref< const Eigen::Matrix< ScalarType1, Eigen::Dynamic, 1 >> const &  x2,
Eigen::Ref< const Eigen::Matrix< ScalarType2, Eigen::Dynamic, 1 >> const &  params,
Eigen::Ref< Eigen::Matrix< ScalarType3, Eigen::Dynamic, Eigen::Dynamic >>  block 
) const
inline

Definition at line 50 of file ConstantKernel.h.

References muq::Approximation::KernelBase::coDim.

◆ FillBlockImpl() [2/2]

template<typename ScalarType1 , typename ScalarType2 , typename ScalarType3 >
void muq::Approximation::ConstantKernel::FillBlockImpl ( Eigen::Ref< const Eigen::Matrix< ScalarType1, Eigen::Dynamic, 1 >> const &  x1,
Eigen::Ref< const Eigen::Matrix< ScalarType1, Eigen::Dynamic, 1 >> const &  x2,
Eigen::Ref< const Eigen::Matrix< ScalarType2, Eigen::Dynamic, 1 >> const &  params,
Eigen::Ref< Eigen::Matrix< ScalarType3, Eigen::Dynamic, Eigen::Dynamic >>  block 
) const
inline

Definition at line 79 of file LinearKernel.h.

References muq::Approximation::KernelBase::coDim.

◆ GetNumParams() [1/2]

static unsigned muq::Approximation::ConstantKernel::GetNumParams ( Eigen::MatrixXd const &  cov)
inlinestaticprivate

Definition at line 70 of file ConstantKernel.h.

◆ GetNumParams() [2/2]

static unsigned muq::Approximation::ConstantKernel::GetNumParams ( Eigen::MatrixXd const &  cov)
inlinestaticprivate

Definition at line 96 of file LinearKernel.h.

◆ GetStateSpace()

std::tuple< std::shared_ptr< muq::Modeling::LinearSDE >, std::shared_ptr< muq::Modeling::LinearOperator >, Eigen::MatrixXd > ConstantKernel::GetStateSpace ( boost::property_tree::ptree  sdeOptions = boost::property_tree::ptree()) const
overridevirtual

Returns a state space representation of the covariance kernel.

If this is a one dimensional kernel (i.e., inputDim=1 and coDim=1), this function returns a state space representation of the covariance kernel. In particular, it returns a linear time invariant stochastic differential equation, whose solution, when started with the returned stationary covariance, provides the same information as this Gaussian process. The first component of the vector-valued stochastic differential equation is related to the Gaussian process. See "Kalman filtering and smoothing solutions to temporal Gaussian process regression models," by Jouni Hartikainen and Simo Sarkka, for more information.

Reimplemented from muq::Approximation::KernelBase.

Definition at line 56 of file ConstantKernel.cpp.

References muq::Approximation::KernelBase::cachedParams, muq::Approximation::KernelBase::coDim, and muq::Approximation::KernelBase::inputDim.


The documentation for this class was generated from the following files: