Exponential Distribution PDF and CDF

Probability Theory DS practice problem on Onlearn.

Difficulty: easy.

Topics: Exponential Distribution PDF and CDF, Memoryless Property, Rate Parameter Lambda, Cumulative Distribution Function, Probability Density Function, Hazard Function, Probability Theory, Statistical Inference, Calculus, Stochastic Processes, Information Theory, Continuous Probability Distributions, Maximum Likelihood Estimation, Integral Calculus, Poisson Point Processes, Entropy and Divergence.

The exponential distribution is a continuous probability distribution that models the time between events in a Poisson process. It is characterized by a single rate parameter lambda (the average rate of events). Your task is to implement a function exponential distribution(x, lam) that computes properties of an exponential distribution with rate parameter lam at the specified points x. Input: x: A list or array of points at which to evaluate the distribution lam: The rate parameter (lambda) of the exponential distribution (must be positive) Output: Return a dictionary with the following keys: 'pdf': A list of probability density function values at each point in x (rounded to 4 decimal places) 'cdf': A list of cumulative distribution function values at each point in x (rounded to 4 decimal places) 'mean': The theoretical mean of the distribution (rounded to 4 decimal places) 'variance': The theoretical variance of the distribution (rounded to 4 decimal places) Edge Cases: For x values less than 0, both PDF and CDF should be 0 If lambda is not positive, return a dictionary with all values set to None