# m2df

0th

Percentile

##### Generic function for the computation of clipped second moments

Generic function for the computation of clipped second moments. The moments are clipped at upper.

Keywords
methods, distribution
##### Usage
m2df(object, upper, ...)
# S4 method for AbscontDistribution
m2df(object, upper,
lowerTruncQuantile = getdistrExOption("m2dfLowerTruncQuantile"),
rel.tol = getdistrExOption("m2dfRelativeTolerance"), ...)
##### 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

##### Details

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

##### Value

The second moment of object clipped at upper is computed.

##### Methods

object = "UnivariateDistribution":

uses call E(object, upp=upper, fun = function, ...).

object = "AbscontDistribution":

clipped second moment for absolutely continuous univariate distributions which is computed using integrate.

object = "LatticeDistribution":

clipped second moment for discrete univariate distributions which is computed using support and sum.

object = "AffLinDistribution":

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

object = "Binom":

clipped second moment for Binomial distributions which is computed using pbinom.

object = "Pois":

clipped second moment for Poisson distributions which is computed using ppois.

object = "Norm":

clipped second moment for normal distributions which is computed using dnorm and pnorm.

object = "Exp":

clipped second moment for exponential distributions which is computed using pexp.

object = "Chisq":

clipped second moment for $\chi^2$ distributions which is computed using pchisq.

m2df-methods, E-methods

##### Aliases
• m2df
• m2df-methods
• m2df,UnivariateDistribution-method
• m2df,AbscontDistribution-method
• m2df,LatticeDistribution-method
• m2df,AffLinDistribution-method
• m2df,Binom-method
• m2df,Pois-method
• m2df,Norm-method
• m2df,Exp-method
• m2df,Chisq-method
##### Examples
# NOT RUN {
# standard normal distribution
N1 <- Norm()
m2df(N1, 0)

# Poisson distribution
P1 <- Pois(lambda=2)
m2df(P1, 3)
m2df(P1, 3, fun = function(x)sin(x))

# absolutely continuous distribution
D1 <- Norm() + Exp() # convolution
m2df(D1, 2)
m2df(D1, Inf)
E(D1, function(x){x^2})
# }

Documentation reproduced from package distrEx, version 2.8.0, License: LGPL-3

### Community examples

Looks like there are no examples yet.