Re: RandomArray from user defined distribution?

*To*: mathgroup at smc.vnet.net*Subject*: [mg73357] Re: RandomArray from user defined distribution?*From*: roland franzius <roland.franzius at uos.de>*Date*: Wed, 14 Feb 2007 05:13:55 -0500 (EST)*Organization*: Universitaet Hannover*References*: <eqpdv5$eip$1@smc.vnet.net>

rob wrote: > I'd like to use the RandomArray to produce some data from > what I think is a Poisson distribution in t > P[t] = a^2 t Exp[-a*t] where a is mean, sigma. > > I see one can use RandomArray to produce sample data from a > lot of continuous distributions but the Poisson isn't among > them (it's only available in the discrete form). > > I've made a bunch of crippled attempts to force my P[t] to > put out examples but have failed. Any suggestions? Thanks. > Your density is a GammaDistribution[2,3], se e.g. http://mathworld.wolfram.com/GammaDistribution.html If you want to implement a Random from your own Distribution, the easiest way is to generate a 1000 point Table of (P(x),x) of paired values of the inverted cumulated Distribution function P^-1, construct an interpolating function iP using Fit and use the Random generator choose:=ip[Random[Real,{0,1}]] -- Roland Franzius