CMP++: Uncertainty Quantification & Bayesian Calibration
Loading...
Searching...
No Matches
cmp::kernel::FullBandwidth Class Reference

Full covariance bandwidth matrix parameterized by its Cholesky factor. More...

#include <kernel++.h>

Inheritance diagram for cmp::kernel::FullBandwidth:
Collaboration diagram for cmp::kernel::FullBandwidth:

Public Member Functions

 FullBandwidth ()=delete
 
 FullBandwidth (const Eigen::MatrixXd &LLT)
 Constructs a FullBandwidth from a positive definite scale matrix.
 
double determinant () const override
 Computes the determinant of the bandwidth matrix.
 
size_t size () const
 Returns the dimension of the space.
 
std::pair< size_t, size_t > indexToRowCol (const size_t &i) const
 Maps a flat index to row and column indices of the Cholesky factor.
 
Eigen::VectorXd apply (const Eigen::VectorXd &x1, const Eigen::VectorXd &x2) const override
 Projects the distance vector using the inverse of the Cholesky factor L.
 
Eigen::VectorXd gradientOfApply (const Eigen::VectorXd &x1, const Eigen::VectorXd &x2, const size_t &i) const override
 Computes the gradient of the scaling transformation with respect to parameter i.
 
double gradientOfLogDeterminant (const size_t &i) const override
 Computes the gradient of the log-determinant.
 
void setFromVector (const Eigen::VectorXd &params) override
 Sets the bandwidth parameters from a parameter vector.
 
Eigen::VectorXd getParams () const override
 Gets the bandwidth parameters as a vector.
 
Eigen::MatrixXd matrix () const
 Returns the full density bandwidth matrix.
 
- Public Member Functions inherited from cmp::kernel::Bandwidth
virtual ~Bandwidth ()=default
 

Static Public Member Functions

static std::shared_ptr< Bandwidthmake (const Eigen::MatrixXd &LLT)
 Factory method for creating a FullBandwidth.
 

Private Attributes

Eigen::LLT< Eigen::MatrixXd > L_
 LDLT/Cholesky factor of the covariance scaling matrix.
 
double det_
 Precomputed determinant of the full bandwidth matrix.
 
size_t dim_
 Dimension of the input space.
 

Detailed Description

Full covariance bandwidth matrix parameterized by its Cholesky factor.

Mathematical Formulation Represents a full bandwidth matrix parameterized via lower triangular Cholesky factor \(\mathbf{L}\) where:

\[ \mathbf{H} = \mathbf{L} \mathbf{L}^T \]

The transformation projects distances as:

\[ \mathbf{z} = \mathbf{L}^{-1} (\mathbf{x}_1 - \mathbf{x}_2) \]

The determinant is computed from the diagonal elements of the Cholesky factor:

\[ \det(\mathbf{H}) = \prod_{d=1}^D L_{dd}^2 \]

Constructor & Destructor Documentation

◆ FullBandwidth() [1/2]

cmp::kernel::FullBandwidth::FullBandwidth ( )
delete

◆ FullBandwidth() [2/2]

cmp::kernel::FullBandwidth::FullBandwidth ( const Eigen::MatrixXd &  LLT)
inline

Constructs a FullBandwidth from a positive definite scale matrix.

Member Function Documentation

◆ apply()

Eigen::VectorXd cmp::kernel::FullBandwidth::apply ( const Eigen::VectorXd &  x1,
const Eigen::VectorXd &  x2 
) const
overridevirtual

Projects the distance vector using the inverse of the Cholesky factor L.

Implements cmp::kernel::Bandwidth.

◆ determinant()

double cmp::kernel::FullBandwidth::determinant ( ) const
overridevirtual

Computes the determinant of the bandwidth matrix.

Implements cmp::kernel::Bandwidth.

◆ getParams()

Eigen::VectorXd cmp::kernel::FullBandwidth::getParams ( ) const
overridevirtual

Gets the bandwidth parameters as a vector.

Implements cmp::kernel::Bandwidth.

◆ gradientOfApply()

Eigen::VectorXd cmp::kernel::FullBandwidth::gradientOfApply ( const Eigen::VectorXd &  x1,
const Eigen::VectorXd &  x2,
const size_t &  i 
) const
overridevirtual

Computes the gradient of the scaling transformation with respect to parameter i.

Implements cmp::kernel::Bandwidth.

◆ gradientOfLogDeterminant()

double cmp::kernel::FullBandwidth::gradientOfLogDeterminant ( const size_t &  i) const
overridevirtual

Computes the gradient of the log-determinant.

Implements cmp::kernel::Bandwidth.

◆ indexToRowCol()

std::pair< size_t, size_t > cmp::kernel::FullBandwidth::indexToRowCol ( const size_t &  i) const

Maps a flat index to row and column indices of the Cholesky factor.

◆ make()

static std::shared_ptr< Bandwidth > cmp::kernel::FullBandwidth::make ( const Eigen::MatrixXd &  LLT)
inlinestatic

Factory method for creating a FullBandwidth.

◆ matrix()

Eigen::MatrixXd cmp::kernel::FullBandwidth::matrix ( ) const
inline

Returns the full density bandwidth matrix.

◆ setFromVector()

void cmp::kernel::FullBandwidth::setFromVector ( const Eigen::VectorXd &  params)
overridevirtual

Sets the bandwidth parameters from a parameter vector.

Implements cmp::kernel::Bandwidth.

◆ size()

size_t cmp::kernel::FullBandwidth::size ( ) const
inlinevirtual

Returns the dimension of the space.

Implements cmp::kernel::Bandwidth.

Member Data Documentation

◆ det_

double cmp::kernel::FullBandwidth::det_
private

Precomputed determinant of the full bandwidth matrix.

◆ dim_

size_t cmp::kernel::FullBandwidth::dim_
private

Dimension of the input space.

◆ L_

Eigen::LLT<Eigen::MatrixXd> cmp::kernel::FullBandwidth::L_
private

LDLT/Cholesky factor of the covariance scaling matrix.


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