MIDSX 0.1
A x-ray transport code system for dosimetry
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ProbabilityDist::ContinuousInversion Class Reference

Class which uses PENELOPE's RITA inversion sampling algorithm to sample from a continuous distribution. More...

#include <probability_dist.h>

Collaboration diagram for ProbabilityDist::ContinuousInversion:

Public Member Functions

 ContinuousInversion (std::function< double(double, double)> &PDF, Eigen::VectorXd &energies, double x_min, double x_max, double err_thresh=1E-4)
 Constructor for the ContinuousInversion class.
 
double sample (double E) const
 Returns a sample from the continuous distribution.
 

Private Member Functions

void normalizePDF (double E)
 
double getXFromY (int energy_index, double y) const
 
void initializeCDFAndInterpolationParameters ()
 
Eigen::Array< double, Eigen::Dynamic, 2 > calculateInterpolationParametersPerEnergy (double E, Eigen::Array< double, Eigen::Dynamic, 2 > CDF_RITA_PER_ENERGY)
 
Eigen::Array< double, Eigen::Dynamic, 2 > getMinimizedErrorCDFPerEnergy (double E, double err_thresh)
 
Eigen::Array< double, Eigen::Dynamic, 2 > generateCDFPerEnergy (double E, Eigen::VectorXd x_grid)
 
double getInterpErrorOverInterval (double E, IntervalData id) const
 
double getPDFFromCDFOverInterval (double E, double x, IntervalData id) const
 
double getEta (double x, IntervalData id) const
 

Private Attributes

std::function< double(double, double)> PDF_
 
std::function< double(double, double)> normalized_PDF_
 
std::vector< Eigen::Array< double, Eigen::Dynamic, 2 > > CDF_
 
Eigen::VectorXd energies_
 
std::vector< Eigen::Array< double, Eigen::Dynamic, 2 > > interp_parameters_
 
double x_min_
 
double x_max_
 
double err_thresh_
 
ProbabilityDist::Uniform uniform_dist_
 

Detailed Description

Class which uses PENELOPE's RITA inversion sampling algorithm to sample from a continuous distribution.

Definition at line 112 of file probability_dist.h.

Constructor & Destructor Documentation

◆ ContinuousInversion()

ProbabilityDist::ContinuousInversion::ContinuousInversion ( std::function< double(double, double)> & PDF,
Eigen::VectorXd & energies,
double x_min,
double x_max,
double err_thresh = 1E-4 )
explicit

Constructor for the ContinuousInversion class.

Parameters
PDFThe probability density function to sample from.
energiesThe energies at which to generate the CDF.
x_minThe minimum value of the distribution.
x_maxThe maximum value of the distribution.
err_threshThe maximum error allowed for the between the interpolated PDF and the actual PDF.

Member Function Documentation

◆ sample()

double ProbabilityDist::ContinuousInversion::sample ( double E) const

Returns a sample from the continuous distribution.

Parameters
EThe energy at which to sample from the distribution.
Returns
A sample from the continuous distribution.
Here is the caller graph for this function:

Member Data Documentation

◆ CDF_

std::vector<Eigen::Array<double, Eigen::Dynamic, 2> > ProbabilityDist::ContinuousInversion::CDF_
private

Definition at line 138 of file probability_dist.h.

◆ energies_

Eigen::VectorXd ProbabilityDist::ContinuousInversion::energies_
private

Definition at line 139 of file probability_dist.h.

◆ err_thresh_

double ProbabilityDist::ContinuousInversion::err_thresh_
private

Definition at line 143 of file probability_dist.h.

◆ interp_parameters_

std::vector<Eigen::Array<double, Eigen::Dynamic, 2> > ProbabilityDist::ContinuousInversion::interp_parameters_
private

Definition at line 140 of file probability_dist.h.

◆ normalized_PDF_

std::function<double(double, double)> ProbabilityDist::ContinuousInversion::normalized_PDF_
private

Definition at line 137 of file probability_dist.h.

◆ PDF_

std::function<double(double, double)> ProbabilityDist::ContinuousInversion::PDF_
private

Definition at line 136 of file probability_dist.h.

◆ uniform_dist_

ProbabilityDist::Uniform ProbabilityDist::ContinuousInversion::uniform_dist_
private

Definition at line 144 of file probability_dist.h.

◆ x_max_

double ProbabilityDist::ContinuousInversion::x_max_
private

Definition at line 142 of file probability_dist.h.

◆ x_min_

double ProbabilityDist::ContinuousInversion::x_min_
private

Definition at line 141 of file probability_dist.h.


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