In: Statistics and Probability
Use R functions search and objects to find all possible R built-in functions related to exp distribution. rexp should be one of them. dexp is another one. Explain what the following two lines of codes do: curve(dexp, from=0, to=4)
We can use ?rexp to find all the functions related to exponential the after runing this we will get
As we can see rexp gives us random observation distributed exponentially with rate parameter 1 , if not given and dexp gives us the density of the exponential distribution at the give point and if rate parameter is not given it will assume rate = 1
curve(dexp, from=0, to=4)
This function will graph exponential pdf with rate parameter 1 ,from 0 to 4 following is the result after running code