![]() |
SynAPSE
0.6.0
Synergistic Analysis of Phase Space Evolution
|
Reconstructs the optimal α-contour of a Probability Density Function. More...
#include <ProbabilityContour.hh>
Public Member Functions | |
| ProbabilityContour () | |
| Default constructor, initilizes everything to 0. More... | |
| ProbabilityContour (const std::vector< Vertex > &vertices, const Grid grid=Grid(), const std::string algo="hull") | |
| Hull constructor, sets the vertices and their mapping, computes hull volumes. More... | |
| ProbabilityContour (const Grid &grid, const std::string algo="rectangle") | |
| Grid constructor, sets a grid of points at which the function is known. More... | |
| ProbabilityContour (const std::vector< Vertex > &vertices, const std::vector< Vertex > &mcvertices, const double &boxvol, const Grid grid=Grid()) | |
| MC constructor, sets the vertices, mcvertices and box volume. More... | |
| ProbabilityContour (const ProbabilityContour &cont) | |
| Copy constructor. More... | |
| ProbabilityContour & | operator= (const ProbabilityContour &cont) |
| Equality operator. More... | |
| ~ProbabilityContour () | |
| Destructor. More... | |
| TH1F * | Contour1D (size_t idx=0) const |
| Returns segments that represent the 1D contour on a function. More... | |
| TH2F * | Contour2D (size_t idx=0, size_t idy=1) const |
| Returns the requested 2D contour on a function. More... | |
| TH3F * | Contour3D (size_t idx=0, size_t idy=1, size_t idz=2) const |
| Returns the requested 2D contour on a function. More... | |
| void | Evaluate (double alpha, double eps=1e-3) |
| Computes the optimal contour using the specified algorithm. More... | |
| bool | IsInitialized () const |
| Returns the array of indices of the vertices used. More... | |
| const double & | GetAlpha () const |
| Returns the fraction of the function for which the contour was computed. More... | |
| const double & | GetBoxVolume () const |
| Returns the volume of the box containing the MC vertices. More... | |
| const double & | GetContourVolume () const |
| Returns the volume of the current contour. More... | |
| double | GetContourVolumeError () const |
| Returns the volume of the current contour. More... | |
| const std::vector< std::vector < size_t > > & | GetIndexArray () const |
| Returns the array of indices of grid cells used to build the contour. More... | |
| const std::vector< Vertex > & | GetMCVertexArray () const |
| Returns the array of MC vertices used to determine the contour. More... | |
| const std::vector< Vertex > & | GetVertexArray () const |
| Returns the array of input vertices. More... | |
| const double & | GetVolume () const |
| Returns the volume of the contour. More... | |
| void | SetMCVertexArray (const std::vector< Vertex > &mcvertices) |
| Sets the array of MC vertices used to determine the contour. More... | |
| void | SetVertexArray (const std::vector< Vertex > &vertices) |
| Sets the array of input vertices. More... | |
| void | SetBoxVolume (const double &boxvol) |
| Sets the array of input vertices. More... | |
Private Member Functions | |
| void | AlphaComplexMethod (double alpha, double eps) |
| Computes the optimal contour using the "alphac" method. More... | |
| void | HullMethod (double alpha, double eps) |
| Computes the optimal contour using the "hull" method. More... | |
| void | MCMethod (double alpha, double eps) |
| Computes the optimal contour using the "mc" method. More... | |
| void | RectangleMethod (double alpha, double) |
| Computes the optimal contour using the "rectangle" method. More... | |
| void | TrapezoidMethod (double alpha, double eps=1e-3) |
| Computes the optimal contour using the "trapezoid" method. More... | |
Private Attributes | |
| std::string | _algo |
| Contour computation algorithm. More... | |
| Grid | _grid |
| Grid of points are their value. More... | |
| std::vector< std::vector < size_t > > | _indices |
| Vector of indices of the vertices used. More... | |
| double | _alpha |
| Fraction of the function. More... | |
| double | _volume |
| Volume of the contour. More... | |
| double | _level |
| Level of the contour. More... | |
| std::vector< Vertex > | _vertices |
| Density estimation input vertices. More... | |
| std::vector< Vertex > | _mcvertices |
| Monte Carlo vertices on a box. More... | |
| double | _boxvol |
| Volume of the box in which the MC is run. More... | |
Reconstructs the optimal α-contour of a Probability Density Function.
Provided with a scalar field normalised to 1 and defined everywhere, the algorithm finds the manifold that bounds the α-contour and reconstructs its volume. The α-contour is the smallest hypersurface that contains a fraction α of the total probability.
| ProbabilityContour::ProbabilityContour | ( | ) |
Default constructor, initilizes everything to 0.
| ProbabilityContour::ProbabilityContour | ( | const Grid & | grid, |
| const std::string | algo = "rectangle" |
||
| ) |
| ProbabilityContour::ProbabilityContour | ( | const std::vector< Vertex > & | vertices, |
| const std::vector< Vertex > & | mcvertices, | ||
| const double & | boxvol, | ||
| const Grid | grid = Grid() |
||
| ) |
MC constructor, sets the vertices, mcvertices and box volume.
| vertices | Density estimation input vertices |
| mcvertices | MC vertices uniformly distributed inside a box |
| boxvol | Scaled volume of the box in which the MC vertices were produced |
| grid | Grid on which the distrubution is evaluated (to draw only) |
| ProbabilityContour::ProbabilityContour | ( | const ProbabilityContour & | cont | ) |
Copy constructor.
| ProbabilityContour::~ProbabilityContour | ( | ) |
Destructor.
|
private |
Computes the optimal contour using the "alphac" method.
| alpha | Integrated probability to achieve |
| eps | Resolution with which to achieve the contour |
| TH1F * ProbabilityContour::Contour1D | ( | size_t | idx = 0 | ) | const |
Returns segments that represent the 1D contour on a function.
| idx | ID of the axis in which to plot the contour |
| TH2F * ProbabilityContour::Contour2D | ( | size_t | idx = 0, |
| size_t | idy = 1 |
||
| ) | const |
Returns the requested 2D contour on a function.
| idx | ID of the first axis in which to plot the contour |
| idy | ID of the second axis in which to plot the contour |
| TH3F * ProbabilityContour::Contour3D | ( | size_t | idx = 0, |
| size_t | idy = 1, |
||
| size_t | idz = 2 |
||
| ) | const |
Returns the requested 2D contour on a function.
| idx | ID of the first axis in which to plot the contour |
| idy | ID of the second axis in which to plot the contour |
| idz | ID of the third axis in which to plot the contour |
| void ProbabilityContour::Evaluate | ( | double | alpha, |
| double | eps = 1e-3 |
||
| ) |
Computes the optimal contour using the specified algorithm.
| alpha | Integrated probability to achieve |
| eps | Resolution with which to achieve the contour |
|
inline |
Returns the fraction of the function for which the contour was computed.
|
inline |
Returns the volume of the box containing the MC vertices.
|
inline |
Returns the volume of the current contour.
| double ProbabilityContour::GetContourVolumeError | ( | ) | const |
Returns the volume of the current contour.
|
inline |
Returns the array of indices of grid cells used to build the contour.
|
inline |
Returns the array of MC vertices used to determine the contour.
|
inline |
Returns the array of input vertices.
|
inline |
Returns the volume of the contour.
|
private |
Computes the optimal contour using the "hull" method.
| alpha | Integrated probability to achieve |
| eps | Resolution with which to achieve the contour |
|
inline |
Returns the array of indices of the vertices used.
|
private |
Computes the optimal contour using the "mc" method.
| alpha | Integrated probability to achieve |
| eps | Resolution with which to achieve the contour |
| ProbabilityContour & ProbabilityContour::operator= | ( | const ProbabilityContour & | cont | ) |
Equality operator.
|
private |
Computes the optimal contour using the "rectangle" method.
| alpha | Integrated probability to achieve |
| eps | Resolution with which to achieve the contour |
|
inline |
Sets the array of input vertices.
|
inline |
Sets the array of MC vertices used to determine the contour.
|
inline |
Sets the array of input vertices.
|
private |
Computes the optimal contour using the "trapezoid" method.
| alpha | Integrated probability to achieve |
| eps | Resolution with which to achieve the contour |
|
private |
Contour computation algorithm.
|
private |
Fraction of the function.
|
private |
Volume of the box in which the MC is run.
|
private |
Vector of indices of the vertices used.
|
private |
Level of the contour.
|
private |
Monte Carlo vertices on a box.
|
private |
Density estimation input vertices.
|
private |
Volume of the contour.
1.8.6