Learn R Programming

probhat (version 0.4.1)

00_kernels: Kernel Objects

Description

Discrete and continuous kernel objects.

NOTE THAT THEIR INTERNAL STRUCTURE (THAT IS, THEIR ATTRIBUTES/SLOTS), IS SUBJECT TO CHANGE.

Usage

discretized.kernel (n, ck=BIWEIGHT.CKERNEL, …, xlim)

UNIFORM.CKERNEL TRIANGULAR.CKERNEL EPANECHNIKOV.CKERNEL TRGAUSSIAN.CKERNEL BIWEIGHT.CKERNEL TRIWEIGHT.CKERNEL TRICUBE.CKERNEL

BELL.SPLINE

Arguments

n

Integer, number of bins. Needs to be positive and odd. Ignored, if xlim provided.

ck

A continuous kernel object.

xlim

A length two ascending integer vector.

Ignored.

Value

A Kernel object.

Details

Kernel objects are S4 objects with two slots representing the corresponding PMF/PDF and CDF.

Continuous kernels are predefined constants. Discrete kernels are constructed by using the discretized.kernel() function to discretize a predefined continuous kernel.

Currently, constructors for both DKS and CKS objects take a continuous kernel object. (Where the DKS constructors discretize it, internally).

Here, PDFs are symmetric about zero, and have positive density over the interval (-1, 1).

Currently, the truncated Gaussian kernel is symmetrically truncated (then transformed), such that the area from the untruncated distribution is 0.995. The bell spline is a novel kernel, constructed from a three-piece quadratic spline, with knots at -0.5 and 0.5.

Note that the plot_kernel_array function can be used to plot and compare multiple kernels.

References

Refer to the vignette for an overview, references and better examples.

See Also

ph.plotf.DKernel, ph.plotf.CKernel plot_kernel_array

DKS and CKS Models Conditional Distributions with Mixed Input Types

Examples

Run this code
# NOT RUN {
dk <- discretized.kernel (7)
plot (dk)

plot (BIWEIGHT.CKERNEL)
# }

Run the code above in your browser using DataLab