Learn R Programming

probhat (version 0.3.1)

22_discrete_kernel_smoothing: Discrete Kernel Smoothing Models

Description

Fit probability distributions, via discrete kernel smoothing over integer-indexed frequency data.

Usage

pmfuv.dks (x, h, …,
    bw.method="ph.default",
    kernel=binomial.dkernel,
    bounded = c (TRUE, FALSE), freq=FALSE,
    lower, upper,
    bw, smoothness=1)

cdfuv.dks (x, h, …, bw.method="ph.default", kernel=binomial.dkernel, bounded = c (TRUE, FALSE), lower, upper, bw, smoothness=1)

qfuv.dks (x, h, …, bw.method="ph.default", kernel=binomial.dkernel, bounded = c (TRUE, FALSE), lower, upper, bw, smoothness=1)

Arguments

x

Integer vector of integer-indexed bins. Also, can be a single-column integer matrix, preferably with a column (variable) name, and optionally with row (bin) names. In principle, this is required. (It can be omitted if h supplied, but generates a warning).

h

Optional numeric vector of frequencies (or weights), which can be fractional. Defaults to a vector of ones.

bw.method

String, the bandwidth selection method. Refer to Bandwidth Selection.

kernel

Constructor for a dkernel (discrete kernel) object.

bounded

Logical vector of length one or two, determining whether the probability distribution is lower or upper bounded.

freq

Logical, if true, the resulting function object returns frequencies, by default.

bw, smoothness

Integer and numeric values, the bandwidth and smoothness parameters, respectively. The bandwidth parameter should be a positive odd number. (Even numbers are incremented). If the bandwidth is missing, it's computed using bw.method (see above) and the smoothness.

lower, upper

Optional integers, the lower and upper truncation values. They default to the lowest and highest bin values. Note that x (the bin values) must not be outside the truncation values. If so, and error is produced. Ignored, unless the corresponding bounded values are true.

Ignored.

Value

Self-referencing function objects.

Refer to Mockup Function Objects

Details

Refer to the vignette for more information.

Note that if x has non-unique values, then duplicated x (and their h) values are aggregated. And currently, any row names will be ignored.

References

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

See Also

Discrete Kernels

Succinct Constructors Continuous Kernel Smoothing, Categorical Distributions, Empirical-Like Distributions

is.dks, print.phmodel, plot.dksuv

Bandwidth Selection

Examples

Run this code
# NOT RUN {
ph.data.prep ()

dFht <- qfuv.dks (traffic.bins, traffic.freq, lower=0)
dFht (0.5)
# }

Run the code above in your browser using DataLab