| bw.F.BD | R Documentation |
This function implements the local bandwidth selector proposed by \insertCitebose2022;textualWData for their own kernel distribution estimator.
bw.F.BD(
y,
w = function(y) {
ifelse(y >= 0, y, NA)
},
y.seq,
cy.seq
)
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 |
y.seq |
A numeric vector containing the points on which the local bandwidth is estimated. |
cy.seq |
A numeric vector representing the constants to be used in the bandwidth estimation for each point of |
Local bandwidths selectors are estimated using the formula:
\widehat{h}_{F, \mathrm{BD}, C(y)} (y) = \frac{C(y) \widehat{\sigma}_{w}}{(n w(y))^{1/3}},
where C(y) is a positive parameter that depends on the point y and \widehat{\sigma}_{w} is an estimation of the standard deviation of the distribution given by
\widehat{\sigma}_w=\sqrt{\left(\frac{1}{n} \sum_{i=1}^n \frac{1}{w(Y_i)}\right)^{-1}
\left[\left(\frac{1}{n} \sum_{i=1}^n w(Y_i)\right)-\left(\frac{1}{n} \sum_{i=1}^n \frac{1}{w(Y_i)}\right)^{-1}\right]}.
The parameter C(y) is provided to the function by using the argument cy.seq, which is a vector of positive values that is used to compute the bandwidth for each point in y.seq. Alternatively, a single numeric value can be provided, which will be used for all points in the y.seq vector.
The simulations carried out by \insertCitebose2022;textualWData suggest that choosing C(y)=0.25 or C(y)=0.5 provides good results in the tail region of the distribution, with tails defined as points below the 5th percentile or above the 95th percentile. On the other hand, C(y)=1.3 provides good results for the remaining points.
If some bandwidths are not positive, they are replaced by the mean of the neighbors.
A numeric vector containing the bandwidths for each point in y.seq.
cdf.bd
bw.F.BD(shrub.data$Width, y.seq = seq(0, 1, length.out = 512), cy.seq = rep(1, 512))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.