Learn R Programming

EpiNow2 (version 1.8.0)

stable_convolve: Numerically stable convolution function for two pmf vectors

Description

Unlike stats::convolve(), this function does not use the FFT algorithm, which can generate negative numbers when below machine precision.

Usage

stable_convolve(a, b)

Value

A numeric vector representing the convolution of a and b.

Arguments

a

Numeric vector, the first sequence.

b

Numeric vector, the second sequence.