Learn R Programming

convdistr (version 1.6.1)

CONVOLUTION: Make the convolution of two or more DISTRIBUTION objects

Description

The convolution of the simple algebraic operations is made by the operation of individual drawns of the distributions. The DISTRIBUTION objects must have the same dimensions.

Usage

new_CONVOLUTION(listdistr, op, omit_NA = FALSE)

new_SUM(..., omit_NA = FALSE)

# S3 method for DISTRIBUTION +(e1, e2)

new_SUBTRACTION(..., omit_NA = FALSE)

# S3 method for DISTRIBUTION -(e1, e2)

new_MULTIPLICATION(..., omit_NA = FALSE)

# S3 method for DISTRIBUTION *(e1, e2)

new_DIVISION(..., omit_NA = FALSE)

# S3 method for DISTRIBUTION /(e1, e2)

Value

and object of class CONVOLUTION, DISTRIBUTION

Arguments

listdistr

a list of DISTRIBUTION objects

op

a function to convolute `+`, `-`, `*`, `\`

omit_NA

if TRUE, NA distributions will be omitted

...

DISTRIBUTION objects or a list of distribution objects

e1

object of class DISTRIBUTION

e2

object of class DISTRIBUTION

Functions

  • new_SUM(): Sum of distributions

  • new_SUBTRACTION(): Subtraction for distributions

  • new_MULTIPLICATION(): Multiplication for distributions

  • new_DIVISION(): DIVISION for distributions

Author

John J. Aponte

Details

If any of the distributions is of class NA (NA_DISTRIBUTION) the result will be a new distribution of class NA unless the omit_NA option is set to TRUE

Examples

Run this code
x1 <- new_NORMAL(0,1)
x2 <- new_UNIFORM(1,2)
new_CONVOLUTION(list(x1,x2), `+`)
new_SUM(x1,x2)
x1 + x2
new_SUBTRACTION(x1,x2)
x1 - x2
new_MULTIPLICATION(list(x1,x2))
x1 * x2
new_DIVISION(list(x1,x2))
x1 / x2

Run the code above in your browser using DataLab