30_bandwidth_selection: Bandwidth Selection

Description Usage Arguments Details Value References See Also Examples

Description

Functions for bandwidth selection.

THESE FUNCTIONS SHOULD BE REGARDED AS SUB-OPTIMAL.

Usage

1
2
auto.dbw (x, ..., bw.method="ph.default", smoothness=1)
auto.cbw (x, ..., bw.method="ph.default", smoothness=1)

Arguments

x

A numeric vector, of data.

In the continuous case, x may also be a matrix.

bw.method

String, the initial bandwidth selection method.
Currently, "ph.default", "Scott" or "Silverman".
Refer to details.

smoothness

Numeric, smoothness (scaling) parameter.
Refer to details.

...

Ignored.

Details

THESE FUNCTIONS SHOULD BE REGARDED AS SUB-OPTIMAL.

These functions computes an initial bandwidth.
Then the initial bandwidth parameter is multiplied by the smoothness parameter.

In the discrete case (auto.dbw), this bandwidth is rounded up to the nearest odd integer.

Currently, there are three options:

(1) bw.method="ph.default".

For a single variable/column, the bandwidth is equal to the difference between the quantiles, marking the middle 0.66 of observations.
i.e. diff (quantile (x, c (0.17, 0.83) ) )

For m variables/columns, 0.66 is replaced with 0.66^(1 / m).

(2) bw.method="Scott", which calls stats::bw.nrd, for each variable/column.

(3) bw.method="Silverman", which call stats::bw.nrd0, for each variable/column.

Value

In the discrete case, a single integer.
In the continuous case, a numeric vector.

References

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

Also please refer to stats::bw.nrd and stats::bw.nrd0 for references, and more information.

See Also

bw.nrd, bw.nrd0

Discrete Kernel Smoothing, Continuous Kernel Smoothing

Examples

1
2
prep.ph.data ()
auto.cbw (trees2)

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