[R] How can I do these simulations with R code
Joshua Wiley
jwiley.psych at gmail.com
Tue Aug 23 05:48:29 CEST 2011
Hi Mauro,
This list is not meant to help with homework problems or contrived
exercises. Please see your instructor or find a more appropriate
forum.
Cheers,
Josh
On Mon, Aug 22, 2011 at 6:49 PM, Mauro Sznelwar <sznelwar at uol.com.br> wrote:
> 1) The Pareto P(alfa) distribution is defined by its density f(x|alfa) =alfa*X^(-alfa-1) over (1 to infinity). Show that it can be generated as the -1/alfa power of a uniforme variate. Plot the histogram and the density.
> 2) The Poisson distribution P(lambda) is connected to the exponential distribution through the Poisson process in that it can be simulated by generating exponential random variables until their sums exceeds 1. That is, if Xi~Exp(lambda) and if K is the first value for which summation(i=1 to k+1)Xi>1 então K~P(lambda). Compare this algorithm with rpois.
> 3) Se U e V are i.i.d U[0,1], the distribuiton of (U^1/alfa)/((U^1/alfa)+V(1/beta)), conditional on U^1/alfa+V^1/beta<=1, is the beta(alfa, beta) distribution. Compare this algorithm for both small and large values of alfa and beta.
> [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
--
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, ATS Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/
More information about the R-help
mailing list