| cdf.bd | R Documentation |
This function computes \insertCitebose2022;textualWData kernel distribution estimator given a sample and the corresponding biased function.
cdf.bd(
y,
w = function(y) {
ifelse(y >= 0, y, NA)
},
y.seq,
bw = "bw.F.SBC.rt",
kernel = c("gaussian", "epanechnikov", "rectangular", "triangular", "biweight",
"cosine", "optcosine"),
from,
to,
nb = 512L,
plot = TRUE,
correction = c("none", "left", "right", "both"),
...
)
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 distribution is estimated. Alternatively, |
bw |
The bandwidth to be used in the distribution 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 estimation. Default is |
correction |
A character string specifying the boundary correction to be applied. Options are "none", "left", "right" and "both". Default is "none". |
... |
Additional arguments to be passed to bandwidth selection functions. |
bose2022;textualWData kernel distribution estimator is expressed as
\widehat{F}_{h_{F}}(y) = \frac{\widehat{\mu}_w}{n} \sum_{i=1}^n \frac{1}{w(Y_i)} W_{h_{F}}\left(y-Y_i\right),
\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, W is the kernel distribution function and W_{h_{F}}(u) = W(u/{h_{F}}).
\insertCitebose2022;textualWData propose a truncation correction for variables with compact support [a,b] for the estimator as follows:
\widehat{F}_{[a,b], h_{F}}(y)=\left\{
\begin{array}{ll}
0, & y<a \\
\dfrac{\widehat{F}_{h_{F}}(y)-\widehat{F}_{h_{F}}(a)}{\widehat{F}_{h_{F}}(b)-\widehat{F}_{h_{F}}(a)}, & a \leq y<b \\
1, & y \geq b.
\end{array}
\right.
The truncation correction is also valid for variables supported on [a, +\infty) or (-\infty, b], replacing \widehat{F}_{h_{F}}(b) by 1 or \widehat{F}_{h_{F}}(a) by 0, respectively, in the above expression. This correction is implemented in the correction argument, which can take values "none", "left", "right" or "both". If "left", the estimator is corrected to 0 for values less than the minimum of y.seq; if "right", it is corrected to 1 for values greater than the maximum of y.seq; if "both", it applies both corrections simultaneously.
A list with the following components:
y.seq |
The points where the distribution is estimated. |
F.hat |
The estimated distribution 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.SBC.rt, bw.F.BD, bw.F.SBC.cv, bw.F.SBC.pi
cdf.bd(shrub.data$Width, kernel = "epanechnikov")
cdf.bd(shrub.data$Width, bw = "bw.F.SBC.cv")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.