diff --git a/R/lpcde/DESCRIPTION b/R/lpcde/DESCRIPTION index 4f14b3d..cc8cb83 100644 --- a/R/lpcde/DESCRIPTION +++ b/R/lpcde/DESCRIPTION @@ -14,7 +14,7 @@ Encoding: UTF-8 LazyData: false SystemRequirements: GNU make Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.2 +RoxygenNote: 7.3.2 Imports: Rcpp (>= 0.12.8), ggplot2, diff --git a/R/lpcde/R/lpcde_fns.R b/R/lpcde/R/lpcde_fns.R index 148b741..3ddc30a 100644 --- a/R/lpcde/R/lpcde_fns.R +++ b/R/lpcde/R/lpcde_fns.R @@ -32,9 +32,10 @@ lpcde_fn = function(y_data, x_data, y_grid, x, p, q, p_RBC, q_RBC, bw, mu, nu, my = mean(y_data) #y_data = (y_data - my)/sd_y #y_grid = (y_grid-my)/sd_y + d = ncol(x_data) x_data = sweep(x_data, 2, mx)/sd_x - x = as.matrix(x) - x = sweep(x, 2, mx)/sd_x + x = matrix(x, ncol=d) + x = sweep(x, MARGIN=2, STATS=matrix(mx, ncol=d))/sd_x # initializing output vectors est = matrix(0L, nrow = length(y_grid), ncol = 1) se = matrix(0L, nrow = length(y_grid), ncol = 1) @@ -52,7 +53,7 @@ lpcde_fn = function(y_data, x_data, y_grid, x, p, q, p_RBC, q_RBC, bw, mu, nu, mu=mu, nu=nu, h=bw, kernel_type=kernel_type) covMat = covmat$cov c_flag = covmat$singular_flag - se = sqrt(abs(diag(covMat)))*sd_y*sd_x + se = sqrt(abs(diag(covMat)))*sd_y*mean(sd_x) if (rbc){ est_rbc = matrix(0L, nrow = length(y_grid), ncol = 1) @@ -80,7 +81,7 @@ lpcde_fn = function(y_data, x_data, y_grid, x, p, q, p_RBC, q_RBC, bw, mu, nu, kernel_type=kernel_type) covMat_rbc = covmat_rbc$cov c_rbc_flag = covmat_rbc$singular_flag - se_rbc = sqrt(abs(diag(covMat_rbc)))*sd_y*sd_x + se_rbc = sqrt(abs(diag(covMat_rbc)))*sd_y*mean(sd_x) } # with rbc results diff --git a/R/lpcde/man/lpbwcde.Rd b/R/lpcde/man/lpbwcde.Rd index 19a7319..2dc3292 100644 --- a/R/lpcde/man/lpbwcde.Rd +++ b/R/lpcde/man/lpbwcde.Rd @@ -63,7 +63,7 @@ bandwidth selected for each grid point)} } \description{ \code{\link{lpbwcde}} implements the bandwidth selection methods for local -polynomial based conditionaldensity (and derivatives) estimation proposed and studied +polynomial based conditional density (and derivatives) estimation proposed and studied in \insertCite{bernoulli}{lpcde}. Companion command: \code{\link{lpcde}} for estimation and robust bias-corrected inference. diff --git a/todo.org b/todo.org index f84179f..457328e 100644 --- a/todo.org +++ b/todo.org @@ -9,7 +9,8 @@ ** TODO add more unit tests *** TODO checking integrates to 1 *** TODO checking non-negativity -** TODO ggplot deprecated warnings +** DONE ggplot deprecated warnings +** DONE multivariate warning ** DONE add missing doi ** DONE fix main paper reference ** DONE spelling mistake on pg 2