Skip to content

Commit

Permalink
added references to package documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rajitachandak committed Mar 19, 2024
1 parent 503ecb1 commit f27eeab
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 6 deletions.
5 changes: 4 additions & 1 deletion R/lpcde/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Authors@R: person(given = "Rajita",
role = c("aut", "cre"),
email = "rchandak@princeton.edu" )
Maintainer: Rajita Chandak <rchandak@princeton.edu>
Description: Tools for estimation and inference of conditional densities, derivatives and functions. This is the companion software for Cattaneo, Chandak, Jansson and Ma (2024).
Description: Tools for estimation and inference of conditional densities, derivatives and functions. This is the companion software for Cattaneo, Chandak, Jansson and Ma (2024) <arxiv:2204.10359>.
Depends: R (>= 3.3.0)
License: GPL-2
Encoding: UTF-8
Expand All @@ -23,7 +23,10 @@ Imports:
mvtnorm,
combinat,
Matrix,
Rdpack,
stats
RdMacros:
Rdpack
LinkingTo:
Rcpp,
RcppArmadillo
Expand Down
1 change: 1 addition & 0 deletions R/lpcde/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export(lpbwcde)
export(lpcde)
export(poly_base)
importFrom(Rcpp,evalCpp)
importFrom(Rdpack,reprompt)
useDynLib(lpcde, .registration = TRUE)
7 changes: 5 additions & 2 deletions R/lpcde/R/lpbwcde.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#'
#' @description \code{\link{lpbwcde}} implements the bandwidth selection methods for local
#' polynomial based conditionaldensity (and derivatives) estimation proposed and studied
#' in Cattaneo, Chandak, Jansson and Ma (2021).
#' in \insertCite{bernoulli}{lpcde}.
#'
#' Companion command: \code{\link{lpcde}} for estimation and robust bias-corrected inference.
#'
Expand Down Expand Up @@ -66,6 +66,9 @@
#' # Display bandwidths for a subset of y_grid points
#' summary(bw1, y_grid=bw1$BW[2:5, "y_grid"])
#'
#' @references
#' \insertRef{bernoulli}{lpcde}
#'
#' @export
#'
lpbwcde <- function(y_data, x_data, x, y_grid=NULL, p=NULL, q=NULL, grid_spacing="", ng=NULL,
Expand Down Expand Up @@ -279,7 +282,7 @@ lpbwcde <- function(y_data, x_data, x, y_grid=NULL, p=NULL, q=NULL, grid_spacing
data_min=min(y_data), data_max=max(y_data),
grid_min=min(y_grid), grid_max=max(y_grid)))

class(Result) <- c("lpbwcde", "lpcde")
class(Result) <- c("lpbwcde")

return (Result)
}
7 changes: 6 additions & 1 deletion R/lpcde/R/lpcde.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' @title Local Polynomial Conditional Density Estimation
#' @description \code{\link{lpcde}} implements the local polynomial regression based
#' conditional density (and derivatives). The estimator proposed in
#' Chandak, Cattaneo, Jansson and Ma.
#' \insertCite{bernoulli}{lpcde}.
#' Robust bias-corrected inference methods, both pointwise (confidence intervals) and
#' uniform (confidence bands), are also implemented.
#' @param x_data Numeric matrix/data frame, the raw data of covariates.
Expand Down Expand Up @@ -89,6 +89,11 @@
#' \code{\link{plot.lpcde}}, \code{\link{print.lpcde}},
#' \code{\link{summary.lpcde}}, \code{\link{vcov.lpcde}}
#'
#' @references
#' \insertRef{bernoulli}{lpcde}\cr
#' \insertRef{JASA}{lpcde}\cr
#' \insertRef{rbc}{lpcde}\cr
#' \insertRef{lpdensitypaper}{lpcde}
#' @export
lpcde = function(x_data, y_data, y_grid=NULL, x=NULL, bw=NULL, p=NULL, q=NULL,
p_RBC=NULL, q_RBC=NULL, mu=NULL, nu=NULL, rbc = TRUE, ng=NULL,
Expand Down
1 change: 1 addition & 0 deletions R/lpcde/R/lpcde_fns.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# choose from "ustat" and "asymp".
#' @return conditional density estimate at all grid points.
#' @keywords internal
#' @importFrom Rdpack reprompt
lpcde_fn = function(y_data, x_data, y_grid, x, p, q, p_RBC, q_RBC, bw, mu, nu,
kernel_type, rbc = FALSE){
sd_y = stats::sd(y_data)
Expand Down
39 changes: 39 additions & 0 deletions R/lpcde/inst/references.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@article{bernoulli,
title={Local Polynomial Conditional Density Estimators},
author={Cattaneo, Matias D. and Chandak, Rajita and Jansson, Michael and Ma, Xinwei},
journal={Bernoulli},
volume={}, number={}, pages={}, year={2024}
}

@article{JASA,
author = {Calonico, Sebastian and Matias D. Cattaneo and
Max H. Farrell},
journal = {Journal of the American Statistical Association},
number = {522},
pages = {767--779},
title = {On the Effect of Bias Estimation on Coverage Accuracy
in Nonparametric Inference},
volume = {113},
year = {2018},
}

@article{rbc,
author = {Calonico, Sebastian and Matias D. Cattaneo and
Max H. Farrell},
journal = {Bernoulli},
number = {4},
pages = {2998--3022},
title = {Coverage Error Optimal Confidence Intervals for Local
Polynomial Regression},
volume = {28},
year = {2022},
}

@article{lpdensitypaper,
title={Simple local polynomial density estimators},
author={Cattaneo, Matias D and Jansson, Michael and Ma, Xinwei},
journal={J. Amer. Statist. Assoc.},
volume={115}, number={531}, pages={1449--1455}, year={2020}
}


5 changes: 4 additions & 1 deletion R/lpcde/man/lpbwcde.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion R/lpcde/man/lpcde.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified R/lpcde_0.1.2.pdf
Binary file not shown.

0 comments on commit f27eeab

Please sign in to comment.