Re: [R] Creating a specific skewed distribution

2009-06-15 Thread Greg Snow
-boun...@r- project.org] On Behalf Of David Arnold Sent: Tuesday, June 09, 2009 11:49 PM To: r-help@r-project.org Subject: [R] Creating a specific skewed distribution All, Can someone help me create a skewed distribution, mean = 30, with probability of selecting a random number from

Re: [R] Creating a specific skewed distribution

2009-06-10 Thread Mike Lawrence
With skewed unimodal distributions, the mode can't equal the mean, so assuming you want the mean to be around 30, I find that a weibull function can get close to what you want: mean(rweibull(1e5,1.5,33)) [1] 29.77781 pweibull(60,1.5,33) [1] 0.9138475 I'm sure you can play with the parameters

Re: [R] Creating a specific skewed distribution

2009-06-10 Thread Etienne B. Racine
You could also make some algebra. e.g. : ?rweibull gives the formula of the mean and of the cumulative distribution function in the Details section. So using your known parameters (i.e. mean=30 and p(10)=.10, i.e. cumulative function(10) =.90), I think it is sufficient to determine the exact

Re: [R] Creating a specific skewed distribution

2009-06-10 Thread David Arnold
Etienne et al, This is exactly what I need. So I gave it an algebraic try and set: Mean=30=b*gamma(1+1/a), solve for b and substitute into F(60)=0.10. After a little algebra, this left me with [ 2*gamma(1+1/a) ]^a = -ln(0.10) Now, I don't think this has a closed form solution, at least

Re: [R] Creating a specific skewed distribution

2009-06-10 Thread Ravi Varadhan
] Creating a specific skewed distribution Etienne et al, This is exactly what I need. So I gave it an algebraic try and set: Mean=30=b*gamma(1+1/a), solve for b and substitute into F(60)=0.10. After a little algebra, this left me with [ 2*gamma(1+1/a) ]^a = -ln(0.10) Now, I don't think this has

Re: [R] Creating a specific skewed distribution

2009-06-10 Thread Ravi Varadhan
-project.org' Subject: RE: [R] Creating a specific skewed distribution Here is one way to solve the equation: require(BB) f - function(x) (2*gamma(1+1/x))^x + log (0.10) ans - dfsane(par=1, fn=f) ans Ravi

[R] Creating a specific skewed distribution

2009-06-09 Thread David Arnold
All, Can someone help me create a skewed distribution, mean = 30, with probability of selecting a random number from the distribution greater than or equal 60 equal to 10%? I need the probability density function to equal zero at zero, and have a maximum height at or near 30. Is this possible?