| df.bhatta | R Documentation |
This function computes \insertCitebhattacharyya1988;textualWData density estimator given a sample and the corresponding biased function.
df.bhatta(
y,
w = function(y) {
ifelse(y >= 0, y, NA)
},
plot = TRUE,
...
)
y |
A numeric vector containing the biased sample. |
w |
A function representing the bias function to be used. It must be evaluable and positive in each point of the sample |
plot |
Logical indicating whether to plot the estimated density. Default is |
... |
Additional arguments to be passed to
|
bhattacharyya1988;textualWData density estimator is computed as follows:
\widehat{f}_{\mathrm{B}, h_{g}}(y)= \widehat{\mu}_w w(y)^{-1} \widehat{g}_{h_{g}}(y),
\quad \text{where} \quad \widehat{\mu}_w=n \left(\sum_{i=1}^{n} \frac{1}{w(Y_i)}\right)^{-1},
and \widehat{g}_{h_{g}}(y) is the kernel density estimate of the given data y using density function with main arguments bw and kernel.
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 |
# Rule of thumb
df.bhatta(shrub.data$Width, bw = "nrd0")
# Cross Validation
df.bhatta(shrub.data$Width, bw = "ucv")
# Sheather & Jones
bhata_sj <- df.bhatta(shrub.data$Width, bw = "SJ-ste")
# Rectangular kernel
df.bhatta(shrub.data$Width, bw = "nrd0", kernel = "epanechnikov")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.