kedd-lowlevel: Low-Level C++ Routines

kedd-lowlevelR Documentation

Low-Level C++ Routines

Description

Compiled (Rcpp/OpenMP) routines used by the user-level functions. They do not validate their arguments: kernel must be a canonical kernel name (as returned in the kernel slot of kedd objects, e.g. "biweight" or "pow(2,3)") and x must be free of NA. Most users should call h.ucv, kernel.fun, dkde, ... instead.

Usage

Cpp_kernel_constants(kernel, deriv_order)
Cpp_hos(kernel, deriv_order, n)
Cpp_kernel_deriv(kernel, u, deriv_order, nthreads = 0L)
Cpp_kernel_conv(kernel, u, deriv_order, nthreads = 0L)
Cpp_h_ucv(R_h, R_kernel, R_r, R_x, nthreads)
Cpp_h_bcv_1(R_h, R_kernel, R_r, R_x, nthreads)
Cpp_h_bcv_2(R_h, R_kernel, R_r, R_x, nthreads)
Cpp_h_ccv(R_h, R_kernel, R_r, R_x, nthreads)
Cpp_h_mcv(R_h, R_kernel, R_r, R_x, nthreads)
Cpp_h_tcv(R_h, R_kernel, R_r, R_x, nthreads)
Cpp_h_scv(R_h, R_g, R_kernel, R_r, R_x, nthreads)
Cpp_plot_cv(method, h_sexp, kernel, r, x, nthreads = 0L)
Cpp_conv2conv(t, deriv_order1, deriv_order2, kernel1, kernel2, nthreads)
Cpp_omp_threads(nthreads = 0L)

Arguments

kernel, R_kernel, kernel1, kernel2

canonical kernel name.

deriv_order, R_r, r, deriv_order1, deriv_order2

derivative order(s).

n

sample size.

u

numeric vector or matrix of evaluation points.

R_h

bandwidth at which the criterion is evaluated.

R_g

pilot bandwidth (SCV).

R_x, x

numeric data vector.

nthreads

number of OpenMP threads for this call: 0 = all processors, k > 0 = k threads; both capped by the environment variable OMP_THREAD_LIMIT. The setting applies to the call only and never changes later calls.

method

one of "UCV", "BCV1", "BCV2", "CCV", "MCV", "TCV", "SCV".

h_sexp

numeric vector or matrix of bandwidths.

t

numeric vector or matrix of evaluation points.

Value

Cpp_kernel_constants

named vector: c (normalising constant of a "pow(s,t)" kernel, NA otherwise), mu2 =\int x^2K, mu4 =\int x^4K and R =\int (K^{(r)})^2.

Cpp_hos

over-smoothing bandwidth for unit variance.

Cpp_kernel_deriv, Cpp_kernel_conv

K^{(r)}(u) and (K^{(r)} * K^{(r)})(u), with the shape of u.

Cpp_h_*

value of the criterion at R_h.

Cpp_plot_cv

criterion method at each bandwidth, with the shape of h_sexp.

Cpp_omp_threads

number of threads a parallel region actually uses for this nthreads (1 when the package was built without OpenMP).

Cpp_conv2conv

(K_1^{(r_1)} * K_1^{(r_1)}) * (K_2^{(r_2)} * K_2^{(r_2)}) at t by numerical integration.

See Also

kedd-package

Examples

Cpp_kernel_constants("biweight", 0L)
Cpp_kernel_deriv("pow(2,3)", c(-0.5, 0, 0.5), 1L)
x <- rnorm(100)
Cpp_h_ucv(0.4, "gaussian", 0L, x, 1L)
Cpp_omp_threads(0L)   # threads used by nthreads = 0 (all cores)
Cpp_omp_threads(2L)

kedd documentation built on Nov. 12, 2026, 5:10 p.m.