Learn R Programming

updog (version 1.1.3)

convolve_up: Convolution between two discrete probability mass functions with support on 0:K.

Description

Convolution between two discrete probability mass functions with support on 0:K.

Usage

convolve_up(x, y)

Arguments

x

The first probability vector. The ith element is the probability of i - 1.

y

The second probability vector. The ith element is the probability of i - 1.

Value

A vector that is the convolution of x and y. The ith element is the probability of i - 1.

See Also

convolve for a more generic convolution function.

Examples

Run this code
# NOT RUN {
x <- c(1 / 6, 2 / 6, 3 / 6)
y <- c(1 / 9, 2 / 9, 6 / 9)
convolve_up(x, y)
stats::convolve(x, rev(y), type = "o")

# }

Run the code above in your browser using DataLab