kerdec_dens2D: Bivariate Kernel Deconvolution Density Estimation

Description Usage Arguments Details Value Author(s)

Description

This function provides a bandwidth for kernel denvolvolution density estimator. This works for several deconvolution scenarios, specifically, when the error distribution is known, when a sample of pure errors is available instead and when a contaminated sample is available as panel data.

Usage

1
2
3
4
5
6
kerdec_dens2D(smp1, smp2, method = c("CV", "NR")[1], kernel = "flat",
  lower = NULL, upper = NULL, x_eval = NULL, h = NULL, h0 = NULL,
  error_smp1 = NULL, error_smp2 = NULL, error_dist = "None",
  error_scale_par1 = NULL, error_scale_par2 = NULL, resolution = 128,
  error_proc = "all", panel_proc = "keep_first",
  truncation_bound = NULL, bw_interval = NULL)

Arguments

smp1

First coordinate of the sample. It is either a vector of size n or a nxl matrix (for repeated observations; l per each individual).

smp2

Second coordinate of the sample. It is either a vector of size n or a nxl matrix (for repeated observations; l per each individual).

method

Method used to select the bandwidth. The currently available methods are "CV" (cross-validation) and "NR" (normal reference). Cross-validation is the default.

kernel

Kernel whose Fourier transform has bounded support. There are currently 5 kernel programmed: "sinc", "triangular", "triw", "tric" and "flat". See vignette for further details and examples. Flat-top kernel is the default.

lower

Lower limit where the density will be evaluated.

upper

Upper limit where the density will be evaluated.

x_eval

Not yet activated. grid of values where the density will be evaluated. If it is given, parameters 'lower' and 'upper' will be omitted.

h

Bandwidth parameter which is only required if method = NULL.

h0

Optional argument used as initial value to look for the optimal value.

error_smp1

Optional vector with the first coordinate of errors. It is necessary to approximate the error distribution if it is unknown.

error_smp2

Optional vector with the second coordinate of errors. It is necessary to approximate the error distribution if it is unknown.

error_dist

Three possible values are accepted. c("Normal", "Laplace", "None").

error_scale_par1

Scale parameter matching the standard deviation of the first coordinate of the error. It is NULL by default and it is required if (and only if) error_dist is normal or Laplace and no sample of error is provided nor contaminated sample comes in panel structure.

error_scale_par2

Scale parameter matching the standard deviation of the second coordinate of the error. It is NULL by default and it is required if (and only if) error_dist is normal or Laplace and no sample of error is provided nor contaminated sample comes in panel structure.

resolution

Number of points to approximate integral in inversion formula, also to estimate the density (if grid was not given).

error_proc

This is required only for panel data structure. It refers to the way errors are processed. See process_differences for further details.

panel_proc

It defined what will be the contaminated sample (only) for panel data. "keep_first" will use the first column as sample while "take_aver" will take the average of contaminated samples per individual.

truncation_bound

It truncates the integrand in deconvolution formula when the denominator is smaller than this bound.

bw_interval

Do not modify it.

Details

See the vignette for more details.

Value

A list

Author(s)

Guillermo Basulto-Elias


gbasulto/kerdec documentation built on June 5, 2019, 10:58 a.m.