f.kde: Kernel Density f-Estimator

View source: R/f_kde.R

f.kdeR Documentation

Kernel Density f-Estimator

Description

An implementation of the f-estimator from "Nonparametric empirical Bayes and compound decision approaches to estimation of a high-dimensional vector of normal means" (Brown and Greenshtein, 2009) for estimating the mean of a homoscedastic sequence of independent Gaussian observations under squared error loss. The various small modifications and default parameters that are suggested in their paper are implemented.

Usage

f.kde(x, s, bw = s/sqrt(log(length(x))), Cn = s * sqrt(3 * log(length(x))))

Arguments

x

Gaussian sequence

s

standard deviation

bw

scalar bandwidth for Gaussian kernel density estimate

Cn

scalar threshold for to clip estimates in low-density areas (Inf for no thresholding)

Value

theta_hat

estimated values of means of Gaussian sequence

Examples

theta = rnorm(250)
x = theta + rnorm(250)
res = f.kde(x, s = 1)
mean((theta - res$theta_hat)^2)

barbehenna/coleReg documentation built on May 8, 2022, 12:05 a.m.