I've been trying to figure this out for a while, but my knowledge of R is obviously still too limited. The context is as follows: I have some time series, and I would like to estimate their densities, and then use the actual densities in a monte carlo simulation. Now, I can easily estimate the density using density(); I can write a random number generator to fit an arbitrary density function (using the rejection method), but I can't figure out how to get a density function from the estimator. Any idea how I can go about that? Thanks in advance, Burkhard Kloss
....but I can't figure out how to get a density function from the estimator. I would suggest that you look at the logspline package. The density estimation is excellent and simulation methods are provided. url: http://www.econ.uiuc.edu Roger Koenker email roger at ysidro.econ.uiuc.edu Department of Economics vox: 217-333-4558 University of Illinois fax: 217-244-6678 Champaign, IL 61820
Thanks! That seems to be just what I'm after! -----Original Message----- From: Roger Koenker [mailto:roger at ysidro.econ.uiuc.edu] Sent: 13 January 2003 15:14 To: Kloss, Burkhard Cc: r-help Subject: Re: [R] density estimation ....but I can't figure out how to get a density function from the estimator. I would suggest that you look at the logspline package. The density estimation is excellent and simulation methods are provided. url: http://www.econ.uiuc.edu Roger Koenker email roger at ysidro.econ.uiuc.edu Department of Economics vox: 217-333-4558 University of Illinois fax: 217-244-6678 Champaign, IL 61820