Learn R Programming

distrEx (version 2.9.5)

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

Value

The first moment of object clipped at upper is computed.

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

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 and sum.

object = "AffLinDistribution":

clipped first moment for affine linear distributions which is computed on basis of slot X0.

% \item{object = "AbscontDistribution":}{ clipped first moment % for absolutely continuous univariate distributions which % is computed using \code{distrExIntegrate}. }

% \item{object = "DiscreteDistribution":}{ clipped first moment % for discrete univariate distributions which is computed % using \code{support} and \code{sum}. }

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 and pnorm.

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 using pchisq.

Author

Matthias Kohl Matthias.Kohl@stamats.de

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 DataLab