select_fpa_density: Cross-validated choice of the wavelet resolution level and...

View source: R/fpa_density.R

select_fpa_densityR Documentation

Cross-validated choice of the wavelet resolution level and bandwidth

Description

Chooses 'j0' (and 'h' for '"wavelet_ll"') by 'folds'-fold cross-validation on the bids: the first stage and the unit map are fitted on the training bids and applied to the held-out bids, and the second-stage density \hat f_{-k} is scored on the held-out pseudo-values by one of two criteria: * '"lscv"' (default): least-squares cross-validation (Rudemo 1982; Bowman 1984), \sum_k \{ \int \hat f_{-k}^2 - 2\,\bar{\hat f}_{-k}(\text{held-out}) \}, an unbiased estimate of the integrated squared error up to a constant, so that the selected pair targets MISE; * '"loglik"': the held-out log-likelihood \sum_k \sum_i \log \hat f_{-k}(\hat v_i), which targets Kullback–Leibler divergence. Because the held-out points are pseudo-values carrying first-stage error, this criterion tends to favour the smallest bandwidth on the grid; it is kept for comparison.

Both criteria are evaluated on the interior [\delta, 1-\delta] of the unit interval ('trim'): pseudo-values that fall outside [0,1] are projected onto the boundary (Algorithm 1 of the paper), which creates a spurious point mass there that a small bandwidth reproduces; excluding a boundary strip from the score removes this artefact, in the spirit of the boundary trimming of Guerre, Perrigne and Vuong (2000). For '"lscv"' the trimmed criterion is \int_\delta^{1-\delta}\hat f^2 - 2 n_k^{-1}\sum_{\hat v_i \in [\delta,1-\delta]} \hat f(\hat v_i), an unbiased estimate of the ISE over the interior up to a constant.

The returned score is oriented so that larger is better in both cases ('-LSCV' for '"lscv"').

Usage

select_fpa_density(
  bids,
  n,
  method = "wavelet_ll",
  first_stage = "gpv_hh",
  j0_grid = 3:6,
  h_grid = c(0.03, 0.05, 0.08, 0.12, 0.2, 0.3, 0.5),
  folds = 5L,
  criterion = c("lscv", "loglik"),
  scale = "auto",
  filter = "db3",
  dwt_filter = "coif1",
  levels = 3L,
  kernel = "triweight",
  side = "lower",
  n_int = 2001L,
  trim = 0.05
)

Arguments

bids

pooled bids (vector) or an 'L' by 'n' matrix.

n

bidders per auction (from 'ncol(bids)' for a matrix).

method

second-stage estimator; see Description.

first_stage

'"gpv_hh"' (default), '"gpv"', an [fpa_values()] object, or the name of a [qdf()] method to use through [fpa_values()].

j0_grid, h_grid

candidate values.

folds

number of folds.

criterion

'"lscv"' or '"loglik"'.

scale

'"auto"', '"log"', '"minmax"' or '"none"'.

filter, dwt_filter, levels

wavelet settings; see [qdf_wavelet()].

kernel, side

kernel and correction side for [kde_hh()] (used in the '"gpv_hh"' first stage and the '"kde_hh"' second stage).

n_int

number of points for the numerical integral of \hat f^2.

trim

boundary strip excluded from the score on the unit scale (default 0.05; 0 scores the whole interval).

Value

a list with 'j0', 'h', 'criterion' and the matrix of summed scores 'll' (rows 'j0_grid', columns 'h_grid'; larger is better).

Reproducibility

Fold assignment (or bootstrap resampling) uses R's random number generator; call [set.seed()] beforehand to make results exactly reproducible.

References

Rudemo, M. (1982). Empirical choice of histograms and kernel density estimators. *Scandinavian Journal of Statistics*, 9, 65–78.

Bowman, A. W. (1984). An alternative method of cross-validation for the smoothing of density estimates. *Biometrika*, 71, 353–360.


qdfauction documentation built on Nov. 10, 2026, 5:07 p.m.