Re: [R] How to simulate from an estimated density

2010-10-25 Thread Duncan Murdoch
wangguojie2006 wrote: Thanks. I got it. Another question, why every time I posted something, it needs approval before it shows up? Any way I can speed up posting? Don't post from gmail.com. Duncan Murdoch (posting from gmail.com ...) __ R-help@r-p

Re: [R] How to simulate from an estimated density

2010-10-25 Thread wangguojie2006
Thanks. I got it. Another question, why every time I posted something, it needs approval before it shows up? Any way I can speed up posting? -- View this message in context: http://r.789695.n4.nabble.com/How-to-simulate-from-an-estimated-density-tp3009394p3012815.html Sent from the R help mail

Re: [R] How to simulate from an estimated density

2010-10-24 Thread sachinthaka . abeywardana
You usually simulate a distribution by: 1. building the cumulative distribution (use cumsum). 2. Simulating a random number (from uniform distribution, use runif (number_of_simulations_needed)). 3. Get the closest number to the number simulated from the cumulative distribution. 4. The corresponding

[R] How to simulate from an estimated density

2010-10-24 Thread wangguojie2006
Hi, dear fellows, I was wondering how can I simulate from an estimated density function? I used my training data set and already have estimated density values at some fixed points. I plan to simulate some data from such estimated density and compare them to my validation data set. Anyone can help