parameters_weibull: hook for Weibull/Gaussian equivalency tricks (and traps)

View source: R/parameters_weibull.R

parameters_weibullR Documentation

hook for Weibull/Gaussian equivalency tricks (and traps)

Description

hook for Weibull/Gaussian equivalency tricks (and traps)

Usage

parameters_weibull(dat, ...)

Arguments

dat

a vector of data, purportedly from a Weibull distribution

...

additional arguments to be passed on to MASS::fitdistr

Details

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.

Value

     an object of class `fitdistr` (see MASS::fitdistr for more)

See Also

    EnvStats::eweibull
    MASS::fitdistr

Examples


set.seed(1234)
dat <- rnorm(n=1000, mean=6)
stopifnot(all(dat > 0)) # fitdistr fails if any(dat <= 0)
parameters_weibull(dat)


VanAndelInstitute/bifurcatoR documentation built on Oct. 13, 2024, 6:29 p.m.