Functions to compute a binomial kernel.

binomial_kernel(vertical_radius, horizontal_radius = 0)

Arguments

vertical_radius

[numeric] The kernel's radius in the vertical dimension.

horizontal_radius

[numeric] The kernel's radius in the horizontal dimension.

Value

A matrix corresponding to the kernel.

Examples


binomial_kernel(vertical_radius = 2, horizontal_radius = 2)
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    1    4    6    4    1
#> [2,]    4   16   24   16    4
#> [3,]    6   24   36   24    6
#> [4,]    4   16   24   16    4
#> [5,]    1    4    6    4    1