m1df {distrEx} | R Documentation |
Generic Function for the Computation of Clipped First Moments
Description
Generic function for the computation of clipped first moments.
The moments are clipped at upper
.
Usage
m1df(object, upper, ...)
## S4 method for signature 'AbscontDistribution'
m1df(object, upper,
lowerTruncQuantile = getdistrExOption("m1dfLowerTruncQuantile"),
rel.tol = getdistrExOption("m1dfRelativeTolerance"), ...)
Arguments
object |
object of class |
upper |
clipping bound |
rel.tol |
relative tolerance for |
lowerTruncQuantile |
lower quantile for quantile based integration range. |
... |
additional arguments to |
Details
The precision of the computations can be controlled via
certain global options; cf. distrExOptions
.
Value
The first moment of object
clipped at upper
is computed.
Methods
- object = "UnivariateDistribution":
-
uses call
E(object, upp=upper, ...)
. - object = "AbscontDistribution":
clipped first moment for absolutely continuous univariate distributions which is computed using
integrate
.- object = "LatticeDistribution":
clipped first moment for discrete univariate distributions which is computed using
support
andsum
.- object = "AffLinDistribution":
clipped first moment for affine linear distributions which is computed on basis of slot
X0
.- object = "Binom":
clipped first moment for Binomial distributions which is computed using
pbinom
.- object = "Pois":
clipped first moment for Poisson distributions which is computed using
ppois
.- object = "Norm":
clipped first moment for normal distributions which is computed using
dnorm
andpnorm
.- object = "Exp":
clipped first moment for exponential distributions which is computed using
pexp
.- object = "Chisq":
clipped first moment for
\chi^2
distributions which is computed usingpchisq
.
Author(s)
Matthias Kohl Matthias.Kohl@stamats.de
See Also
Examples
# standard normal distribution
N1 <- Norm()
m1df(N1, 0)
# Poisson distribution
P1 <- Pois(lambda=2)
m1df(P1, 3)
m1df(P1, 3, fun = function(x)sin(x))
# absolutely continuous distribution
D1 <- Norm() + Exp() # convolution
m1df(D1, 2)
m1df(D1, Inf)
E(D1)