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 out is really appreciated. Thanks. Jay -- View this message in context: http://r.789695.n4.nabble.com/How-to-simulate-from-an-estimated-density-tp3009394p3009394.html Sent from the R help mailing list archive at Nabble.com.
sachinthaka.abeywardana at allianz.com.au
2010-Oct-24 22:33 UTC
[R] How to simulate from an estimated density
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 value is your distribution. As to comparing them look up a Q-Q plot. hope this helps (or what you asked for), Sachin p.s. I'm sorry if this has an corporate disclaimer attached (don't know how to get rid of it). --- Please consider the environment before printing this email --- Allianz - Best General Insurance Company of the Year 2010* Allianz - General Insurance Company of the Year 2009+ * Australian Banking and Finance Insurance Awards + Australia and New Zealand Insurance Industry Awards This email and any attachments has been sent by Allianz Australia Insurance Limited (ABN 15 000 122 850) and is intended solely for the addressee. It is confidential, may contain personal information and may be subject to legal professional privilege. Unauthorised use is strictly prohibited and may be unlawful. If you have received this by mistake, confidentiality and any legal privilege are not waived or lost and we ask that you contact the sender and delete and destroy this and any other copies. In relation to any legal use you may make of the contents of this email, you must ensure that you comply with the Privacy Act (Cth) 1988 and you should note that the contents may be subject to copyright and therefore may not be reproduced, communicated or adapted without the express consent of the owner of the copyright. Allianz will not be liable in connection with any data corruption, interruption, delay, computer virus or unauthorised access or amendment to the contents of this email. If this email is a commercial electronic message and you would prefer not to receive further commercial electronic messages from Allianz, please forward a copy of this email to unsubscribe at allianz.com.au with the word unsubscribe in the subject header.
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 mailing list archive at Nabble.com.