I know this must be pretty basic, but what is the proper, accurate way to plot the PDF of some sample data that you know comes from some pop. distribution, like if you generated it using rnorm()
or rexp()
?
The reason I ask is because I know a lot of people use density()
, and then input that into plot()
, but the density()
function seems too arbitrary to be accurate; for example, it is inaccurate when it approximates negative value for data that came from the exponential distribution, which does not possess neg. values.
So could someone recommend me a more fine-tuned method to accomplish plotting sample PDFs?