|
CMP++: Uncertainty Quantification & Bayesian Calibration
|
Adapts a univariate probability distribution to act as a prior on a single coordinate. More...
#include <prior++.h>


Public Member Functions | |
| FromDistribution ()=delete | |
| FromDistribution (const FromDistribution &)=default | |
| FromDistribution (FromDistribution &&)=default | |
| FromDistribution & | operator= (const FromDistribution &)=default |
| FromDistribution & | operator= (FromDistribution &&)=default |
| FromDistribution (const DistType &dist, size_t paramIndex) | |
| Constructs a Prior from a Univariate Distribution. | |
| double | eval (const Eigen::VectorXd &par) const override |
| double | evalGradient (const Eigen::VectorXd &par, const size_t &i) const override |
| double | evalHessian (const Eigen::VectorXd &par, const size_t &i, const size_t &j) const override |
Public Member Functions inherited from cmp::prior::Prior | |
| virtual | ~Prior ()=default |
Static Public Member Functions | |
| static std::shared_ptr< Prior > | make (const DistType &dist, size_t paramIndex) |
Private Attributes | |
| DistType | dist_ |
| Underlying univariate distribution. | |
| size_t | paramIndex_ |
| Parameter vector coordinate index. | |
Adapts a univariate probability distribution to act as a prior on a single coordinate.
Mathematical Formulation Applies a univariate distribution \( \mathcal{D} \) to a specific parameter dimension \( k \):
\[ \log p(\theta) = \log p_{\mathcal{D}}(\theta_k) \]
The gradient is non-zero only for coordinate \( k \):
\[ \frac{\partial \log p(\theta)}{\partial \theta_i} = \begin{cases} \frac{d \log p_{\mathcal{D}}(\theta_k)}{d \theta_k} & \text{if } i = k \\ 0 & \text{otherwise} \end{cases} \]
The Hessian is non-zero only for diagonal entry \( (k, k) \):
\[ \frac{\partial^2 \log p(\theta)}{\partial \theta_i \partial \theta_j} = \begin{cases} \frac{d^2 \log p_{\mathcal{D}}(\theta_k)}{d \theta_k^2} & \text{if } i = j = k \\ 0 & \text{otherwise} \end{cases} \]
Implementation Algorithm Accesses parameter coordinate \( \theta_k \) and delegates log-PDF and its first/second derivative calculations to the underlying dist_ object.
|
delete |
|
default |
|
default |
|
inline |
Constructs a Prior from a Univariate Distribution.
| dist | The distribution instance (e.g., NormalDistribution) |
| paramIndex | The index in the Eigen::VectorXd this prior applies to |
|
inlineoverridevirtual |
Implements cmp::prior::Prior.
|
inlineoverridevirtual |
Implements cmp::prior::Prior.
|
inlineoverridevirtual |
Implements cmp::prior::Prior.
|
inlinestatic |
|
default |
|
default |
|
private |
Underlying univariate distribution.
|
private |
Parameter vector coordinate index.