View source: R/parameters_weibull.R
parameters_weibull | R Documentation |
hook for Weibull/Gaussian equivalency tricks (and traps)
parameters_weibull(dat, ...)
dat |
a vector of data, purportedly from a Weibull distribution |
... |
additional arguments to be passed on to MASS::fitdistr |
The canonical Weibull distribution is expressed as
X ~ Weibull(a, b)
where a > 0 is the scale parameter and b > 0 is the shape parameter. This function calls MASS::fitdistr(dat) to estimate these parameters and packages up the result as a list (see MASS::fitdistr for more possibilities). The starting parameters for MASS::fitdistr are computed via the methods of moments, and the final estimates are then fitted by maximum likelihood. The code for the method of moments estimate is modified from EnvStats::eweibull.
an object of class `fitdistr` (see MASS::fitdistr for more)
EnvStats::eweibull
MASS::fitdistr
set.seed(1234)
dat <- rnorm(n=1000, mean=6)
stopifnot(all(dat > 0)) # fitdistr fails if any(dat <= 0)
parameters_weibull(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.