var

0th

Percentile

Generic Functions for the Computation of Functionals

Generic functions for the computation of functionals on distributions.

Keywords
methods, distribution
Usage
IQR(x, ...)

## S3 method for class 'UnivariateDistribution':
IQR(x)
## S3 method for class 'AffLinDistribution':
IQR(x)
## S3 method for class 'DiscreteDistribution':
IQR(x)
## S3 method for class 'Cauchy':
IQR(x)
## S3 method for class 'Dirac':
IQR(x)
## S3 method for class 'DExp':
IQR(x)
## S3 method for class 'Exp':
IQR(x)
## S3 method for class 'Geom':
IQR(x)
## S3 method for class 'Logis':
IQR(x)
## S3 method for class 'Norm':
IQR(x)
## S3 method for class 'Unif':
IQR(x)

median(x, ...)

## S3 method for class 'UnivariateDistribution':
median(x)
## S3 method for class 'AffLinDistribution':
median(x)
## S3 method for class 'Cauchy':
median(x)
## S3 method for class 'Dirac':
median(x)
## S3 method for class 'DExp':
median(x)
## S3 method for class 'Exp':
median(x)
## S3 method for class 'Geom':
median(x)
## S3 method for class 'Logis':
median(x)
## S3 method for class 'Lnorm':
median(x)
## S3 method for class 'Norm':
median(x)
## S3 method for class 'Unif':
median(x)

mad(x, ...)

## S3 method for class 'UnivariateDistribution':
mad(x)
## S3 method for class 'AffLinDistribution':
mad(x)
## S3 method for class 'Cauchy':
mad(x)
## S3 method for class 'Dirac':
mad(x)
## S3 method for class 'DExp':
mad(x)
## S3 method for class 'Exp':
mad(x)
## S3 method for class 'Geom':
mad(x)
## S3 method for class 'Logis':
mad(x)
## S3 method for class 'Norm':
mad(x)
## S3 method for class 'Unif':
mad(x)

sd(x, ...)

## S3 method for class 'UnivariateDistribution':
sd(x, fun, cond, withCond, useApply, ...)

var(x, ...)

## S3 method for class 'UnivariateDistribution':
var(x, fun, cond, withCond, useApply, ...)
## S3 method for class 'AffLinDistribution':
var(x, fun, cond, withCond, useApply, ...)
## S3 method for class 'Binom':
var(x)
## S3 method for class 'Beta':
var(x)
## S3 method for class 'Cauchy':
var(x)
## S3 method for class 'Chisq':
var(x)
## S3 method for class 'Dirac':
var(x)
## S3 method for class 'DExp':
var(x)
## S3 method for class 'Exp':
var(x)
## S3 method for class 'Fd':
var(x)
## S3 method for class 'Gammad':
var(x)
## S3 method for class 'Geom':
var(x)
## S3 method for class 'Hyper':
var(x)
## S3 method for class 'Logis':
var(x)
## S3 method for class 'Lnorm':
var(x)
## S3 method for class 'Nbinom':
var(x)
## S3 method for class 'Norm':
var(x)
## S3 method for class 'Pois':
var(x)
## S3 method for class 'Td':
var(x)
## S3 method for class 'Unif':
var(x)
## S3 method for class 'Weibull':
var(x)

skewness(x, ...)
## S3 method for class 'UnivariateDistribution':
skewness(x, fun, cond, withCond, useApply, ...)
## S3 method for class 'AffLinDistribution':
skewness(x, fun, cond, withCond, useApply, ...)
## S3 method for class 'Binom':
skewness(x)
## S3 method for class 'Beta':
skewness(x)
## S3 method for class 'Cauchy':
skewness(x)
## S3 method for class 'Chisq':
skewness(x)
## S3 method for class 'Dirac':
skewness(x)
## S3 method for class 'DExp':
skewness(x)
## S3 method for class 'Exp':
skewness(x)
## S3 method for class 'Fd':
skewness(x)
## S3 method for class 'Gammad':
skewness(x)
## S3 method for class 'Geom':
skewness(x)
## S3 method for class 'Hyper':
skewness(x)
## S3 method for class 'Logis':
skewness(x)
## S3 method for class 'Lnorm':
skewness(x)
## S3 method for class 'Nbinom':
skewness(x)
## S3 method for class 'Norm':
skewness(x)
## S3 method for class 'Pois':
skewness(x)
## S3 method for class 'Td':
skewness(x)
## S3 method for class 'Unif':
skewness(x)
## S3 method for class 'Weibull':
skewness(x)

kurtosis(x, ...)
## S3 method for class 'UnivariateDistribution':
kurtosis(x, fun, cond, withCond, useApply, ...)
## S3 method for class 'AffLinDistribution':
kurtosis(x, fun, cond, withCond, useApply, ...)
## S3 method for class 'Binom':
kurtosis(x)
## S3 method for class 'Beta':
kurtosis(x)
## S3 method for class 'Cauchy':
kurtosis(x)
## S3 method for class 'Chisq':
kurtosis(x)
## S3 method for class 'Dirac':
kurtosis(x)
## S3 method for class 'DExp':
kurtosis(x)
## S3 method for class 'Exp':
kurtosis(x)
## S3 method for class 'Fd':
kurtosis(x)
## S3 method for class 'Gammad':
kurtosis(x)
## S3 method for class 'Geom':
kurtosis(x)
## S3 method for class 'Hyper':
kurtosis(x)
## S3 method for class 'Logis':
kurtosis(x)
## S3 method for class 'Lnorm':
kurtosis(x)
## S3 method for class 'Nbinom':
kurtosis(x)
## S3 method for class 'Norm':
kurtosis(x)
## S3 method for class 'Pois':
kurtosis(x)
## S3 method for class 'Td':
kurtosis(x)
## S3 method for class 'Unif':
kurtosis(x)
## S3 method for class 'Weibull':
kurtosis(x)
Arguments
x
object of class "UnivariateDistribution"
fun
if missing the (conditional) variance resp. standard deviation is computed else the (conditional) variance resp. standard deviation of fun is computed.
cond
if not missing the conditional variance resp. standard deviation given cond is computed.
...
additional arguments to fun or E
useApply
logical: should sapply, respectively apply be used to evaluate fund.
withCond
logical: is cond in the argument list of fun.
Value

  • The value of the corresponding functional at the distribution in the argument is computed.

Caveat

If any of the packages e1071, moments, fBasics is to be used together with distrEx the latter must be attached after any of the first mentioned. Otherwise kurtosis() and skewness() defined as methods in distrEx may get masked. To re-mask, you may use kurtosis <- distrEx::kurtosis; skewness <- distrEx::skewness. See also distrExMASK().

Acknowledgement

G. Jay Kerns, gkerns@ysu.edu, has provided a major contribution, in particular the functionals skewness and kurtosis are due to him.

concept

  • functional
  • var
  • sd
  • IQR
  • mad
  • median
  • skewness
  • kurtosis
  • integration

See Also

distrExIntegrate, m1df, m2df, Distribution-class, sd, var, IQR, median, mad, sd, skewness, kurtosis

Aliases
  • var
  • var-methods
  • var,ANY-method
  • var,UnivariateDistribution-method
  • var,AffLinDistribution-method
  • var,AffLinAbscontDistribution-method
  • var,AffLinDiscreteDistribution-method
  • var,AffLinLatticeDistribution-method
  • var,Beta-method
  • var,Binom-method
  • var,Cauchy-method
  • var,Chisq-method
  • var,Dirac-method
  • var,DExp-method
  • var,Exp-method
  • var,Fd-method
  • var,Gammad-method
  • var,Geom-method
  • var,Hyper-method
  • var,Logis-method
  • var,Lnorm-method
  • var,Nbinom-method
  • var,Norm-method
  • var,Pois-method
  • var,Unif-method
  • var,Weibull-method
  • var,Td-method
  • sd
  • sd-methods
  • sd,UnivariateDistribution-method
  • median
  • median,ANY-method
  • median-methods
  • median,UnivariateDistribution-method
  • median,AffLinDistribution-method
  • median,AffLinAbscontDistribution-method
  • median,AffLinDiscreteDistribution-method
  • median,AffLinLatticeDistribution-method
  • median,Cauchy-method
  • median,Dirac-method
  • median,DExp-method
  • median,Exp-method
  • median,Geom-method
  • median,Logis-method
  • median,Lnorm-method
  • median,Norm-method
  • median,Unif-method
  • IQR
  • IQR-methods
  • IQR,ANY-method
  • IQR,UnivariateDistribution-method
  • IQR,AffLinDistribution-method
  • IQR,AffLinAbscontDistribution-method
  • IQR,AffLinDiscreteDistribution-method
  • IQR,AffLinLatticeDistribution-method
  • IQR,DiscreteDistribution-method
  • IQR,Cauchy-method
  • IQR,Dirac-method
  • IQR,DExp-method
  • IQR,Exp-method
  • IQR,Geom-method
  • IQR,Logis-method
  • IQR,Norm-method
  • IQR,Unif-method
  • mad
  • mad,ANY-method
  • mad-methods
  • mad,UnivariateDistribution-method
  • mad,AffLinDistribution-method
  • mad,AffLinAbscontDistribution-method
  • mad,AffLinDiscreteDistribution-method
  • mad,AffLinLatticeDistribution-method
  • mad,Cauchy-method
  • mad,Dirac-method
  • mad,DExp-method
  • mad,Exp-method
  • mad,Geom-method
  • mad,Logis-method
  • mad,Norm-method
  • mad,Unif-method
  • skewness
  • skewness-methods
  • skewness,ANY-method
  • skewness,UnivariateDistribution-method
  • skewness,AffLinDistribution-method
  • skewness,AffLinAbscontDistribution-method
  • skewness,AffLinDiscreteDistribution-method
  • skewness,AffLinLatticeDistribution-method
  • skewness,Beta-method
  • skewness,Binom-method
  • skewness,Cauchy-method
  • skewness,Chisq-method
  • skewness,Dirac-method
  • skewness,DExp-method
  • skewness,Exp-method
  • skewness,Fd-method
  • skewness,Gammad-method
  • skewness,Geom-method
  • skewness,Hyper-method
  • skewness,Logis-method
  • skewness,Lnorm-method
  • skewness,Nbinom-method
  • skewness,Norm-method
  • skewness,Pois-method
  • skewness,Unif-method
  • skewness,Weibull-method
  • skewness,Td-method
  • kurtosis
  • kurtosis-methods
  • kurtosis,ANY-method
  • kurtosis,UnivariateDistribution-method
  • kurtosis,AffLinDistribution-method
  • kurtosis,AffLinAbscontDistribution-method
  • kurtosis,AffLinDiscreteDistribution-method
  • kurtosis,AffLinLatticeDistribution-method
  • kurtosis,Beta-method
  • kurtosis,Binom-method
  • kurtosis,Cauchy-method
  • kurtosis,Chisq-method
  • kurtosis,Dirac-method
  • kurtosis,DExp-method
  • kurtosis,Exp-method
  • kurtosis,Fd-method
  • kurtosis,Gammad-method
  • kurtosis,Geom-method
  • kurtosis,Hyper-method
  • kurtosis,Logis-method
  • kurtosis,Lnorm-method
  • kurtosis,Nbinom-method
  • kurtosis,Norm-method
  • kurtosis,Pois-method
  • kurtosis,Unif-method
  • kurtosis,Weibull-method
  • kurtosis,Td-method
Examples
# Variance of Exp(1) distribution
var(Exp())

#median(Exp())
IQR(Exp())
mad(Exp())

# Variance of N(1,4)^2
var(Norm(mean=1, sd=2), fun = function(x){x^2})
var(Norm(mean=1, sd=2), fun = function(x){x^2}, useApply = FALSE)

## sd -- may equivalently be replaced by var
sd(Pois()) ## uses explicit terms
sd(as(Pois(),"DiscreteDistribution")) ## uses sums
sd(as(Pois(),"UnivariateDistribution")) ## uses simulations
sd(Norm(mean=2), fun = function(x){2*x^2}) ## uses simulations
#
mad(sin(exp(Norm()+2*Pois()))) ## weird
Documentation reproduced from package distrEx, version 1.9, License: GPL (version 2 or later)

Community examples

Looks like there are no examples yet.