Takes a matrix of data points and returns the bandwidths used for estimating the local Gaussian correlations.
bw_select(x, bw_method = "plugin", est_method = "1par",
plugin_constant_marginal = 1.75, plugin_exponent_marginal = -1/5,
plugin_constant_joint = 1.75, plugin_exponent_joint = -1/6,
tol_marginal = 10^(-3), tol_joint = 10^(-3))
A matrix or data frame with data, one column per variable, one row per observation.
The method used for bandwidth selection. Must be either
"cv"
(cross-validation, slow, but accurate) or "plugin"
(fast, but crude).
The estimation method, must be either "1par", "5par" or
"5par_marginals_fixed", see lg_main
.
The constant c
in cn^a
used for
finding the plugin bandwidth for locally Gaussian marginal density
estimates, which we need if estimation method is "5par_marginals_fixed".
The constant a
in cn^a
used for
finding the plugin bandwidth for locally Gaussian marginal density
estimates, which we need if estimation method is "5par_marginals_fixed".
The constant c
in cn^a
used for
finding the plugin bandwidth for estimating the pairwise local Gaussian
correlation between two variables.
The constant a
in cn^a
used for
finding the plugin bandwidth for estimating the pairwise local Gaussian
correlation between two variables.
The absolute tolerance in the optimization for finding the marginal bandwidths when using cross validation.
The absolute tolerance in the optimization for finding the joint bandwidths when using cross-validation.
A list with three elements, marginal
contains the bandwidths
used for the marginal locally Gaussian estimation,
marginal_convergence
contains the convergence flags for the marginal
bandwidths, as returned by the optim
function, and joint
contains the pairwise bandwidths and convergence flags.
This is the main bandwidth selection function within the framework of locally
Gaussian distributions as described in Otneim and Tj<U+00F8>stheim (2017). This
function takes in a data set of arbitrary dimension, and calculates the
bandwidths needed to find the pairwise local Gaussian correlations, and
is mainly used by the main lg_main
wrapper function.
Otneim, H<U+00E5>kon, and Dag Tj<U+00F8>stheim. "The locally gaussian density estimator for multivariate data." Statistics and Computing 27, no. 6 (2017): 1595-1616.
# NOT RUN {
x <- cbind(rnorm(100), rnorm(100), rnorm(100))
bw <- bw_select(x)
# }
Run the code above in your browser using DataLab