[R] Means of Monte Carlo simulated lists

Warnes, Gregory R gregory_r_warnes at groton.pfizer.com
Fri Aug 2 22:31:29 CEST 2002


If you simply want an overall average of all the values do:

	mean( unlist( sim.theta ) )

If you want something else, you'll have to describe what you need more
clearly.

-Greg



> -----Original Message-----
> From: Giovanni Petris [mailto:GPetris at uark.edu]
> Sent: Friday, August 02, 2002 1:05 PM
> To: R-help
> Subject: [R] Means of Monte Carlo simulated lists
> 
> 
> 
> Hello,
> 
> I am doing simulations, and I generate a list at each iteration (with
> three component matrices in the example below), saving the results in
> a list. For example, after two iterations, I have something like
> 
> > str(sim.theta)
> List of 2
>  $ :List of 3
>   ..$ : num [1:6, 1:4]  -3.67  -1.07  -2.99 -18.38  -3.26 ...
>   ..$ : num [1:6, 1:6] -7.56 -3.14 -4.99  1.03  2.79 ...
>   ..$ : num [1:6, 1:4]  -0.506   2.802   1.879 -13.457  -3.172 ...
>  $ :List of 3
>   ..$ : num [1:6, 1:4]  9.664 17.242 13.555 -0.368 16.426 ...
>   ..$ : num [1:6, 1:6] 10.54  8.97 10.89 10.76  8.81 ...
>   ..$ : num [1:6, 1:4]  4.40 10.58 12.00  1.00  7.71 ...
> 
> Could anybody tell me what is an efficient way of computing the
> averages of the simulated values?
> 
> Thank you in advance,
> Giovanni
> 
> -- 
> 
>  __________________________________________________
> [                                                  ]
> [ Giovanni Petris                 GPetris at uark.edu ]
> [ Department of Mathematical Sciences              ]
> [ University of Arkansas - Fayetteville, AR 72701  ]
> [ Ph: (479) 575-6324, 575-8630 (fax)               ]
> [ http://definetti.uark.edu/~gpetris/              ]
> [__________________________________________________]
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> -.-.-.-.-.-.-.-.-
> r-help mailing list -- Read 
http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._


LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list