bw.pow | R Documentation |
Computes variable smoothing bandwidths intended to be proportional to the observed data values, raised to a given power.
bw.pow(X, h0, POW = 0.75, trim = 5, ...)
X |
Data for which bandwidths should be calculated. A numeric vector of positive values. |
h0 |
A scalar value giving the global smoothing bandwidth
in the same units as |
POW |
Numeric value. The exponent of the power transformation to
be applied to |
trim |
A trimming value required to curb excessively large bandwidths. See Details. The default is sensible in most cases. |
... |
Ignored. |
This function computes adaptive smoothing bandwidths
for the data values in X
.
Larger data values are assigned larger bandwidths.
Bandwidths are proportional to X^POW
.
The bandwidth at location u
is
h(u) = \mbox{\texttt{h0}}
* \mbox{min}[ \frac{u^{\mbox{\texttt{POW}}}}{\gamma}, \mbox{\texttt{trim}} ]
where \gamma
is the geometric mean of the values
u^{\mbox{\texttt{POW}}}
.
This allows the global bandwidth h0
to be considered on
the same scale as a corresponding fixed bandwidth.
A numeric vector of the same length as X
.
. Adapted by \adrian.
bw.abram
,
bw.nrd0
.
xx <- sort(rexp(10))
bb <- bw.pow(xx)
signif(rbind(xx, bb), 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.