FAdist/0000755000176200001440000000000014210236272011423 5ustar liggesusersFAdist/NAMESPACE0000644000176200001440000000021212546441231012640 0ustar liggesusers# Default NAMESPACE created by R # Remove the previous line if you edit this file import("stats") # Export all names exportPattern(".") FAdist/man/0000755000176200001440000000000014207654642012211 5ustar liggesusersFAdist/man/GenPARETO.Rd0000644000176200001440000000270212477536673014137 0ustar liggesusers\name{GenPARETO} \Rdversion{1.1} \alias{dgp} \alias{pgp} \alias{qgp} \alias{rgp} \title{Generalized Pareto Distribution} \description{ Density, distribution function, quantile function and random generation for the generalized Pareto distribution with shape and scale parameters equal to \code{shape} and \code{scale}, respectively.} \usage{ 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) } \arguments{ \item{x,q}{vector of quantiles.} \item{p}{vector of probabilities.} \item{n}{number of observations.} \item{shape}{shape parameter.} \item{scale}{scale parameter.} \item{log,log.p}{logical; if TRUE, probabilities p are given as log(p).} \item{lower.tail}{logical; if TRUE (default), probabilities are \emph{P[X <= x]},otherwise, \emph{P[X > x]}.} } \details{ If \emph{X} is a random variable distributed according to a generalized Pareto distribution, it has density \cr f(x) = 1/scale*(1-shape*x/scale)^((1-shape)/shape) } \value{ \code{dgp} gives the density, \code{pgp} gives the distribution function, \code{qgp} gives the quantile function, and \code{rgp} generates random deviates. } \references{Coles, S. (2001) An introduction to statistical modeling of extreme values. Springer} \examples{ x <- rgp(1000,-.2,10) hist(x,freq=FALSE,col='gray',border='white') curve(dgp(x,-.2,10),add=TRUE,col='red4',lwd=2) } \keyword{distribution} FAdist/man/WEIBULL3.Rd0000644000176200001440000000336212477536043013673 0ustar liggesusers\name{WEIBULL3} \Rdversion{1.1} \alias{dweibull3} \alias{pweibull3} \alias{qweibull3} \alias{rweibull3} \title{Three-Parameter Weibull Distribution} \description{ Density, distribution function, quantile function and random generation for the 3-parameter Weibull distribution with shape, scale, and threshold (or shift) parameters equal to \code{shape}, \code{scale}, and \code{thres}, respectively.} \usage{ 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) } \arguments{ \item{x,q}{vector of quantiles.} \item{p}{vector of probabilities.} \item{n}{number of observations.} \item{shape}{shape parameter.} \item{scale}{scale parameter.} \item{thres}{threshold (or shift) parameter.} \item{log,log.p}{logical; if TRUE, probabilities p are given as log(p).} \item{lower.tail}{logical; if TRUE (default), probabilities are \emph{P[X <= x]},otherwise, \emph{P[X > x]}.} } \details{ If \emph{Y} is a random variable distributed according to a Weibull distribution (with shape and scale parameters), then \emph{X = Y+m} has a 3-parameter Weibull distribution with shape and scale parameters corresponding to the shape and scale parameteres of \emph{Y}, respectively; and threshold parameter \emph{m}. } \value{ \code{dweibull3} gives the density, \code{pweibull3} gives the distribution function, \code{qweibull3} gives the quantile function, and \code{rweibull3} generates random deviates. } \seealso{ \code{\link{dweibull}}, \code{\link{pweibull}}, \code{\link{qweibull}}, \code{\link{rweibull}} } \examples{ m <- 100 x <- rweibull3(10,3,1,m) dweibull3(x,3,1,m) dweibull(x-m,3,1) } \keyword{distribution} FAdist/man/GEV.Rd0000644000176200001440000000324612477535646013137 0ustar liggesusers\name{GEV} \Rdversion{1.1} \alias{dgev} \alias{pgev} \alias{qgev} \alias{rgev} \title{Generalized Extreme Value Distribution (for maxima)} \description{ Density, distribution function, quantile function and random generation for the generalized extreme value distribution (for maxima) with shape, scale, and location parameters equal to \code{shape}, \code{scale}, and \code{location}, respectively.} \usage{ 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) } \arguments{ \item{x,q}{vector of quantiles.} \item{p}{vector of probabilities.} \item{n}{number of observations.} \item{shape}{shape parameter.} \item{scale}{scale parameter.} \item{location}{location parameter.} \item{log,log.p}{logical; if TRUE, probabilities p are given as log(p).} \item{lower.tail}{logical; if TRUE (default), probabilities are \emph{P[X <= x]},otherwise, \emph{P[X > x]}.} } \details{ If \emph{X} is a random variable distributed according to a generalized extreme value distribution, it has density \cr f(x) = 1/scale*(1+shape*((x-location)/scale))^(-1/shape-1)*exp(-(1+shape*((x-location)/scale))^(-1/shape)) } \value{ \code{dgev} gives the density, \code{pgev} gives the distribution function, \code{qgev} gives the quantile function, and \code{rgev} generates random deviates. } \references{Coles, S. (2001) An introduction to statistical modeling of extreme values. Springer} \examples{ 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) } \keyword{distribution} FAdist/man/GAMMA3.Rd0000644000176200001440000000362112573072412013400 0ustar liggesusers\name{GAMMA3} \Rdversion{1.1} \alias{dgamma3} \alias{pgamma3} \alias{qgamma3} \alias{rgamma3} \title{Three-Parameter Gamma Distribution (also known as Pearson type III distribution)} \description{ Density, distribution function, quantile function and random generation for the 3-parameter gamma distribution with shape, scale, and threshold (or shift) parameters equal to \code{shape}, \code{scale}, and \code{thres}, respectively.} \usage{ 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) } \arguments{ \item{x,q}{vector of quantiles.} \item{p}{vector of probabilities.} \item{n}{number of observations.} \item{shape}{shape parameter.} \item{scale}{scale parameter.} \item{thres}{threshold or shift parameter.} \item{log,log.p}{logical; if TRUE, probabilities p are given as log(p).} \item{lower.tail}{logical; if TRUE (default), probabilities are \emph{P[X <= x]},otherwise, \emph{P[X > x]}.} } \details{ If \emph{Y} is a random variable distributed according to a gamma distribution (with shape and scale parameters), then \emph{X = Y+m} has a 3-parameter gamma distribution with the same shape and scale parameters, and with threshold (or shift) parameter \emph{m}. } \value{ \code{dgamma3} gives the density, \code{pgamma3} gives the distribution function, \code{qgamma3} gives the quantile function, and \code{rgamma3} generates random deviates. } \references{Bobee, B. and F. Ashkar (1991). The Gamma Family and Derived Distributions Applied in Hydrology. Water Resources Publications, Littleton, Colo., 217 p.} \seealso{ \code{\link{dgamma}}, \code{\link{pgamma}}, \code{\link{qgamma}}, \code{\link{rgamma}} } \examples{ thres <- 10 x <- rgamma3(n=10,shape=2,scale=11,thres=thres) dgamma3(x,2,11,thres) dgamma(x-thres,2,1/11) } \keyword{distribution} FAdist/man/LLOGIS.Rd0000644000176200001440000000301012477535746013475 0ustar liggesusers\name{LLOGIS} \Rdversion{1.1} \alias{dllog} \alias{pllog} \alias{qllog} \alias{rllog} \title{Log-Logistic Distribution} \description{ Density, distribution function, quantile function and random generation for the log-logistic distribution with shape and scale parameters equal to \code{shape} and \code{scale}, respectively.} \usage{ 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) } \arguments{ \item{x,q}{vector of quantiles.} \item{p}{vector of probabilities.} \item{n}{number of observations.} \item{shape}{shape parameter.} \item{scale}{scale parameter.} \item{log,log.p}{logical; if TRUE, probabilities p are given as log(p).} \item{lower.tail}{logical; if TRUE (default), probabilities are \emph{P[X <= x]},otherwise, \emph{P[X > x]}.} } \details{ If \emph{Y} is a random variable distributed according to a logistic distribution (with location and scale parameters), then \emph{X = exp(Y)} has a log-logistic distribution with shape and scale parameters corresponding to the scale and location parameteres of \emph{Y}, respectively. } \value{ \code{dllog} gives the density, \code{pllog} gives the distribution function, \code{qllog} gives the quantile function, and \code{rllog} generates random deviates. } \seealso{ \code{\link{dlogis}}, \code{\link{plogis}}, \code{\link{qlogis}}, \code{\link{rlogis}} } \examples{ x <- rllog(10,1,0) dllog(x,1,0) dlogis(log(x),0,1)/x } \keyword{distribution} FAdist/man/FAdist-internal.Rd0000644000176200001440000000035514207654774015475 0ustar liggesusers\name{FAdist-internal} \alias{expand.args} \alias{pgev2} \alias{qgev2} \title{Internal functions of FAdist} \description{ Internal functions of the package. } \details{ These are not to be called by the user. } \keyword{ internal } FAdist/man/FAdist-package.Rd0000644000176200001440000000061612573117060015236 0ustar liggesusers\name{FAdist-package} \Rdversion{1.1} \alias{FAdist-package} \alias{FAdist} \docType{package} \title{Distributions that are sometimes used in hydrology} \description{This package contains several distributions that are sometimes useful in hydrology} \author{ Francois Aucoin Maintainer: Thomas Petzoldt in agreement with the original author. } \keyword{package} FAdist/man/LGAMMA3.Rd0000644000176200001440000000401712477534200013515 0ustar liggesusers\name{LGAMMA3} \Rdversion{1.1} \alias{dlgamma3} \alias{plgamma3} \alias{qlgamma3} \alias{rlgamma3} \title{Log-Pearson Type III Distribution} \description{ Density, distribution function, quantile function and random generation for the log-Pearson type III distribution with shape1, shape2, and scale parameters equal to \code{shape}, \code{scale}, and \code{thres}, respectively.} \usage{ 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) } \arguments{ \item{x,q}{vector of quantiles.} \item{p}{vector of probabilities.} \item{n}{number of observations.} \item{shape}{shape1 parameter.} \item{scale}{shape2 parameter.} \item{thres}{scale parameter.} \item{log,log.p}{logical; if TRUE, probabilities p are given as log(p).} \item{lower.tail}{logical; if TRUE (default), probabilities are \emph{P[X <= x]},otherwise, \emph{P[X > x]}.} } \details{ If \emph{Y} is a random variable distributed according to a gamma distribution (with shape and scale parameters), then \emph{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 \emph{Y}, and with scale parameter \emph{m}. } \value{ \code{dlgamma3} gives the density, \code{plgamma3} gives the distribution function, \code{qlgamma3} gives the quantile function, and \code{rlgamma3} generates random deviates. } \references{BOBEE, B. and F. ASHKAR (1991). The Gamma Family and Derived Distributions Applied in Hydrology. Water Resources Publications, Littleton, Colo., 217 p.} \seealso{ \code{\link{dgamma}}, \code{\link{pgamma}}, \code{\link{qgamma}}, \code{\link{rgamma}}, \code{\link{dgamma3}}, \code{\link{pgamma3}}, \code{\link{qgamma3}}, \code{\link{rgamma3}} } \examples{ 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 } \keyword{distribution} FAdist/man/GUMBEL.Rd0000644000176200001440000000302212477535667013464 0ustar liggesusers\name{GUMBEL} \Rdversion{1.1} \alias{dgumbel} \alias{pgumbel} \alias{qgumbel} \alias{rgumbel} \title{Gumbel Distribution (for maxima)} \description{ Density, distribution function, quantile function and random generation for the Gumbel distribution (for maxima) with scale and location parameters equal to \code{scale} and \code{location}, respectively.} \usage{ 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) } \arguments{ \item{x,q}{vector of quantiles.} \item{p}{vector of probabilities.} \item{n}{number of observations.} \item{scale}{scale parameter.} \item{location}{location parameter.} \item{log,log.p}{logical; if TRUE, probabilities p are given as log(p).} \item{lower.tail}{logical; if TRUE (default), probabilities are \emph{P[X <= x]},otherwise, \emph{P[X > x]}.} } \details{ If \emph{X} is a random variable distributed according to a Gumbel distribution, it has density \cr f(x) = 1/scale*exp(-(x-location)/scale-exp(-(x-location)/scale)) } \value{ \code{dgumbel} gives the density, \code{pgumbel} gives the distribution function, \code{qgumbel} gives the quantile function, and \code{rgumbel} generates random deviates. } \references{Coles, S. (2001) An introduction to statistical modeling of extreme values. Springer} \examples{ x <- rgumbel(1000,3,100) hist(x,freq=FALSE,col='gray',border='white') curve(dgumbel(x,3,100),add=TRUE,col='red4',lwd=2) } \keyword{distribution} FAdist/man/LLOGIS3.Rd0000644000176200001440000000352112477534200013547 0ustar liggesusers\name{LLOGIS3} \Rdversion{1.1} \alias{dllog3} \alias{pllog3} \alias{qllog3} \alias{rllog3} \title{Three-Parameter Log-Logistic Distribution} \description{ 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 \code{shape}, \code{scale}, and \code{thres}, respectively.} \usage{ 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) } \arguments{ \item{x,q}{vector of quantiles.} \item{p}{vector of probabilities.} \item{n}{number of observations.} \item{shape}{shape parameter.} \item{scale}{scale parameter.} \item{thres}{threshold (or shift) parameter.} \item{log,log.p}{logical; if TRUE, probabilities p are given as log(p).} \item{lower.tail}{logical; if TRUE (default), probabilities are \emph{P[X <= x]},otherwise, \emph{P[X > x]}.} } \details{ If \emph{Y} is a random variable distributed according to a logistic distribution (with location and scale parameters), then \emph{X = exp(Y)+m} has a 3-parameter log-logistic distribution with shape and scale parameters corresponding to the scale and location parameteres of \emph{Y}, respectively; and threshold parameter \eqn{m}. } \value{ \code{dllog3} gives the density, \code{pllog3} gives the distribution function, \code{qllog3} gives the quantile function, and \code{rllog3} generates random deviates. } \seealso{ \code{\link{dlogis}}, \code{\link{plogis}}, \code{\link{qlogis}}, \code{\link{rlogis}}, \code{\link{dllog}}, \code{\link{pllog}}, \code{\link{qllog}}, \code{\link{rllog}} } \examples{ 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) } \keyword{distribution} FAdist/man/KAPPA.Rd0000644000176200001440000000254712477535714013351 0ustar liggesusers\name{KAPPA} \Rdversion{1.1} \alias{dkappa} \alias{pkappa} \alias{qkappa} \alias{rkappa} \title{Kappa Distribution} \description{ Density, distribution function, quantile function and random generation for the kappa distribution with shape and scale parameters equal to \code{shape} and \code{scale}, respectively.} \usage{ 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) } \arguments{ \item{x,q}{vector of quantiles.} \item{p}{vector of probabilities.} \item{n}{number of observations.} \item{shape}{shape parameter.} \item{scale}{scale parameter.} \item{log,log.p}{logical; if TRUE, probabilities p are given as log(p).} \item{lower.tail}{logical; if TRUE (default), probabilities are \emph{P[X <= x]},otherwise, \emph{P[X > x]}.} } \details{ If \emph{X} is a random variable distributed according to a kappa distribution, it has density \cr f(x) = shape/scale*(shape+(x/scale)^shape)^(-(shape+1)/shape) } \value{ \code{dkappa} gives the density, \code{pkappa} gives the distribution function, \code{qkappa} gives the quantile function, and \code{rkappa} generates random deviates. } \examples{ x <- rkappa(1000,12,10) hist(x,freq=FALSE,col='gray',border='white') curve(dkappa(x,12,10),add=TRUE,col='red4',lwd=2) } \keyword{distribution} FAdist/man/KAPPA4.Rd0000644000176200001440000000313312477534200013412 0ustar liggesusers\name{KAPPA4} \Rdversion{1.1} \alias{dkappa4} \alias{pkappa4} \alias{qkappa4} \alias{rkappa4} \title{Four-Parameter Kappa Distribution} \description{ Density, distribution function, quantile function and random generation for the four-parameter kappa distribution with shape1, shape2, scale, and location parameters equal to \code{shape1}, \code{shape2}, \code{scale}, and \code{location}, respectively.} \usage{ 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) } \arguments{ \item{x,q}{vector of quantiles.} \item{p}{vector of probabilities.} \item{n}{number of observations.} \item{shape1}{shape parameter.} \item{shape2}{shape parameter.} \item{scale}{scale parameter.} \item{location}{location parameter.} \item{log,log.p}{logical; if TRUE, probabilities p are given as log(p).} \item{lower.tail}{logical; if TRUE (default), probabilities are \emph{P[X <= x]},otherwise, \emph{P[X > x]}.} } \details{See References} \value{ \code{dkappa4} gives the density, \code{pkappa4} gives the distribution function, \code{qkappa4} gives the quantile function, and \code{rkappa4} generates random deviates. } \references{ Hosking, J.R.M. (1994). The four-parameter kappa distribution. IBM Journal of Research and Development, 38(3), 251-258. } \examples{ 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) } \keyword{distribution} FAdist/man/LNORM3.Rd0000644000176200001440000000355212477536017013461 0ustar liggesusers\name{LNORM3} \Rdversion{1.1} \alias{dlnorm3} \alias{plnorm3} \alias{qlnorm3} \alias{rlnorm3} \title{Three-Parameter Lognormal Distribution} \description{ Density, distribution function, quantile function and random generation for the 3-parameter lognormal distribution with shape, scale, and threshold (or shift) parameters equal to \code{shape}, \code{scale}, and \code{thres}, respectively.} \usage{ 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) } \arguments{ \item{x,q}{vector of quantiles.} \item{p}{vector of probabilities.} \item{n}{number of observations.} \item{shape}{shape parameter.} \item{scale}{scale parameter.} \item{thres}{threshold (or shift) parameter.} \item{log,log.p}{logical; if TRUE, probabilities p are given as log(p).} \item{lower.tail}{logical; if TRUE (default), probabilities are \emph{P[X <= x]},otherwise, \emph{P[X > x]}.} } \details{ If \emph{Y} is a random variable distributed according to a normal distribution (with location(mean) and scale(standard deviation) parameters), then \emph{X = exp(Y)+m} has a 3-parameter lognormal distribution with shape and scale parameters corresponding to the scale and location parameteres of \emph{Y}, respectively; and threshold parameter \emph{m}. } \value{ \code{dlnorm3} gives the density, \code{plnorm3} gives the distribution function, \code{qlnorm3} gives the quantile function, and \code{rlnorm3} generates random deviates. } \seealso{ \code{\link{dnorm}}, \code{\link{pnorm}}, \code{\link{qnorm}}, \code{\link{rnorm}}, \code{\link{dlnorm}}, \code{\link{plnorm}}, \code{\link{qlnorm}}, \code{\link{rlnorm}} } \examples{ 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) } \keyword{distribution} FAdist/DESCRIPTION0000644000176200001440000000073014210236272013131 0ustar liggesusersPackage: FAdist Type: Package Title: Distributions that are Sometimes Used in Hydrology Version: 2.4 Imports: stats Date: 2022-03-02 Author: Francois Aucoin Maintainer: Thomas Petzoldt Description: Probability distributions that are sometimes useful in hydrology. License: GPL-2 URL: https://github.com/tpetzoldt/FAdist Repository: CRAN NeedsCompilation: no Packaged: 2022-03-03 15:42:59 UTC; thpe Date/Publication: 2022-03-03 22:10:02 UTC FAdist/R/0000755000176200001440000000000014207653467011643 5ustar liggesusersFAdist/R/rgumbel.R0000644000176200001440000000011512477534360013415 0ustar liggesusersrgumbel <- function(n,scale=1,location=0) qgumbel(runif(n),scale,location) FAdist/R/rkappa.R0000644000176200001440000000010512477534360013235 0ustar liggesusersrkappa <- function(n,shape=1,scale=1) qkappa(runif(n),shape,scale) FAdist/R/qweibull3.R0000644000176200001440000000026412477534360013674 0ustar liggesusersqweibull3 <- function(p,shape,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- thres+qweibull(p,shape,scale) return(xF) } FAdist/R/plgamma3.R0000644000176200001440000000027712477534360013472 0ustar liggesusersplgamma3 <- function(q,shape=1,scale=1,thres=1,lower.tail=TRUE,log.p=FALSE) { Fx <- pgamma3(log(q),shape,1/scale,thres) if(!lower.tail) Fx <- 1 - Fx if(log.p) Fx <- log(Fx) return(Fx) } FAdist/R/rllog3.R0000644000176200001440000000011312477534360013160 0ustar liggesusersrllog3 <- function(n,shape=1,scale=1,thres=0) rllog(n,shape,scale)+thres FAdist/R/pkappa.R0000644000176200001440000000027412477534360013242 0ustar liggesuserspkappa <- function(q,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) { Fx <- q/scale*(shape+(q/scale)^shape)^(-1/shape) if(!lower.tail) Fx <- 1 - Fx if(log.p) Fx <- log(Fx) return(Fx) } FAdist/R/qkappa4.R0000644000176200001440000000033412477534360013324 0ustar liggesusersqkappa4 <- function(p,shape1,shape2,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- location+scale/shape1*(1-((1-p^shape2)/shape2)^shape1) return(xF) } FAdist/R/qlgamma3.R0000644000176200001440000000027312477534360013467 0ustar liggesusersqlgamma3 <- function(p,shape=1,scale=1,thres=1,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- exp(qgamma3(p,shape,1/scale,thres)) return(xF) } FAdist/R/dllog.R0000644000176200001440000000023312477534360013062 0ustar liggesusersdllog <- function(x,shape=1,scale=1,log=FALSE) { fx <- dlogis(log(x),location=scale,scale=shape,log=FALSE)/x if(log) return(log(fx)) else return(fx) } FAdist/R/qkappa.R0000644000176200001440000000030312477534360013234 0ustar liggesusersqkappa <- function(p,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- (((scale*p)^(-shape)-1/scale^shape)/shape)^(-1/shape) return(xF) } FAdist/R/pkappa4.R0000644000176200001440000000034512477534360013325 0ustar liggesuserspkappa4 <- function(q,shape1,shape2,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) { Fx <- (1-shape2*(1-shape1/scale*(q-location))^(1/shape1))^(1/shape2) if(!lower.tail) Fx <- 1 - Fx if(log.p) Fx <- log(Fx) return(Fx) }FAdist/R/qgev.R0000644000176200001440000000031214207653014012710 0ustar liggesusersqgev <- function(p,shape=1,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- location + scale/shape * ((-log(p))^(-shape) - 1) return(xF) } FAdist/R/pgev2.R0000644000176200001440000000071714207653672013014 0ustar liggesusers# extended version supporting shape == 0 and vectorized arguments pgev2 <- function(p,shape=1,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- with(expand.args(p, shape, scale, location), ifelse(shape == 0, location - scale * log(-log(p)), location + scale/shape * ((-log(p))^(-shape)-1) ) ) return(xF) } FAdist/R/rllog.R0000644000176200001440000000012112477534360013074 0ustar liggesusersrllog <- function(n,shape=1,scale=1) exp(rlogis(n,location=scale,scale=shape)) FAdist/R/dgamma3.R0000644000176200001440000000021512477534360013272 0ustar liggesusersdgamma3 <- function(x,shape=1,scale=1,thres=0,log=FALSE) { fx <- dgamma(x-thres,shape,1/scale) if(log) return(log(fx)) else return(fx) } FAdist/R/rgamma3.R0000644000176200001440000000011712477534360013311 0ustar liggesusersrgamma3 <- function(n,shape=1,scale=1,thres=0) rgamma(n,shape,1/scale)+thres FAdist/R/pllog3.R0000644000176200001440000000026412477534360013165 0ustar liggesuserspllog3 <- function(q,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) { Fx <- pllog(q-thres,shape,scale) if(!lower.tail) Fx <- 1 - Fx if(log.p) Fx <- log(Fx) return(Fx) } FAdist/R/pgev.R0000644000176200001440000000031212477534360012720 0ustar liggesuserspgev <- function(q,shape=1,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) { Fx <- exp(-(1+shape*((q-location)/scale))^(-1/shape)) if(!lower.tail) Fx <- 1 - Fx if(log.p) Fx <- log(Fx) return(Fx) } FAdist/R/dgev.R0000644000176200001440000000032312477534360012706 0ustar liggesusersdgev <- function(x,shape=1,scale=1,location=0,log=FALSE) { fx <- 1/scale*(1+shape*((x-location)/scale))^(-1/shape-1)*exp(-(1+shape*((x-location)/scale))^(-1/shape)) if(log) return(log(fx)) else return(fx) } FAdist/R/pweibull3.R0000644000176200001440000000017412477534360013673 0ustar liggesuserspweibull3 <- function(q,shape,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) pweibull(q-thres,shape,scale,lower.tail,log.p) FAdist/R/qgumbel.R0000644000176200001440000000025512477534360013421 0ustar liggesusersqgumbel <- function(p,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- location-scale*log(-log(p)) return(xF) } FAdist/R/qgev2.R0000644000176200001440000000061214207653357013007 0ustar liggesusers# extended version supporting shape == 0 and vectorized arguments qgev2 <- function(p,shape=1,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- with(expand.args(p, shape, scale, location), ifelse(shape==0, location - scale * log(-log(p)), location + scale/shape * ((-log(p))^(-shape) - 1) ) ) return(xF) } FAdist/R/dweibull3.R0000644000176200001440000000013512477534360013654 0ustar liggesusersdweibull3 <- function(x,shape,scale=1,thres=0,log=FALSE) dweibull(x-thres,shape,scale,log) FAdist/R/rgev.R0000644000176200001440000000013414207654066012723 0ustar liggesusersrgev <- function(n,shape=1,scale=1,location=0) { qgev2(runif(n),shape,scale,location) } FAdist/R/dllog3.R0000644000176200001440000000021112477534360013141 0ustar liggesusersdllog3 <- function(x,shape=1,scale=1,thres=0,log=FALSE) { fx <- dllog(x-thres,shape,scale) if(log) return(log(fx)) else return(fx) } FAdist/R/pgumbel.R0000644000176200001440000000026412477534360013420 0ustar liggesuserspgumbel <- function(q,scale=1,location=0,lower.tail=TRUE,log.p=FALSE) { Fx <- exp(-exp(-(q-location)/scale)) if(!lower.tail) Fx <- 1 - Fx if(log.p) Fx <- log(Fx) return(Fx) } FAdist/R/qllog.R0000644000176200001440000000026612477534360013105 0ustar liggesusersqllog <- function(p,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- exp(qlogis(p,location=scale,scale=shape)) return(xF) } FAdist/R/dgumbel.R0000644000176200001440000000024412477534360013402 0ustar liggesusersdgumbel <- function(x,scale=1,location=0,log=FALSE) { fx <- 1/scale*exp(-(x-location)/scale-exp(-(x-location)/scale)) if(log) return(log(fx)) else return(fx) } FAdist/R/pgp.R0000644000176200001440000000025412477534360012552 0ustar liggesuserspgp <- function(q,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) { Fx <- 1-(1-shape*q/scale)^(1/shape) if(!lower.tail) Fx <- 1 - Fx if(log.p) Fx <- log(Fx) return(Fx) } FAdist/R/pllog.R0000644000176200001440000000027212477534360013101 0ustar liggesuserspllog <- function(q,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) { Fx <- plogis(log(q),location=scale,scale=shape) if(!lower.tail) Fx <- 1 - Fx if(log.p) Fx <- log(Fx) return(Fx) } FAdist/R/expand.args.R0000644000176200001440000000020714207652645014174 0ustar liggesusersexpand.args <- function(...){ dots <- list(...) max_length <- max(lengths(dots)) lapply(dots, rep, length.out = max_length) }FAdist/R/rweibull3.R0000644000176200001440000000012112477534360013665 0ustar liggesusersrweibull3 <- function(n,shape,scale=1,thres=0) thres + rweibull(n,shape,scale) FAdist/R/pgamma3.R0000644000176200001440000000027012477534360013307 0ustar liggesuserspgamma3 <- function(q,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) { Fx <- pgamma(q-thres,shape,1/scale) if(!lower.tail) Fx <- 1 - Fx if(log.p) Fx <- log(Fx) return(Fx) } FAdist/R/dlgamma3.R0000644000176200001440000000022612477534360013450 0ustar liggesusersdlgamma3 <- function(x,shape=1,scale=1,thres=1,log=FALSE) { fx <- dgamma3(log(x),shape,1/scale,thres)/x if(log) return(log(fx)) else return(fx) } FAdist/R/rlnorm3.R0000644000176200001440000000011512477534360013354 0ustar liggesusersrlnorm3 <- function(n,shape=1,scale=1,thres=0) rlnorm(n,scale,shape)+thres FAdist/R/dgp.R0000644000176200001440000000021712477534360012535 0ustar liggesusersdgp <- function(x,shape=1,scale=1,log=FALSE) { fx <- 1/scale*(1-shape*x/scale)^((1-shape)/shape) if(log) return(log(fx)) else return(fx) } FAdist/R/dkappa4.R0000644000176200001440000000034012477534360013304 0ustar liggesusersdkappa4 <- function(x,shape1,shape2,scale=1,location=0,log=FALSE) { fx <- (1-shape1*(x-location)/scale)^(1/shape1-1)/scale* pkappa4(x,shape1,shape2,scale,location)^(1-shape2) if(log) return(log(fx)) else return(fx) }FAdist/R/rgp.R0000644000176200001440000000007712477534360012557 0ustar liggesusersrgp <- function(n,shape=1,scale=1) qgp(runif(n),shape,scale) FAdist/R/qllog3.R0000644000176200001440000000026012477534360013162 0ustar liggesusersqllog3 <- function(p,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- qllog(p,shape,scale)+thres return(xF) } FAdist/R/qlnorm3.R0000644000176200001440000000026212477534360013356 0ustar liggesusersqlnorm3 <- function(p,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- qlnorm(p,scale,shape)+thres return(xF) } FAdist/R/dkappa.R0000644000176200001440000000023512477534360013223 0ustar liggesusersdkappa <- function(x,shape=1,scale=1,log=FALSE) { fx <- shape/scale*(shape+(x/scale)^shape)^(-(shape+1)/shape) if(log) return(log(fx)) else return(fx) } FAdist/R/dlnorm3.R0000644000176200001440000000021312477534360013335 0ustar liggesusersdlnorm3 <- function(x,shape=1,scale=1,thres=0,log=FALSE) { fx <- dlnorm(x-thres,scale,shape) if(log) return(log(fx)) else return(fx) } FAdist/R/plnorm3.R0000644000176200001440000000026612477534360013361 0ustar liggesusersplnorm3 <- function(q,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) { Fx <- plnorm(q-thres,scale,shape) if(!lower.tail) Fx <- 1 - Fx if(log.p) Fx <- log(Fx) return(Fx) } FAdist/R/rlgamma3.R0000644000176200001440000000012612477534360013465 0ustar liggesusersrlgamma3 <- function(n,shape=1,scale=1,thres=1) exp(rgamma3(n,shape,1/scale,thres)) FAdist/R/qgp.R0000644000176200001440000000024612477534360012554 0ustar liggesusersqgp <- function(p,shape=1,scale=1,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- scale/shape*(1-(1-p)^shape) return(xF) } FAdist/R/qgamma3.R0000644000176200001440000000026412477534360013313 0ustar liggesusersqgamma3 <- function(p,shape=1,scale=1,thres=0,lower.tail=TRUE,log.p=FALSE) { if(log.p) p <- exp(p) if(!lower.tail) p <- 1 - p xF <- qgamma(p,shape,1/scale)+thres return(xF) } FAdist/R/rkappa4.R0000644000176200001440000000020712477534360013324 0ustar liggesusersrkappa4 <- function(n,shape1,shape2,scale=1,location=0) qkappa4(p=runif(n),shape1=shape1,shape2=shape2,scale=scale,location=location) FAdist/MD50000644000176200001440000000546014210236272011740 0ustar liggesusers16b61568f1a8f8809a5d88711e6ff970 *DESCRIPTION 7417340a9118beb9af95e82fcb24b379 *NAMESPACE 1abb77717e390d1021a274bc45e4dd25 *R/dgamma3.R 604fbdb3b9c4b7302853d6464bcffb90 *R/dgev.R 2154f4afd31a78e5a1894348d6223627 *R/dgp.R a8c79f6cae89f922fac798ddcb085b4d *R/dgumbel.R b5a6e3c9622e7bfc018d86c34651c595 *R/dkappa.R 0240d1a83b1600ccf593f06acca9b447 *R/dkappa4.R 95486e2e742926d36f9f27f5ec243da9 *R/dlgamma3.R a51b8f684565a01f247d341cdbaa3e13 *R/dllog.R 22adb35f3aebeb8f8cb2f707ea8397e7 *R/dllog3.R 222af581bb5698ec68463b5db952177d *R/dlnorm3.R 97cdc2dbadd5c76a0d224c195bf3622b *R/dweibull3.R 12ea4ef6bc89a0264d2b67a995d25044 *R/expand.args.R 2c318afcd4f5d3108367a17871d896a0 *R/pgamma3.R a8ba1e015a00ecbaeba35258289b6bb3 *R/pgev.R 118d5c0ef4165ac9edd0309730bf46f7 *R/pgev2.R afbe564c495fc5494dda1314f1408c56 *R/pgp.R 49a53a09f9c7c9a3b166c7c1eaa2c3a2 *R/pgumbel.R 6605f98ca72bf2f715a0818223470171 *R/pkappa.R 4e2e1919482f27e4fa29faeaa4deea20 *R/pkappa4.R d4b17ef008432fcecb4eca3c34135138 *R/plgamma3.R eafe879fc0a0d241136bdf913b16542e *R/pllog.R 58f06f07566df548ffecd86cc26d5302 *R/pllog3.R b4e47bd3f6d329955ff8ea1d622db595 *R/plnorm3.R 55017be0f709ab91ad48eb1162e3abfd *R/pweibull3.R 6fb78712ddc6397af99b8e9b9a3ad19a *R/qgamma3.R 9cebae63c1326e6ba4438a2a0c91c919 *R/qgev.R 1a6ac5f816959ba2dffb9381012ba0fe *R/qgev2.R 4c0b4042a9762a4fb0cbf28789494204 *R/qgp.R ebb1932d28b4b2dbee20b4483a2aab1f *R/qgumbel.R 610b121c93aa8fc412d56950ee9b0d93 *R/qkappa.R 315b27801b495976d5d7de0015023714 *R/qkappa4.R d5143d31e047d11114812a1b513c8a59 *R/qlgamma3.R 5fd4b4b98ae9e55c71eaeda741e1a1ca *R/qllog.R b6022aa6a1abf2212a659284e0f33360 *R/qllog3.R ab4ae815298ee30e06733c9e57721bdb *R/qlnorm3.R d6d9078bb2ff456ac95e1be7bf684a50 *R/qweibull3.R 546fb27fdacb206f38e3cf5aa6413d03 *R/rgamma3.R 24fc1b3ec634c775db44673410065803 *R/rgev.R 09da10b2dc18bacc4aff08556dfe79d7 *R/rgp.R 6b5e1bb1e2622cec859b1f17f941cd6d *R/rgumbel.R 2f6c4507aea2f383120d67f5ad6a9060 *R/rkappa.R 43218c6bc76157f8c6f4f164580ebe08 *R/rkappa4.R 52e4a9598af8af5d573e20df90c71745 *R/rlgamma3.R e396cce51555cad1b6d2bb079755b1d0 *R/rllog.R 27797cc690484f3602258870a5805989 *R/rllog3.R f9dfa298ed94e6db54ebd027de38d206 *R/rlnorm3.R 47e415c145e0e4cbb7b4ea5c2a30d8c0 *R/rweibull3.R 1626dbb7f6bf8c5475c14549b2fb8d47 *man/FAdist-internal.Rd a9dacc7a838648ac7b4ca9b1687f693b *man/FAdist-package.Rd 31729a360a182ed9ca4a1dea095de10b *man/GAMMA3.Rd 4d3ff85265a5507763a1ffe0164c7a66 *man/GEV.Rd 06ef5e702f7d8b0a8983a35542009ea7 *man/GUMBEL.Rd 0b95011af2b94a47b8c934ae628b8601 *man/GenPARETO.Rd 04d61d50ded9e7fa00a040a7ce57a8d4 *man/KAPPA.Rd 21df950368519a6e7ec164150bf7cec8 *man/KAPPA4.Rd aea358b1f06e018369b218dea0feb113 *man/LGAMMA3.Rd 62aafe71c78dda11a1b887d6153ce561 *man/LLOGIS.Rd 589d842c948e3dfb063bc69a191a13e5 *man/LLOGIS3.Rd 9668efcfebd843651809c95d98c2c727 *man/LNORM3.Rd ec0dd11042243db2762da8386aaa10cd *man/WEIBULL3.Rd