Discrete binomial kernel

discrete_binomial(x, z, h)

Arguments

x

the target point at which the density is calculated

z

the vector of observations

h

the bandwidth (or smoothing parameter) which should match the condition 0<= h < 1

Value

Returns the value of the associated kernel function according to the target x and the bandwidth h.

Examples

# Basic usage of discrete_binomial() to compute a Discrete Binomial Kernel
discrete_binomial(x = 25, z = 1:50, h = 0.5)
#>  [1] 3.209642e-42 2.046147e-39 8.348279e-37 2.448133e-34 5.493610e-32
#>  [6] 9.806094e-30 1.428888e-27 1.730741e-25 1.765355e-23 1.530563e-21
#> [11] 1.135400e-19 7.238172e-18 3.975427e-16 1.882648e-14 7.681206e-13
#> [16] 2.693223e-11 8.079668e-10 2.060315e-08 4.424256e-07 7.897298e-06
#> [21] 1.150749e-04 1.333823e-03 1.183043e-02 7.541898e-02 3.077094e-01
#> [26] 6.035839e-01 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [31] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [36] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [41] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
#> [46] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00