Skip to content

Commit

Permalink
fixed test warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rajitachandak committed Oct 10, 2024
1 parent 2519ae0 commit 7278e44
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion R/lpcde/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions R/lpcde/R/lpcde_fns.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/lpcde/man/lpbwcde.Rd

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

3 changes: 2 additions & 1 deletion todo.org
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7278e44

Please sign in to comment.