distrEx (version 2.2)

m1df: 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, ...)
## S3 method for class 'AbscontDistribution':
m1df(object, upper, 
             lowerTruncQuantile = getdistrExOption("m1dfLowerTruncQuantile"),
             rel.tol = getdistrExOption("m1dfRelativeTolerance"), ...)

Arguments

object
object of class "Distribution"
upper
clipping bound
rel.tol
relative tolerance for distrExIntegrate.
lowerTruncQuantile
lower quantile for quantile based integration range.
...
additional arguments to E

Value

  • The first moment of object clipped at upper is computed.

concept

  • functional
  • truncated moment
  • moment

Details

The precision of the computations can be controlled via certain global options; cf. distrExOptions.

See Also

distrExIntegrate, m2df, E

Examples

Run this code
# 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)

Run the code above in your browser using DataCamp Workspace