confint.lpdensity: Confint Method for Local Polynomial Density Estimation and...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/lpdensity_methods.R

Description

The confint method for local polynomial density objects.

Usage

1
2
## S3 method for class 'lpdensity'
confint(object, parm = NULL, level = NULL, ...)

Arguments

object

Class "lpdensity" object, obtained by calling lpdensity.

parm

Integer, indicating which parameters are to be given confidence intervals.

level

Numeric scalar between 0 and 1, the significance level for computing confidence intervals

...

Additional options, including (i) grid specifies a subset of grid points to display the bandwidth; (ii) gridIndex specifies the indices of grid points to display the bandwidth (this is the same as parm); (iii) alpha specifies the significance level (this is 1-level); (iv) CIuniform specifies whether displaying pointwise confidence intervals (FALSE, default) or the uniform confidence band (TRUE); (v) CIsimul specifies the number of simulations used to construct critical values (default is 2000).

Value

A matrix containing grid points and confidence interval end points using p- and q-th order local polynomials.

Author(s)

Matias D. Cattaneo, Princeton University. cattaneo@princeton.edu.

Michael Jansson, University of California Berkeley. mjansson@econ.berkeley.edu.

Xinwei Ma (maintainer), University of California San Diego. x1ma@ucsd.edu.

See Also

lpdensity for local polynomial density estimation.

Supported methods: coef.lpdensity, confint.lpdensity, plot.lpdensity, print.lpdensity, summary.lpdensity, vcov.lpdensity.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Generate a random sample
set.seed(42); X <- rnorm(2000)

# Estimate density and report 95% confidence intervals
est1 <- lpdensity(data = X, bwselect = "imse-dpi")
confint(est1)

# Report results for a subset of grid points
confint(est1, parm=est1$Estimate[4:10, "grid"])
confint(est1, grid=est1$Estimate[4:10, "grid"])
confint(est1, gridIndex=4:10)

# Report the 99% uniform confidence band
# Fix the seed for simulating critical values
set.seed(42); confint(est1, level=0.99, CIuniform=TRUE)
set.seed(42); confint(est1, alpha=0.01, CIuniform=TRUE)

lpdensity documentation built on March 3, 2021, 1:11 a.m.