lindsey_density_estimate: Computes a density estimator by smoothing a histogram using...

View source: R/placebo-simulations.R

lindsey_density_estimateR Documentation

Computes a density estimator by smoothing a histogram using Poisson regression. Implementation of "Lindsey's method", as descrbied in Chapter 10 of "Computer age statistical inference: algorithms, evidence, and data science' by Bradley Efron and Trevor Hastie (2016).

Description

Computes a density estimator by smoothing a histogram using Poisson regression. Implementation of "Lindsey's method", as descrbied in Chapter 10 of "Computer age statistical inference: algorithms, evidence, and data science' by Bradley Efron and Trevor Hastie (2016).

Usage

lindsey_density_estimate(x, K, deg)

Arguments

x
  • one-dimensional vector of data;

K
  • number of bins in the histogram;

deg
  • degree of natural splines used in Poisson regression;

Value

a list with 2 fields, centers and density, which are K-dimensional vectors containing the bin centers and estimated density within each bin respectively.


synth-inference/synthdid documentation built on Jan. 26, 2024, 7:21 a.m.