API documentation

pdf

Core logic for the pdf definition.

class pdf.ProbabilityDensityFunction(x, y, k=3)[source]

Class describing a probability density function.

Parameters:
  • x (array-like) – The array of x values to be passed to the pdf, assumed to be sorted.
  • y (array-like) – The array of y values to be passed to the pdf.
  • k (int) – The order of the splines to be created.
prob(x1, x2)[source]

Return the probability for the random variable to be included between x1 and x2.

Parameters:
  • x1 (float or array-like) – The left bound for the integration.
  • x2 (float or array-like) – The right bound for the integration.
rnd(size=1000)[source]

Return an array of random values from the pdf.

Parameters:size (int) – The number of random numbers to extract.