27 using gsl_rng_sptr = std::unique_ptr<gsl_rng,
decltype(&gsl_rng_free)>;
84 explicit FlatMarginal(
double a,
double b,
unsigned int seed = std::random_device{}());
87 std::vector<double>
rvs(std::size_t n)
override;
90 double logpdf(
double x)
override;
95 double cdf(
double x)
override;
98 double ppf(
double p)
override;
101 double mean()
override;
104 double std()
override;
108 const gsl_rng_type* rng_tp {gsl_rng_mt19937};
109 gsl_rng_sptr eng_{gsl_rng_alloc(rng_tp), &gsl_rng_free};
Base type for lightweight configuration structures.
std::unique_ptr< gsl_rng, decltype(&gsl_rng_free)> gsl_rng_sptr
std::unique_ptr< gsl_rng, decltype(&gsl_rng_free)> gsl_rng_sptr
Interface for one-dimensional marginal probability distributions.
Continuous uniform marginal distribution on [a,b].
double ppf(double p) override
Evaluates the quantile function (inverse CDF).
double logpdf(double x) override
Evaluates the logarithm of the probability density at x.
std::vector< double > rvs(std::size_t n) override
Draws random samples from the marginal distribution.
double cdf(double x) override
Evaluates the cumulative distribution function at x.
double mean() override
Returns the mean of the distribution.
PDFDiff f_df_ddf(double x) override
double std() override
Returns the standard deviation of the distribution.
Polymorphic base class for configuration types.
Configuration object for FlatMarginal.
double b
Lower bound of the support.
FlatMarginalCfg(double a, double b)
Constructs a flat marginal configuration.
FlatMarginalCfg()=default
Upper bound of the support.
Abstract interface for scalar marginal distributions.