| make_kernel | R Documentation |
'make_kernel()' turns a kernel density function into the object used by
[qdf_kernel()], [qdf_kernel_corrected()], [qdf_jones()], [qdf_soni()] and
[qdf()] (argument 'kernel'). The distribution function needed by the
boundary-corrected and Soni estimators is computed numerically.
'check_kernel()' reports the properties that matter for these estimators:
total mass, symmetry, support, order (the first non-vanishing moment),
\int k^2 and whether the kernel takes negative values; it warns when a
property required by the theory fails.
make_kernel(k, name = "custom", support = 1, n_grid = 20001L)
check_kernel(kernel, verbose = TRUE)
k |
a vectorised function, the kernel density. |
name |
a label. |
support |
half-width of an interval |
n_grid |
number of grid points for the numerical integration. |
kernel |
a kernel name, a function, or an object from 'make_kernel()'. |
verbose |
print the report. |
'make_kernel()': an object of class '"qdf_kernel"' (a list with the density 'd', the distribution function 'p', 'name' and the 'check' results). 'check_kernel()': a list of properties, printed invisibly.
# the biweight (quartic) kernel
biweight <- make_kernel(function(u) 15 / 16 * (1 - u^2)^2 * (abs(u) <= 1), "biweight")
biweight
x <- rgamma(100, 5)
qdf_kernel(c(0.25, 0.5, 0.75), x, h = 0.05, kernel = biweight)
check_kernel("epanechnikov")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.