[R] How can I do these simulations with R code

Rolf Turner rolf.turner at xtra.co.nz
Tue Aug 23 06:36:53 CEST 2011


Do your own <expletive deleted> homework!!!

On 23/08/11 13:49, Mauro Sznelwar 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]]



More information about the R-help mailing list