E(object, fun, cond, ...)
## S3 method for class 'UnivariateDistribution,missing,missing':
E(object,
low = NULL, upp = NULL, Nsim = getdistrExOption("MCIterations"), ...)
## S3 method for class 'UnivariateDistribution,function,missing':
E(object, fun,
useApply = TRUE, low = NULL, upp = NULL, Nsim = getdistrExOption("MCIterations"), ...)
## S3 method for class 'AbscontDistribution,function,missing':
E(object, fun, useApply = TRUE,
low = NULL, upp = NULL,
rel.tol= getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac"), ...)
## S3 method for class 'UnivarMixingDistribution,missing,missing':
E(object, low = NULL,
upp = NULL, rel.tol= getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac"), ...)
## S3 method for class 'UnivarMixingDistribution,function,missing':
E(object, fun, useApply = TRUE,
low = NULL, upp = NULL,
rel.tol= getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac"), ...)
## S3 method for class 'UnivarMixingDistribution,missing,ANY':
E(object, cond, low = NULL,
upp = NULL, rel.tol= getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac"), ...)
## S3 method for class 'UnivarMixingDistribution,function,ANY':
E(object, fun, cond, useApply = TRUE,
low = NULL, upp = NULL, rel.tol= getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac"), ...)
## S3 method for class 'DiscreteDistribution,function,missing':
E(object, fun, useApply = TRUE,
low = NULL, upp = NULL, ...)
## S3 method for class 'AffLinDistribution,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'AffLinUnivarLebDecDistribution,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'MultivariateDistribution,missing,missing':
E(object,
Nsim = getdistrExOption("MCIterations"), ...)
## S3 method for class 'MultivariateDistribution,function,missing':
E(object, fun, useApply = TRUE,
Nsim = getdistrExOption("MCIterations"), ...)
## S3 method for class 'DiscreteMVDistribution,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'DiscreteMVDistribution,function,missing':
E(object, fun,
useApply = TRUE, ...)
## S3 method for class 'AbscontCondDistribution,missing,numeric':
E(object, cond, useApply = TRUE,
low = NULL, upp = NULL,
rel.tol= getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac"), ...)
## S3 method for class 'DiscreteCondDistribution,missing,numeric':
E(object, cond, useApply = TRUE,
low = NULL, upp = NULL, ...)
## S3 method for class 'UnivariateCondDistribution,function,numeric':
E(object, fun, cond,
withCond = FALSE, useApply = TRUE, low = NULL, upp = NULL,
Nsim = getdistrExOption("MCIterations"), ...)
## S3 method for class 'AbscontCondDistribution,function,numeric':
E(object, fun, cond,
withCond = FALSE, useApply = TRUE, low = NULL, upp = NULL,
rel.tol= getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac")
, ...)
## S3 method for class 'DiscreteCondDistribution,function,numeric':
E(object, fun, cond,
withCond = FALSE, useApply = TRUE, low = NULL, upp = NULL,...)
## S3 method for class 'DiscreteCondDistribution,function,numeric':
E(object, fun, cond,
withCond = FALSE, useApply = TRUE, low = NULL, upp = NULL,...)
## S3 method for class 'UnivarLebDecDistribution,missing,missing':
E(object, low = NULL, upp = NULL,
rel.tol= getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac"), ... )
## S3 method for class 'UnivarLebDecDistribution,function,missing':
E(object, fun,
useApply = TRUE, low = NULL, upp = NULL, rel.tol= getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac"), ... )
## S3 method for class 'UnivarLebDecDistribution,missing,ANY':
E(object, cond,
low = NULL, upp = NULL, rel.tol= getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac"), ... )
## S3 method for class 'UnivarLebDecDistribution,function,ANY':
E(object, fun, cond,
useApply = TRUE, low = NULL, upp = NULL,
rel.tol= getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac"), ... )
## S3 method for class 'AcDcLcDistribution,ANY,ANY':
E(object, fun, cond,
low = NULL, upp = NULL, rel.tol= getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac"), ... )
## S3 method for class 'CompoundDistribution,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Arcsine,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Beta,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Binom,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Cauchy,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Chisq,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Dirac,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'DExp,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Exp,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Fd,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Gammad,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Gammad,function,missing':
E(object, fun, low = NULL, upp = NULL,
rel.tol = getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = getdistrExOption("IQR.fac"), ...)
## S3 method for class 'Geom,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Gumbel,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'GPareto,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'GPareto,function,missing':
E(object, fun, low = NULL, upp = NULL,
rel.tol = getdistrExOption("ErelativeTolerance"),
lowerTruncQuantile = getdistrExOption("ElowerTruncQuantile"),
upperTruncQuantile = getdistrExOption("EupperTruncQuantile"),
IQR.fac = max(10000, getdistrExOption("IQR.fac")), ...)
## S3 method for class 'Hyper,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Logis,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Lnorm,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Nbinom,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Norm,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Pareto,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Pois,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Unif,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Td,missing,missing':
E(object, low = NULL, upp = NULL, ...)
## S3 method for class 'Weibull,missing,missing':
E(object, low = NULL, upp = NULL, ...)
"Distribution"
fun
is computed.cond
is computed.distrExIntegrate
.IQR.fac
$\times$IQR).fun
sapply
, respectively apply
be used to evaluate fun
.cond
in the argument list of fun
.distrExOptions
.
Also note that arguments low
and upp
should be given as
named arguments in order to prevent them to be matched by arguments
fun
or cond
. Also the result, when arguments
low
or upp
is given, is the unconditional value of the
expectation; no conditioning with respect to low <= object="" <="upp
is done.=>distrExIntegrate
, m1df
, m2df
,
Distribution-class
# mean of Exp(1) distribution
E <- Exp()
E(E) ## uses explicit terms
E(as(E,"AbscontDistribution")) ## uses numerical integration
E(as(E,"UnivariateDistribution")) ## uses simulations
E(E, fun = function(x){2*x^2}) ## uses simulations
# the same operator for discrete distributions:
P <- Pois(lambda=2)
E(P) ## uses explicit terms
E(as(P,"DiscreteDistribution")) ## uses sums
E(as(P,"UnivariateDistribution")) ## uses simulations
E(P, fun = function(x){2*x^2}) ## uses simulations
# second moment of N(1,4)
E(Norm(mean=1, sd=2), fun = function(x){x^2})
E(Norm(mean=1, sd=2), fun = function(x){x^2}, useApply = FALSE)
# conditional distribution of a linear model
D1 <- LMCondDistribution(theta = 1)
E(D1, cond = 1)
E(Norm(mean=1))
E(D1, function(x){x^2}, cond = 1)
E(Norm(mean=1), fun = function(x){x^2})
E(D1, function(x, cond){cond*x^2}, cond = 2, withCond = TRUE, useApply = FALSE)
E(Norm(mean=2), function(x){2*x^2})
E(as(Norm(mean=2),"AbscontDistribution"))
### somewhat less accurate:
E(as(Norm(mean=2),"AbscontDistribution"),
lowerTruncQuantil=1e-4,upperTruncQuantil=1e-4, IQR.fac= 4)
### even less accurate:
E(as(Norm(mean=2),"AbscontDistribution"),
lowerTruncQuantil=1e-2,upperTruncQuantil=1e-2, IQR.fac= 4)
### no good idea, but just as an example:
E(as(Norm(mean=2),"AbscontDistribution"),
lowerTruncQuantil=1e-2,upperTruncQuantil=1e-2, IQR.fac= .1)
### truncation of integration range; see also m1df...
E(Norm(mean=2), low=2,upp=4)
E(Cauchy())
E(Cauchy(),upp=3,low=-2)
# some Lebesgue decomposed distribution
mymix <- UnivarLebDecDistribution(acPart = Norm(), discretePart = Binom(4,.4),
acWeight = 0.4)
E(mymix)
Run the code above in your browser using DataLab