bw_IMSE: Internal function.

View source: R/lpbwdensity_fn.R

bw_IMSER Documentation

Internal function.

Description

Calculates integrated MSE-optimal bandwidth.

Usage

bw_IMSE(
  data,
  grid,
  p,
  v,
  kernel,
  Cweights,
  Pweights,
  massPoints,
  stdVar,
  regularize,
  nLocalMin,
  nUniqueMin
)

Arguments

data

Numeric vector, the data.

grid

Numeric vector, the evaluation points.

p

Integer, polynomial order.

v

Integer, order of derivative.

kernel

String, the kernel.

Cweights

Numeric vector, the counterfactual weights.

Pweights

Numeric vector, the survey sampling weights.

massPoints

Boolean, whether whether point estimates and standard errors should be corrected if there are mass points in the data.

stdVar

Boolean, whether the data should be standardized for bandwidth selection.

regularize

Boolean, Whether the bandwidth should be regularized.

nLocalMin

Nonnegative integer, minimum number of observations in each local neighborhood.

nUniqueMin

Nonnegative integer, minimum number of unique observations in each local neighborhood.

Value

Scalar: a single bandwidth.


lpdensity documentation built on Jan. 22, 2023, 1:39 a.m.