| df.jones | R Documentation |
This function computes \insertCitejones1991;textualWData kernel density estimator given a sample and the corresponding biased function.
df.jones(
y,
w = function(y) {
ifelse(y >= 0, y, NA)
},
y.seq,
bw = "bw.f.BGM.rt",
kernel = c("gaussian", "epanechnikov", "rectangular", "triangular", "biweight",
"cosine", "optcosine"),
from,
to,
nb = 512L,
plot = TRUE,
...
)
y |
A numeric vector containing the biased sample. |
w |
A function representing the bias function applied to the data points.
It must be evaluable and positive in each point of the sample |
y.seq |
A numeric vector specifying the points where the density is estimated. Alternatively, |
bw |
The smoothing bandwidth to be used in the density estimation. |
kernel |
A character string specifying the kernel function. Available options: |
from |
Numeric value specifying the lower bound of the grid where the estimator is computed when |
to |
Numeric value specifying the upper bound of the grid where the estimator is computed when |
nb |
An integer specifying the number of points at which the estimator is computed when |
plot |
A logical value indicating whether to plot the density estimation. Default is |
... |
Additional arguments to be passed to bandwidth selection functions. |
jones1991;textualWData kernel density estimator is expressed as
\widehat{f}_{\mathrm{J}, h_{f}}(y)=\frac{\widehat{\mu}_w}{n}\sum_{i=1}^{n} \frac{1}{w(Y_i)} K_{h_{f}}(y-Y_i),\quad
\text{where}\quad \widehat{\mu}_w=n \left(\sum_{i=1}^{n} \frac{1}{w(Y_i)}\right)^{-1},
h_{f} is the bandwidth, K is the kernel density function and K_{h_{f}}(u)=1/h_{f} K\left(u / h_{f}\right).
A list with the following components:
y.seq |
The points where the density is estimated. |
f.hat |
The estimated density values. |
bw |
The bandwidth value. |
n |
The sample size after removal of |
call |
The call which produced the result. |
has.na |
Logical; indicates whether the original vector |
bw.f.BGM.rt, bw.f.BGM.cv, bw.f.BGM.boot1 , bw.f.BGM.boot2
# Rule of thumb
df.jones(y = shrub.data$Width, kernel = "epanechnikov", bw = "bw.f.BGM.rt")
# Cross Validation
df.jones(y = shrub.data$Width, kernel = "epanechnikov", bw = "bw.f.BGM.cv")
# Bootstrap
df.jones(y = shrub.data$Width, kernel = "epanechnikov", bw = "bw.f.BGM.boot1", bw0 = "RT")
df.jones(y = shrub.data$Width, kernel = "epanechnikov", bw = "bw.f.BGM.boot1", bw0 = "PI")
df.jones(y = shrub.data$Width, kernel = "epanechnikov", bw = "bw.f.BGM.boot2", nh = 50L)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.