View source: R/discrete_kernel.r
discrete_kernel | R Documentation |
Discrete kernel function
discrete_kernel(
kernel = c("optimal", "triang", "epanech", "binomial"),
x,
z,
h,
k = NULL
)
kernel |
the type of kernel. Currently supported kernels are limited to: "optimal", "triang", "epanech" and "binomial" |
x |
the target point at which the density is calculated |
z |
the vector of observations |
h |
the bandwidth (or smoothing parameter) |
k |
Optional: the integer (positive) parameter that defined the support of the kernel function (corresponds to parameter 'a' for triangular kernel). It is only used for optimal and triangular kernel |
Returns the value of the associated kernel function
discrete_optimal()
, discrete_triang()
, discrete_epanech()
,
discrete_binomial()
which this function wraps.
discrete_kernel(kernel = "optimal", x = 25, z = 1:50, h = 0.9, k = 20)
discrete_kernel(kernel = "triang", x = 25, z = 1:50, h = 10, k = 20)
discrete_kernel(kernel = "epanech", x = 25, z = 1:50, h = 20)
discrete_kernel(kernel = "binomial", x = 25, z = 1:50, h = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.