[R] cdf of weibull distribution
J. Hosking
jh910 at juno.com
Wed Apr 26 21:34:06 CEST 2006
Peter Dalgaard wrote:
> Sachin J <sachinj.2006 at yahoo.com> writes:
>
>
>>Hi,
>>
>> I have a data set which is assumed to follow weibull distr'. How
can I find of cdf for this data. For example, for normal data I used
(package - lmomco)
>>
>> >cdfnor(15,parnor(lmom.ub(c(df$V1))))
If X is a Weibull random variable then -X has a generalized
extreme-value distribution. So something like
cdfgev(-15,pargev(lmom.ub(-c(df$V1))))
should do the trick.
>> Also, lmomco package does not have functions for finding cdf for
some of the distributions like lognormal. Is there any other package,
which can handle these distributions?
I recommend that you use the generalized normal distribution, a
reparametrized and extended version of the lognormal that accommodates
distributions with negative as well as positive skewness. See Hosking
& Wallis, "Regional Frequency Analysis", Cambridge Univ. Press, 1997,
p.198. The relevant routines in lmomco are cdfgno, lmomgno, pargno and
quagno.
> What's wrong with pweibull, plnorm, etc.? Or pnorm for that matter....
What's wrong, or at least what I often find somewhat incovenient, is
that R's distribution functions require the distribution parameters
to be supplied as separate arguments rather than as a single vector.
This complicates operations that involve passing parameters from one
function to another. For example, the OP's one-liner above would,
if pnorm were used, have to become something like
par <- parnor(lmom.ub(c(df$V1)))
pnorm(15, par[1], par[2])
or, if we still want to do it in one line,
do.call('pnorm', as.list(c(15, parnor(lmom.ub(c(df$V1))))))
More information about the R-help
mailing list