20_discrete_kernel_smoothing: Discrete Kernel Smoothing Models

Description Usage Arguments Details Value References See Also Examples

Description

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

NOTE THAT THESE OBJECTS ARE LIKELY TO BE CONVERTED TO S4 OBJECTS, IN THE NEAR FUTURE.
ALSO, NOTE THAT THEIR INTERNAL STRUCTURE (THAT IS, THEIR ATTRIBUTES/SLOTS), IS SUBJECT TO CHANGE.

IN PRINCIPLE, YOU SHOULD NOT ACCESS ATTRIBUTES/SLOTS, DIRECTLY.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
pmfuv.dks (x = 1:length (h), h=1, ...,
    bw, smoothness=1,
    kernel=BIWEIGHT.CKERNEL,
    bw.method="ph.default",
    Xlim = c (a, b),
    a = min1 (x), b=Inf)

cdfuv.dks (x = 1:length (h), h=1, ...,
    bw, smoothness=1,
    kernel=BIWEIGHT.CKERNEL,
    bw.method="ph.default", tail="lower",
    Xlim = c (a, b),
    a = min1 (x), b=Inf)

qfuv.dks (x = 1:length (h), h=1, ...,
    bw, smoothness=1,
    kernel=BIWEIGHT.CKERNEL,
    bw.method="ph.default",
    Xlim = c (a, b),
    a = min1 (x), b=Inf)

Arguments

x

Integer vector of integer-indexed discrete observations, or bins of such observations.
(If duplicates, they, along with their frequencies, are aggregated).
Also, can be a single-column integer matrix, preferably with a column (variable) name, and optionally with row (bin) names.

Defaults to a sequence from one to the length of h.

h

Positive numeric vector of frequencies (or weights), which can be fractional.
(If scalar, it's recycled to match the length of pre-aggregate x).

Defaults to one, such that each x value represents a single discrete value.

bw

Odd positive integer value, giving the bandwidth parameter.
If missing, an initial bandwidth is computed via the the bandwidth method (see bw.method below), which is subject to the smoothness parameter.

smoothness

Positive numeric value, giving the relative bandwidth.
Ignored, if bw is provided.

kernel

A (continuous) kernel object.

bw.method

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

tail

String, either "lower" or "upper".
If lower (the default), lower tail probabilities, P (X <= x), are used.
If upper, upper tail probabilities, P (X >= x), are used.

Xlim

In principle, a length-two integer vector, giving the limits of X.
But a numeric vector is allowed, to support -Inf/Inf.

The corresponding random variable is regarded as bounded, if either limit is finite.
In which case, a truncated smoothing algorithm is applied.

a, b

In principle, integer values.
This is an alternative way of specifying Xlim, above.

The min1 function will return one, if one is the minimum x value, otherwise, it will return zero.

...

Additional arguments not allowed.

Details

PLEASE SET NOTES IN DESCRIPTION FIELD.

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.

Also note that the truncation method may change in future updates.

Value

Self-referencing function objects.

Refer to Runtime Function Objects

References

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

See Also

Kernels

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

is.dks, ph.printf.phmodel, ph.plotf.dksuv

Bandwidth Selection

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
prep.ph.data ()

dfh <- pmfuv.dks (traffic.bins, traffic.freq)
dFh <- cdfuv.dks (traffic.bins, traffic.freq)
dFht <- qfuv.dks (traffic.bins, traffic.freq)

plot (dfh)
plot (dfh, TRUE)
plot (dfh, freq=TRUE)
plot (dFh, freq=TRUE)

dFht (0.5)

probhat documentation built on May 12, 2021, 5:08 p.m.