Title: | Distributions that are Sometimes Used in Hydrology |
---|---|
Description: | Probability distributions that are sometimes useful in hydrology. |
Authors: | Francois Aucoin |
Maintainer: | Thomas Petzoldt <[email protected]> |
License: | GPL-2 |
Version: | 2.4 |
Built: | 2024-10-26 05:41:35 UTC |
Source: | https://github.com/tpetzoldt/fadist |
This package contains several distributions that are sometimes useful in hydrology
Francois Aucoin
Maintainer: Thomas Petzoldt <[email protected]> in agreement with the original author.
Density, distribution function, quantile function and random generation for the 3-parameter gamma distribution with shape, scale, and threshold (or shift) parameters equal to shape
, scale
, and thres
, respectively.
dgamma3(x,shape=1,scale=1,thres=0,log=FALSE) pgamma3(q,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) qgamma3(p,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) rgamma3(n,shape=1,scale=1,thres=0)
dgamma3(x,shape=1,scale=1,thres=0,log=FALSE) pgamma3(q,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) qgamma3(p,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) rgamma3(n,shape=1,scale=1,thres=0)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
shape |
shape parameter. |
scale |
scale parameter. |
thres |
threshold or shift parameter. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x],otherwise, P[X > x]. |
If Y is a random variable distributed according to a gamma distribution (with shape and scale parameters), then X = Y+m has a 3-parameter gamma distribution with the same shape and scale parameters, and with threshold (or shift) parameter m.
dgamma3
gives the density, pgamma3
gives the distribution function, qgamma3
gives the quantile function, and rgamma3
generates random deviates.
Bobee, B. and F. Ashkar (1991). The Gamma Family and Derived Distributions Applied in Hydrology. Water Resources Publications, Littleton, Colo., 217 p.
dgamma
, pgamma
, qgamma
, rgamma
thres <- 10 x <- rgamma3(n=10,shape=2,scale=11,thres=thres) dgamma3(x,2,11,thres) dgamma(x-thres,2,1/11)
thres <- 10 x <- rgamma3(n=10,shape=2,scale=11,thres=thres) dgamma3(x,2,11,thres) dgamma(x-thres,2,1/11)
Density, distribution function, quantile function and random generation for the generalized Pareto distribution with shape and scale parameters equal to shape
and scale
, respectively.
dgp(x,shape=1,scale=1,log=FALSE) pgp(q,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) qgp(p,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) rgp(n,shape=1,scale=1)
dgp(x,shape=1,scale=1,log=FALSE) pgp(q,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) qgp(p,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) rgp(n,shape=1,scale=1)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
shape |
shape parameter. |
scale |
scale parameter. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x],otherwise, P[X > x]. |
If X is a random variable distributed according to a generalized Pareto distribution, it has density
f(x) = 1/scale*(1-shape*x/scale)^((1-shape)/shape)
dgp
gives the density, pgp
gives the distribution function, qgp
gives the quantile function, and rgp
generates random deviates.
Coles, S. (2001) An introduction to statistical modeling of extreme values. Springer
x <- rgp(1000,-.2,10) hist(x,freq=FALSE,col='gray',border='white') curve(dgp(x,-.2,10),add=TRUE,col='red4',lwd=2)
x <- rgp(1000,-.2,10) hist(x,freq=FALSE,col='gray',border='white') curve(dgp(x,-.2,10),add=TRUE,col='red4',lwd=2)
Density, distribution function, quantile function and random generation for the generalized extreme value distribution (for maxima) with shape, scale, and location parameters equal to shape
, scale
, and location
, respectively.
dgev(x,shape=1,scale=1,location=0,log=FALSE) pgev(q,shape=1,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) qgev(p,shape=1,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) rgev(n,shape=1,scale=1,location=0)
dgev(x,shape=1,scale=1,location=0,log=FALSE) pgev(q,shape=1,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) qgev(p,shape=1,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) rgev(n,shape=1,scale=1,location=0)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
shape |
shape parameter. |
scale |
scale parameter. |
location |
location parameter. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x],otherwise, P[X > x]. |
If X is a random variable distributed according to a generalized extreme value distribution, it has density
f(x) = 1/scale*(1+shape*((x-location)/scale))^(-1/shape-1)*exp(-(1+shape*((x-location)/scale))^(-1/shape))
dgev
gives the density, pgev
gives the distribution function, qgev
gives the quantile function, and rgev
generates random deviates.
Coles, S. (2001) An introduction to statistical modeling of extreme values. Springer
x <- rgev(1000,-.1,3,100) hist(x,freq=FALSE,col='gray',border='white') curve(dgev(x,-.1,3,100),add=TRUE,col='red4',lwd=2)
x <- rgev(1000,-.1,3,100) hist(x,freq=FALSE,col='gray',border='white') curve(dgev(x,-.1,3,100),add=TRUE,col='red4',lwd=2)
Density, distribution function, quantile function and random generation for the Gumbel distribution (for maxima) with scale and location parameters equal to scale
and location
, respectively.
dgumbel(x,scale=1,location=0,log=FALSE) pgumbel(q,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) qgumbel(p,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) rgumbel(n,scale=1,location=0)
dgumbel(x,scale=1,location=0,log=FALSE) pgumbel(q,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) qgumbel(p,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) rgumbel(n,scale=1,location=0)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
scale |
scale parameter. |
location |
location parameter. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x],otherwise, P[X > x]. |
If X is a random variable distributed according to a Gumbel distribution, it has density
f(x) = 1/scale*exp(-(x-location)/scale-exp(-(x-location)/scale))
dgumbel
gives the density, pgumbel
gives the distribution function, qgumbel
gives the quantile function, and rgumbel
generates random deviates.
Coles, S. (2001) An introduction to statistical modeling of extreme values. Springer
x <- rgumbel(1000,3,100) hist(x,freq=FALSE,col='gray',border='white') curve(dgumbel(x,3,100),add=TRUE,col='red4',lwd=2)
x <- rgumbel(1000,3,100) hist(x,freq=FALSE,col='gray',border='white') curve(dgumbel(x,3,100),add=TRUE,col='red4',lwd=2)
Density, distribution function, quantile function and random generation for the kappa distribution with shape and scale parameters equal to shape
and scale
, respectively.
dkappa(x,shape=1,scale=1,log=FALSE) pkappa(q,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) qkappa(p,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) rkappa(n,shape=1,scale=1)
dkappa(x,shape=1,scale=1,log=FALSE) pkappa(q,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) qkappa(p,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) rkappa(n,shape=1,scale=1)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
shape |
shape parameter. |
scale |
scale parameter. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x],otherwise, P[X > x]. |
If X is a random variable distributed according to a kappa distribution, it has density
f(x) = shape/scale*(shape+(x/scale)^shape)^(-(shape+1)/shape)
dkappa
gives the density, pkappa
gives the distribution function, qkappa
gives the quantile function, and rkappa
generates random deviates.
x <- rkappa(1000,12,10) hist(x,freq=FALSE,col='gray',border='white') curve(dkappa(x,12,10),add=TRUE,col='red4',lwd=2)
x <- rkappa(1000,12,10) hist(x,freq=FALSE,col='gray',border='white') curve(dkappa(x,12,10),add=TRUE,col='red4',lwd=2)
Density, distribution function, quantile function and random generation for the four-parameter kappa distribution with shape1, shape2, scale, and location parameters equal to shape1
, shape2
, scale
, and location
, respectively.
dkappa4(x,shape1,shape2,scale=1,location=0,log=FALSE) pkappa4(q,shape1,shape2,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) qkappa4(p,shape1,shape2,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) rkappa4(n,shape1,shape2,scale=1,location=0)
dkappa4(x,shape1,shape2,scale=1,location=0,log=FALSE) pkappa4(q,shape1,shape2,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) qkappa4(p,shape1,shape2,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) rkappa4(n,shape1,shape2,scale=1,location=0)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
shape1 |
shape parameter. |
shape2 |
shape parameter. |
scale |
scale parameter. |
location |
location parameter. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x],otherwise, P[X > x]. |
See References
dkappa4
gives the density, pkappa4
gives the distribution function, qkappa4
gives the quantile function, and rkappa4
generates random deviates.
Hosking, J.R.M. (1994). The four-parameter kappa distribution. IBM Journal of Research and Development, 38(3), 251-258.
x <- rkappa4(1000,.1,.2,12,110) hist(x,freq=FALSE,col='gray',border='white') curve(dkappa4(x,.1,.2,12,110),add=TRUE,col='red4',lwd=2)
x <- rkappa4(1000,.1,.2,12,110) hist(x,freq=FALSE,col='gray',border='white') curve(dkappa4(x,.1,.2,12,110),add=TRUE,col='red4',lwd=2)
Density, distribution function, quantile function and random generation for the log-Pearson type III distribution with shape1, shape2, and scale parameters equal to shape
, scale
, and thres
, respectively.
dlgamma3(x,shape=1,scale=1,thres=1,log=FALSE) plgamma3(q,shape=1,scale=1,thres=1,lower.tail=TRUE,log.p=FALSE) qlgamma3(p,shape=1,scale=1,thres=1,lower.tail=TRUE,log.p=FALSE) rlgamma3(n,shape=1,scale=1,thres=1)
dlgamma3(x,shape=1,scale=1,thres=1,log=FALSE) plgamma3(q,shape=1,scale=1,thres=1,lower.tail=TRUE,log.p=FALSE) qlgamma3(p,shape=1,scale=1,thres=1,lower.tail=TRUE,log.p=FALSE) rlgamma3(n,shape=1,scale=1,thres=1)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
shape |
shape1 parameter. |
scale |
shape2 parameter. |
thres |
scale parameter. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x],otherwise, P[X > x]. |
If Y is a random variable distributed according to a gamma distribution (with shape and scale parameters), then X = exp(Y+m) has a log-Pearson type III distribution with shape1 and shape2 parameters corresponding to the shape and 1/scale parameteres of Y, and with scale parameter m.
dlgamma3
gives the density, plgamma3
gives the distribution function, qlgamma3
gives the quantile function, and rlgamma3
generates random deviates.
BOBEE, B. and F. ASHKAR (1991). The Gamma Family and Derived Distributions Applied in Hydrology. Water Resources Publications, Littleton, Colo., 217 p.
dgamma
, pgamma
, qgamma
, rgamma
, dgamma3
, pgamma3
, qgamma3
, rgamma3
thres <- 10 x <- rlgamma3(n=10,shape=2,scale=11,thres=thres) dlgamma3(x,2,11,thres) dgamma3(log(x),2,1/11,thres)/x dgamma(log(x)-thres,2,11)/x
thres <- 10 x <- rlgamma3(n=10,shape=2,scale=11,thres=thres) dlgamma3(x,2,11,thres) dgamma3(log(x),2,1/11,thres)/x dgamma(log(x)-thres,2,11)/x
Density, distribution function, quantile function and random generation for the log-logistic distribution with shape and scale parameters equal to shape
and scale
, respectively.
dllog(x,shape=1,scale=1,log=FALSE) pllog(q,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) qllog(p,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) rllog(n,shape=1,scale=1)
dllog(x,shape=1,scale=1,log=FALSE) pllog(q,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) qllog(p,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) rllog(n,shape=1,scale=1)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
shape |
shape parameter. |
scale |
scale parameter. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x],otherwise, P[X > x]. |
If Y is a random variable distributed according to a logistic distribution (with location and scale parameters), then X = exp(Y) has a log-logistic distribution with shape and scale parameters corresponding to the scale and location parameteres of Y, respectively.
dllog
gives the density, pllog
gives the distribution function, qllog
gives the quantile function, and rllog
generates random deviates.
dlogis
, plogis
, qlogis
, rlogis
x <- rllog(10,1,0) dllog(x,1,0) dlogis(log(x),0,1)/x
x <- rllog(10,1,0) dllog(x,1,0) dlogis(log(x),0,1)/x
Density, distribution function, quantile function and random generation for the 3-parameter log-logistic distribution with shape, scale, and threshold (or shift) parameters equal to shape
, scale
, and thres
, respectively.
dllog3(x,shape=1,scale=1,thres=0,log=FALSE) pllog3(q,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) qllog3(p,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) rllog3(n,shape=1,scale=1,thres=0)
dllog3(x,shape=1,scale=1,thres=0,log=FALSE) pllog3(q,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) qllog3(p,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) rllog3(n,shape=1,scale=1,thres=0)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
shape |
shape parameter. |
scale |
scale parameter. |
thres |
threshold (or shift) parameter. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x],otherwise, P[X > x]. |
If Y is a random variable distributed according to a logistic distribution (with location and scale parameters), then X = exp(Y)+m has a 3-parameter
log-logistic distribution with shape and scale parameters corresponding to the scale and location parameteres of Y, respectively; and threshold parameter .
dllog3
gives the density, pllog3
gives the distribution function, qllog3
gives the quantile function, and rllog3
generates random deviates.
dlogis
, plogis
, qlogis
, rlogis
, dllog
, pllog
, qllog
, rllog
m <- 100 x <- rllog3(10,1,0,m) dllog3(x,1,0,m) dllog(x-m,1,0) dlogis(log(x-m),0,1)/(x-m)
m <- 100 x <- rllog3(10,1,0,m) dllog3(x,1,0,m) dllog(x-m,1,0) dlogis(log(x-m),0,1)/(x-m)
Density, distribution function, quantile function and random generation for the 3-parameter lognormal distribution with shape, scale, and threshold (or shift) parameters equal to shape
, scale
, and thres
, respectively.
dlnorm3(x,shape=1,scale=1,thres=0,log=FALSE) plnorm3(q,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) qlnorm3(p,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) rlnorm3(n,shape=1,scale=1,thres=0)
dlnorm3(x,shape=1,scale=1,thres=0,log=FALSE) plnorm3(q,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) qlnorm3(p,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) rlnorm3(n,shape=1,scale=1,thres=0)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
shape |
shape parameter. |
scale |
scale parameter. |
thres |
threshold (or shift) parameter. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x],otherwise, P[X > x]. |
If Y is a random variable distributed according to a normal distribution (with location(mean) and scale(standard deviation) parameters), then X = exp(Y)+m has a 3-parameter lognormal distribution with shape and scale parameters corresponding to the scale and location parameteres of Y, respectively; and threshold parameter m.
dlnorm3
gives the density, plnorm3
gives the distribution function, qlnorm3
gives the quantile function, and rlnorm3
generates random deviates.
dnorm
, pnorm
, qnorm
, rnorm
, dlnorm
, plnorm
, qlnorm
, rlnorm
m <- 100 x <- rlnorm3(10,1,0,m) dlnorm3(x,1,0,m) dlnorm(x-m,0,1) dnorm(log(x-m),0,1)/(x-m)
m <- 100 x <- rlnorm3(10,1,0,m) dlnorm3(x,1,0,m) dlnorm(x-m,0,1) dnorm(log(x-m),0,1)/(x-m)
Density, distribution function, quantile function and random generation for the 3-parameter Weibull distribution with shape, scale, and threshold (or shift) parameters equal to shape
, scale
, and thres
, respectively.
dweibull3(x,shape,scale=1,thres=0,log=FALSE) pweibull3(q,shape,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) qweibull3(p,shape,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) rweibull3(n,shape,scale=1,thres=0)
dweibull3(x,shape,scale=1,thres=0,log=FALSE) pweibull3(q,shape,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) qweibull3(p,shape,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) rweibull3(n,shape,scale=1,thres=0)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. |
shape |
shape parameter. |
scale |
scale parameter. |
thres |
threshold (or shift) parameter. |
log , log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x],otherwise, P[X > x]. |
If Y is a random variable distributed according to a Weibull distribution (with shape and scale parameters), then X = Y+m has a 3-parameter Weibull distribution with shape and scale parameters corresponding to the shape and scale parameteres of Y, respectively; and threshold parameter m.
dweibull3
gives the density, pweibull3
gives the distribution function, qweibull3
gives the quantile function, and rweibull3
generates random deviates.
dweibull
, pweibull
, qweibull
, rweibull
m <- 100 x <- rweibull3(10,3,1,m) dweibull3(x,3,1,m) dweibull(x-m,3,1)
m <- 100 x <- rweibull3(10,3,1,m) dweibull3(x,3,1,m) dweibull(x-m,3,1)