Chi-square Probability Distribution

Probability Theory DS practice problem on Onlearn.

Difficulty: medium.

Topics: Understanding the Chi-Square Probability Density Function, Chi-square Distribution, Probability Density Function (PDF), Special Functions, Exponential Family Distributions, Sum of Squared Normal Variables, Probability Theory, Statistical Inference, Calculus, Mathematical Analysis, Numerical Computing, Continuous Probability Distributions, Gamma Function, Degrees of Freedom, Likelihood Functions, Goodness-of-Fit Tests.

Implement a function that calculates the probability density function (PDF) value of a Chi square distribution for a given value x and degrees of freedom k. The function should return 0 for x <= 0 and use the mathematical definition for x 0.