var {distrEx} | R Documentation |
Generic functions for the computation of functionals on distributions.
IQR(x, ...) ## S4 method for signature 'UnivariateDistribution': IQR(x) ## S4 method for signature 'AffLinDistribution': IQR(x) ## S4 method for signature 'DiscreteDistribution': IQR(x) ## S4 method for signature 'Cauchy': IQR(x) ## S4 method for signature 'Dirac': IQR(x) ## S4 method for signature 'DExp': IQR(x) ## S4 method for signature 'Exp': IQR(x) ## S4 method for signature 'Geom': IQR(x) ## S4 method for signature 'Logis': IQR(x) ## S4 method for signature 'Norm': IQR(x) ## S4 method for signature 'Unif': IQR(x) ## S4 method for signature 'Arcsine': IQR(x) median(x, ...) ## S4 method for signature 'UnivariateDistribution': median(x) ## S4 method for signature 'AffLinDistribution': median(x) ## S4 method for signature 'Cauchy': median(x) ## S4 method for signature 'Dirac': median(x) ## S4 method for signature 'DExp': median(x) ## S4 method for signature 'Exp': median(x) ## S4 method for signature 'Geom': median(x) ## S4 method for signature 'Logis': median(x) ## S4 method for signature 'Lnorm': median(x) ## S4 method for signature 'Norm': median(x) ## S4 method for signature 'Unif': median(x) ## S4 method for signature 'Arcsine': median(x) mad(x, ...) ## S4 method for signature 'UnivariateDistribution': mad(x) ## S4 method for signature 'AffLinDistribution': mad(x) ## S4 method for signature 'Cauchy': mad(x) ## S4 method for signature 'Dirac': mad(x) ## S4 method for signature 'DExp': mad(x) ## S4 method for signature 'Exp': mad(x) ## S4 method for signature 'Geom': mad(x) ## S4 method for signature 'Logis': mad(x) ## S4 method for signature 'Norm': mad(x) ## S4 method for signature 'Unif': mad(x) ## S4 method for signature 'Arcsine': mad(x) sd(x, ...) ## S4 method for signature 'UnivariateDistribution': sd(x, fun, cond, withCond, useApply, ...) ## S4 method for signature 'Norm': sd(x, fun, cond, withCond = FALSE, useApply = TRUE, ...) var(x, ...) ## S4 method for signature 'UnivariateDistribution': var(x, fun, cond, withCond, useApply, ...) ## S4 method for signature 'AffLinDistribution': var(x, fun, cond, withCond, useApply, ...) ## S4 method for signature 'Binom': var(x, ...) ## S4 method for signature 'Beta': var(x, ...) ## S4 method for signature 'Cauchy': var(x, ...) ## S4 method for signature 'Chisq': var(x, ...) ## S4 method for signature 'Dirac': var(x, ...) ## S4 method for signature 'DExp': var(x, ...) ## S4 method for signature 'Exp': var(x, ...) ## S4 method for signature 'Fd': var(x, ...) ## S4 method for signature 'Gammad': var(x, ...) ## S4 method for signature 'Geom': var(x, ...) ## S4 method for signature 'Hyper': var(x, ...) ## S4 method for signature 'Logis': var(x, ...) ## S4 method for signature 'Lnorm': var(x, ...) ## S4 method for signature 'Nbinom': var(x, ...) ## S4 method for signature 'Norm': var(x, ...) ## S4 method for signature 'Pois': var(x, ...) ## S4 method for signature 'Td': var(x, ...) ## S4 method for signature 'Unif': var(x, ...) ## S4 method for signature 'Weibull': var(x, ...) ## S4 method for signature 'Arcsine': var(x, ...) skewness(x, ...) ## S4 method for signature 'UnivariateDistribution': skewness(x, fun, cond, withCond, useApply, ...) ## S4 method for signature 'AffLinDistribution': skewness(x, fun, cond, withCond, useApply, ...) ## S4 method for signature 'Binom': skewness(x, ...) ## S4 method for signature 'Beta': skewness(x, ...) ## S4 method for signature 'Cauchy': skewness(x, ...) ## S4 method for signature 'Chisq': skewness(x, ...) ## S4 method for signature 'Dirac': skewness(x, ...) ## S4 method for signature 'DExp': skewness(x, ...) ## S4 method for signature 'Exp': skewness(x, ...) ## S4 method for signature 'Fd': skewness(x, ...) ## S4 method for signature 'Gammad': skewness(x, ...) ## S4 method for signature 'Geom': skewness(x, ...) ## S4 method for signature 'Hyper': skewness(x, ...) ## S4 method for signature 'Logis': skewness(x, ...) ## S4 method for signature 'Lnorm': skewness(x, ...) ## S4 method for signature 'Nbinom': skewness(x, ...) ## S4 method for signature 'Norm': skewness(x, ...) ## S4 method for signature 'Pois': skewness(x, ...) ## S4 method for signature 'Td': skewness(x, ...) ## S4 method for signature 'Unif': skewness(x, ...) ## S4 method for signature 'Weibull': skewness(x, ...) ## S4 method for signature 'Arcsine': skewness(x, ...) kurtosis(x, ...) ## S4 method for signature 'UnivariateDistribution': kurtosis(x, fun, cond, withCond, useApply, ...) ## S4 method for signature 'AffLinDistribution': kurtosis(x, fun, cond, withCond, useApply, ...) ## S4 method for signature 'Binom': kurtosis(x, ...) ## S4 method for signature 'Beta': kurtosis(x, ...) ## S4 method for signature 'Cauchy': kurtosis(x, ...) ## S4 method for signature 'Chisq': kurtosis(x, ...) ## S4 method for signature 'Dirac': kurtosis(x, ...) ## S4 method for signature 'DExp': kurtosis(x, ...) ## S4 method for signature 'Exp': kurtosis(x, ...) ## S4 method for signature 'Fd': kurtosis(x, ...) ## S4 method for signature 'Gammad': kurtosis(x, ...) ## S4 method for signature 'Geom': kurtosis(x, ...) ## S4 method for signature 'Hyper': kurtosis(x, ...) ## S4 method for signature 'Logis': kurtosis(x, ...) ## S4 method for signature 'Lnorm': kurtosis(x, ...) ## S4 method for signature 'Nbinom': kurtosis(x, ...) ## S4 method for signature 'Norm': kurtosis(x, ...) ## S4 method for signature 'Pois': kurtosis(x, ...) ## S4 method for signature 'Td': kurtosis(x, ...) ## S4 method for signature 'Unif': kurtosis(x, ...) ## S4 method for signature 'Weibull': kurtosis(x, ...) ## S4 method for signature 'Arcsine': kurtosis(x, ...)
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 . |
The value of the corresponding functional at the distribution in the argument is computed.
var
, signature(x = "Any")
:var
— see var
resp. help(var,package="stats")
.var
, signature(x = "UnivariateDistribution")
:E()
-method.var
, signature(x = "AffLinDistribution")
:fun
, cond
are missing: x@a^2 * var(x@X0)
else uses method for signature(x = "UnivariateDistribution")
sd
, signature(x = "Any")
:sd
— see sd
resp. help(sd,package="stats")
.sd
, signature(x = "NormParameter")
:sd
of the parameter of a normal distribution — see
sd
resp. help(sd,package="distr")
.sd
, signature(x = "Norm")
:sd
of the parameter of a normal distribution — see
sd
resp. help(sd,package="distr")
.sd
, signature(x = "UnivariateDistribution")
:E()
-method.IQR
, signature(x = "Any")
:IQR
— see IQR
resp. help(IQR,package="stats")
.IQR
, signature(x = "UnivariateDistribution")
:q()
-method.IQR
, signature(x = "DiscreteDistribution")
:q()
-method but taking care that between upper and lower quartile
there is 50% probability IQR
, signature(x = "AffLinDistribution")
:abs(x@a) * IQR(x@X0)
median
, signature(x = "Any")
:median
— see median
resp. help(var,package="stats")
.median
, signature(x = "UnivariateDistribution")
:q()
-method. median
, signature(x = "AffLinDistribution")
:x@a * median(x@X0) + x@b
mad
, signature(x = "Any")
:mad
— see mad
.mad
, signature(x = "UnivariateDistribution")
:q()
-method applied to abs(x-median(x))
.mad
, signature(x = "AffLinDistribution")
:abs(x@a) * mad(x@X0)
skewness
, signature(x = "Any")
:sample.version = TRUE
).skewness
, signature(x = "UnivariateDistribution")
:E()
-method.skewness
, signature(x = "AffLinDistribution")
:fun
, cond
are missing: skewness(x@X0)
else uses method for signature(x = "UnivariateDistribution")
kurtosis
, signature(x = "Any")
:sample.version = TRUE
).kurtosis
, signature(x = "UnivariateDistribution")
:E()
-method.kurtosis
, signature(x = "AffLinDistribution")
:fun
, cond
are missing: kurtosis(x@X0)
else uses method for signature(x = "UnivariateDistribution")
var
, signature(x = "Beta")
:var
, signature(x = "Binom")
:var
, signature(x = "Cauchy")
:var
, signature(x = "Chisq")
:var
, signature(x = "Dirac")
:var
, signature(x = "DExp")
:var
, signature(x = "Exp")
:var
, signature(x = "Fd")
:var
, signature(x = "Gammad")
:var
, signature(x = "Geom")
:var
, signature(x = "Hyper")
:var
, signature(x = "Logis")
:var
, signature(x = "Lnorm")
:var
, signature(x = "Nbinom")
:var
, signature(x = "Norm")
:var
, signature(x = "Pois")
:var
, signature(x = "Td")
:var
, signature(x = "Unif")
:var
, signature(x = "Weibull")
:var
, signature(x = "Arcsine")
:IQR
, signature(x = "Cauchy")
:IQR
, signature(x = "Dirac")
:IQR
, signature(x = "DExp")
:IQR
, signature(x = "Exp")
:IQR
, signature(x = "Geom")
:IQR
, signature(x = "Logis")
:IQR
, signature(x = "Norm")
:IQR
, signature(x = "Unif")
:IQR
, signature(x = "Arcsine")
:median
, signature(x = "Cauchy")
:median
, signature(x = "Dirac")
:median
, signature(x = "DExp")
:median
, signature(x = "Exp")
:median
, signature(x = "Geom")
:median
, signature(x = "Logis")
:median
, signature(x = "Lnorm")
:median
, signature(x = "Norm")
:median
, signature(x = "Unif")
:median
, signature(x = "Arcsine")
:mad
, signature(x = "Cauchy")
:mad
, signature(x = "Dirac")
:mad
, signature(x = "DExp")
:mad
, signature(x = "Exp")
:mad
, signature(x = "Geom")
:mad
, signature(x = "Logis")
:mad
, signature(x = "Norm")
:mad
, signature(x = "Unif")
:mad
, signature(x = "Arcsine")
:skewness
, signature(x = "Beta")
:skewness
, signature(x = "Binom")
:skewness
, signature(x = "Cauchy")
:skewness
, signature(x = "Chisq")
:skewness
, signature(x = "Dirac")
:skewness
, signature(x = "DExp")
:skewness
, signature(x = "Exp")
:skewness
, signature(x = "Fd")
:skewness
, signature(x = "Gammad")
:skewness
, signature(x = "Geom")
:skewness
, signature(x = "Hyper")
:skewness
, signature(x = "Logis")
:skewness
, signature(x = "Lnorm")
:skewness
, signature(x = "Nbinom")
:skewness
, signature(x = "Norm")
:skewness
, signature(x = "Pois")
:skewness
, signature(x = "Td")
:skewness
, signature(x = "Unif")
:skewness
, signature(x = "Weibull")
:skewness
, signature(x = "Arcsine")
:kurtosis
, signature(x = "Beta")
:kurtosis
, signature(x = "Binom")
:kurtosis
, signature(x = "Cauchy")
:kurtosis
, signature(x = "Chisq")
:kurtosis
, signature(x = "Dirac")
:kurtosis
, signature(x = "DExp")
:kurtosis
, signature(x = "Exp")
:kurtosis
, signature(x = "Fd")
:kurtosis
, signature(x = "Gammad")
:kurtosis
, signature(x = "Geom")
:kurtosis
, signature(x = "Hyper")
:kurtosis
, signature(x = "Logis")
:kurtosis
, signature(x = "Lnorm")
:kurtosis
, signature(x = "Nbinom")
:kurtosis
, signature(x = "Norm")
:kurtosis
, signature(x = "Pois")
:kurtosis
, signature(x = "Td")
:kurtosis
, signature(x = "Unif")
:kurtosis
, signature(x = "Weibull")
:kurtosis
, signature(x = "Arcsine")
:
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()
.
G. Jay Kerns, gkerns@ysu.edu, has provided a major contribution,
in particular the functionals skewness
and kurtosis
are due to him.
Peter Ruckdeschel Peter.Ruckdeschel@itwm.fraunhofer.de
distrExIntegrate
, m1df
, m2df
,
Distribution-class
,
sd
, var
, IQR
,
median
, mad
, sd
# 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