Weibull Distribution Returns NULL value in R

72 Views Asked by At

I'm trying to calculate the shape and scale based on mean and standard deviation of a weibull distribution. If mean = 0 and sd = 1, the shape and scale both return NA. But for other values(such as mean = 1 and sd = 2), the result is perfect. Any requirement for the input parameters? I' m a beginner of statistic and R. Can someone help me out or give me any hint or reference? Thanks you so much.

mu = 0
sd = 1
sp = mixdist::weibullpar(mu, sd, loc = 0)$shape
sc = mixdist::weibullpar(mu, sd, loc = 0)$scale
1

There are 1 best solutions below

0
Avraham On

For closure, the reason why a mean of 0 is inappropriate is that the Weibull distribution is defined on [0, ∞). Unless the distribution always returns 0—and is thus no longer a Weibull—the mean must be greater than 0.