I don't know how to plot the probability distribution function (PDF) and the cumulative one given λ = 1/5
for N=10
observations
CodePudding user response:
The 3 functions you are looking for are dexp()
, qexp()
and rexp()
. Use the ?
operator to get the help page for them.
Each stat distribution has the equivalent set of functions that define the density, quantiles (cumulative) and a data set.
R uses plot(x, y)
notation to make a plot. If you are using Rstudio, you can use the GUI to save the image, else you can do:
png("name.png")
plot(x, y)
dev.off()
I'm not wholly confident on stack overflow's policy on answering homework questions, but I think this isn't overstepping. I think figuring out what goes on the x and y axes constitutes what you're supposed to figure out.