7. Validating a Probability Density Function. One of the properties of a probability density function (pdf) is that its values must be non-negative over its entire support. Let's validate this property for a given function.
Consider the function \( f = \frac{x}{60} \) over the interval [0, 10]. In this exercise, you will check if the values of this function are non-negative over its support using R
.
To evaluate a function over a sequence of numbers, you can use the sapply()
function in R, which applies a function to each element of a list or vector. Also, use the min()
function to check the minimum value of the sequence.
Note: We are only checking whether the function is negative at the integers between 0 and 10; however, it is, of couse, also possible that it is negative between integer values.