UniformDistribution Class
- class Stats_Analysis.Base_Dist.UniformDistribution_Class.UniformDistribution(lower_bound, upper_bound)[source]
Bases:
objectUniform distribution probability distribution.
This class supports computation of the PDF and CDF for scalar and array inputs, defined over a finite interval [lower_bound, upper_bound].
- Parameters:
lower_bound (float) – The lower bound of the uniform distribution.
upper_bound (float) – The upper bound of the uniform distribution.
- Raises:
ValueError – If lower_bound >= upper_bound.
- __init__(lower_bound, upper_bound)[source]
Initialize the uniform distribution over the interval [lower_bound, upper_bound].
- cdf(X)[source]
Compute the Cumulative Distribution Function (CDF).
- Parameters:
X (float or np.ndarray) – The value(s) at which to evaluate the CDF.
- Returns:
The CDF value(s).
- Return type:
float or np.ndarray
- cdf_fitting(X)[source]
Calculate the Probability Density Function (PDF) for a fit.
- Parameters:
X (float or np.ndarray) – The value(s) at which to evaluate the PDF.
- Returns:
The normalized PDF value(s) which are 0 for X outside [lower_bound, upper_bound].
- Return type:
float or np.ndarray
- normalisation_check()[source]
Perform a numerical integration using scipy.integrate.quad to check the normalization of the PDF.
If the PDF has been truncated: It is first performed over the region the PDF is defined [lower_bound, upper_bound]
It is then performed over the entire real line (-infinity to infinity).
Prints the results of the numerical integrations.
- pdf(X)[source]
Calculate the Probability Density Function (PDF).
- Parameters:
X (float or np.ndarray) – The value(s) at which to evaluate the PDF.
- Returns:
The normalized PDF value(s) which are 0 for X outside [lower_bound, upper_bound].
- Return type:
float or np.ndarray