diff --git a/R/lpcde/R/lpcde.R b/R/lpcde/R/lpcde.R index d510269..11837bb 100644 --- a/R/lpcde/R/lpcde.R +++ b/R/lpcde/R/lpcde.R @@ -89,6 +89,17 @@ #' \code{\link{plot.lpcde}}, \code{\link{print.lpcde}}, #' \code{\link{summary.lpcde}}, \code{\link{vcov.lpcde}} #' +#' +#' @examples +#' #Density estimation example +#' n=500 +#' x_data = matrix(rnorm(n, mean=0, sd=1)) +#' y_data = matrix(rnorm(n, mean=x_data, sd=1)) +#' y_grid = seq(from=-1, to=1, length.out=5) +#' model1 = lpcde::lpcde(x_data=x_data, y_data=y_data, y_grid=y_grid, x=0, bw=0.5) +#' #summary of estimation +#' summary(model1) +#' #' @references #' \insertRef{bernoulli}{lpcde}\cr #' \insertRef{JASA}{lpcde}\cr diff --git a/R/lpcde/man/lpcde.Rd b/R/lpcde/man/lpcde.Rd index 7fd57f7..6113523 100644 --- a/R/lpcde/man/lpcde.Rd +++ b/R/lpcde/man/lpcde.Rd @@ -116,6 +116,17 @@ Sometimes the density point estimates may lie outside of the confidence intervals/bands, which can happen if the underlying distribution exhibits high curvature at some evaluation point(s). One possible solution in this case is to increase the polynomial order \code{p} or to employ a smaller bandwidth. +} +\examples{ +#Density estimation example +n=500 +x_data = matrix(rnorm(n, mean=0, sd=1)) +y_data = matrix(rnorm(n, mean=x_data, sd=1)) +y_grid = seq(from=-1, to=1, length.out=5) +model1 = lpcde::lpcde(x_data=x_data, y_data=y_data, y_grid=y_grid, x=0, bw=0.5) +#summary of estimation +summary(model1) + } \references{ \insertRef{bernoulli}{lpcde}\cr diff --git a/R/lpcde/tests/testthat/test-lpbwcde.R b/R/lpcde/tests/testthat/test-lpbwcde.R index 8cd3633..d66f831 100644 --- a/R/lpcde/tests/testthat/test-lpbwcde.R +++ b/R/lpcde/tests/testthat/test-lpbwcde.R @@ -12,9 +12,6 @@ test_that("lpbwcde default output", { coef(model1) expect_equal(model1$opt$ng, 19) - expect_error(vcov(model1), regexp="The vcov method does not support \"lpbwcde\" objects.") - expect_error(confint(model1), regexp="The confint method does not support \"lpbwcde\" objects.") - model1 = lpbwcde(x_data=x_data, y_data=y_data, x=0, bw_type = "mse-rot") expect_equal(model1$opt$bw_type, "mse-rot") model1 = lpbwcde(x_data=x_data, y_data=y_data, y_grid=y_grid, x=0, bw_type = "mse-dpi") diff --git a/R/lpcde_0.1.2.pdf b/R/lpcde_0.1.2.pdf index 824706c..bf2f3fa 100644 Binary files a/R/lpcde_0.1.2.pdf and b/R/lpcde_0.1.2.pdf differ