pops-core
0.9
PoPS (Pest or Pathogen Spread) Model Core C++ library
|
Go to the documentation of this file.
16 #ifndef POPS_WEIBULL_KERNEL_HPP
17 #define POPS_WEIBULL_KERNEL_HPP
44 if (
a <= 0 ||
b <= 0) {
45 throw std::invalid_argument(
46 "scale and shape parameters must be greater than zero");
56 template<
class Generator>
71 throw std::invalid_argument(
"x must be greater than or equal to 0.0");
75 return (
a /
b) * pow(x /
b,
a - 1) * exp(-pow(x /
b,
a));
86 if (x <= 0 || x >= 1) {
87 throw std::invalid_argument(
"icdf: x must be between 0 and 1.0");
89 return a * pow(-(log(1 - x)), (1.0 /
b));
95 #endif // POPS_WEIBULL_KERNEL_HPP
Dispersal kernel for weibull distribution class utilized by RadialKernel and DeterministicKernel.
double random(Generator &generator)
Returns random value from weibull distribution Used by RadialKernel to determine location of spread.
std::weibull_distribution< double > weibull_distribution
WeibullKernel(double scale, double shape)
double pdf(double x)
Weibull probability density function Used by DeterministicKernel to determine location of spread.
double icdf(double x)
Weibull inverse cumulative distribution (quantile) function Used by DeterministicKernel to determine ...
Kernel types enum and helper functions.