distrEx (version 1.9)

m2df: Generic function for the computation of clipped second moments

Description

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

Usage

m2df(object, upper)

Arguments

object
object of class "Distribution"
upper
clipping bound

Value

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

concept

  • moment
  • functional
  • truncated moment

Details

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

See Also

m2df-methods, E-methods

Examples

Run this code
# standard normal distribution
N1 <- Norm()
m2df(N1, 0)

# Poisson distribution
P1 <- Pois(lambda=2)
m2df(P1, 3)

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

Run the code above in your browser using DataCamp Workspace