diff --git a/DESCRIPTION b/DESCRIPTION index a9ee5a1..e068b3a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,82 +2,82 @@ Package: WpProj Type: Package Title: Linear p-Wasserstein Projections Version: 0.2 -Date: 2024-01-09 +Date: 2024-01-18 Authors@R: - c( - person(given = "Eric", - family = "Dunipace", - email = "edunipace@mail.harvard.edu", - role = c("aut", "cre"), - comment = c(ORCID = "0000-0001-8909-213X")), - person(given = "Clemens", - family = "Schmid", - role = c("ctb"), - email = "clemens@nevrome.de", - comment = c(ORCID = "0000-0003-3448-5715", - "ETA progres bar is adapted from their code")), - person(given = "Espen", - family = "Bernton", - role = c("ctb"), - comment = "Hilbert sort adapted from their code"), - person(given = "Mathieu", - family = "Gerber", - role = c("ctb"), - comment = "Hilbert sort adapted from their code"), - person(given = "Pierre", - family = "Jacob", - role = c("ctb"), - comment = "Hilbert sort adapted from their code"), - person(given = "Bin", - family = "Dai", - email = "bdai@uwalumni.com", - role = c("ctb"), - comment = "W2 projections adapted from their OEM code"), - person(given = "Jared", - family = "Huling", - email = "jaredhuling@gmail.com", - role = c("ctb"), - comment = c(ORCID = "0000-0003-0670-4845","W2 projections adapted from their OEM code")), - person(given = "Yixuan", - family = "Qiu", - role = c("ctb"), - comment = "W2 projections adapted from their OEM code"), - person(given = "Dominic", - family = "Schuhmacher", - email = "dominic.schuhmacher@mathematik.uni-goettingen.de", - role = c("ctb"), - comment = "Shortsimplex optimal transport method adapted from their code"), - person(given = "Nicolas", - family = "Bonneel", - role = "ctb", - comment = "network simplex adapted from their code") - ) + c( + person(given = "Eric", + family = "Dunipace", + email = "edunipace@mail.harvard.edu", + role = c("aut", "cre"), + comment = c(ORCID = "0000-0001-8909-213X")), + person(given = "Clemens", + family = "Schmid", + role = c("ctb"), + email = "clemens@nevrome.de", + comment = c(ORCID = "0000-0003-3448-5715", + "ETA progres bar is adapted from their code")), + person(given = "Espen", + family = "Bernton", + role = c("ctb"), + comment = "'Hilbert Sort' adapted from their code"), + person(given = "Mathieu", + family = "Gerber", + role = c("ctb"), + comment = "'Hilbert Sort' adapted from their code"), + person(given = "Pierre", + family = "Jacob", + role = c("ctb"), + comment = "'Hilbert Sort' adapted from their code"), + person(given = "Bin", + family = "Dai", + email = "bdai@uwalumni.com", + role = c("ctb"), + comment = "W2 projections adapted from their 'OEM' code"), + person(given = "Jared", + family = "Huling", + email = "jaredhuling@gmail.com", + role = c("ctb"), + comment = c(ORCID = "0000-0003-0670-4845","W2 projections adapted from their 'OEM' code")), + person(given = "Yixuan", + family = "Qiu", + role = c("ctb"), + comment = "W2 projections adapted from their 'OEM' code"), + person(given = "Dominic", + family = "Schuhmacher", + email = "dominic.schuhmacher@mathematik.uni-goettingen.de", + role = c("ctb"), + comment = "'Shortsimplex 'optimal transport method adapted from their code"), + person(given = "Nicolas", + family = "Bonneel", + role = "ctb", + comment = "'Network Simplex' algorithm adapted from their code") + ) Description: Performs Wasserstein projections from the predictive distributions of any model into the space of predictive distributions of linear models. We utilize L1 penalties to also reduce the complexity of the model space. This package employs the methods as described in Dunipace, Eric and Lorenzo Trippa (2020) . License: GPL (==3.0) Depends: R (>= 4.0) Imports: - ggplot2, - ggsci, - ggridges, - glmnet, - oem, - Rcpp, - rlang, - ROI, - ROI.plugin.ecos, - ROI.plugin.lpsolve, - Matrix, - rqPen, - quantreg, - doParallel, - foreach, - doRNG, - dplyr, - stats, - magrittr, - methods, - slam, - lifecycle + ggplot2, + ggsci, + ggridges, + glmnet, + oem, + Rcpp, + rlang, + ROI, + ROI.plugin.ecos, + ROI.plugin.lpsolve, + Matrix, + rqPen, + quantreg, + doParallel, + foreach, + doRNG, + dplyr, + stats, + magrittr, + methods, + slam, + lifecycle LinkingTo: BH, Rcpp (>= 1.0.0), @@ -86,10 +86,10 @@ LinkingTo: RcppCGAL, RSpectra Suggests: - testthat (>= 2.1.0), - transport, - Rmosek, - spelling + testthat (>= 2.1.0), + transport, + Rmosek, + spelling RoxygenNote: 7.2.3 Roxygen: list(markdown = TRUE) Encoding: UTF-8 diff --git a/R/wasserstein_distance.R b/R/wasserstein_distance.R index 979c315..179642c 100644 --- a/R/wasserstein_distance.R +++ b/R/wasserstein_distance.R @@ -32,6 +32,10 @@ wasserstein <- function (X, Y, p = 2, ground_p = 2, observation.orientation = c( "hilbert", "rank", #"sinkhorn2", "univariate.approximation", "univariate.approximation.pwr","univariate"), ... ) { + # lifecycle::deprecate_soft(when = "0.2.0", + # what = "wasserstein()", + # details = "Please use the native function from the `approxOT` package") + obs <- match.arg(observation.orientation) method <- match.arg(method) diff --git a/man/WpProj-package.Rd b/man/WpProj-package.Rd index 3a45a6b..43a2954 100644 --- a/man/WpProj-package.Rd +++ b/man/WpProj-package.Rd @@ -14,14 +14,14 @@ Performs Wasserstein projections from the predictive distributions of any model Other contributors: \itemize{ \item Clemens Schmid \email{clemens@nevrome.de} (\href{https://orcid.org/0000-0003-3448-5715}{ORCID}) (ETA progres bar is adapted from their code) [contributor] - \item Espen Bernton (Hilbert sort adapted from their code) [contributor] - \item Mathieu Gerber (Hilbert sort adapted from their code) [contributor] - \item Pierre Jacob (Hilbert sort adapted from their code) [contributor] - \item Bin Dai \email{bdai@uwalumni.com} (W2 projections adapted from their OEM code) [contributor] - \item Jared Huling \email{jaredhuling@gmail.com} (\href{https://orcid.org/0000-0003-0670-4845}{ORCID}) (W2 projections adapted from their OEM code) [contributor] - \item Yixuan Qiu (W2 projections adapted from their OEM code) [contributor] - \item Dominic Schuhmacher \email{dominic.schuhmacher@mathematik.uni-goettingen.de} (Shortsimplex optimal transport method adapted from their code) [contributor] - \item Nicolas Bonneel (network simplex adapted from their code) [contributor] + \item Espen Bernton ('Hilbert Sort' adapted from their code) [contributor] + \item Mathieu Gerber ('Hilbert Sort' adapted from their code) [contributor] + \item Pierre Jacob ('Hilbert Sort' adapted from their code) [contributor] + \item Bin Dai \email{bdai@uwalumni.com} (W2 projections adapted from their 'OEM' code) [contributor] + \item Jared Huling \email{jaredhuling@gmail.com} (\href{https://orcid.org/0000-0003-0670-4845}{ORCID}) (W2 projections adapted from their 'OEM' code) [contributor] + \item Yixuan Qiu (W2 projections adapted from their 'OEM' code) [contributor] + \item Dominic Schuhmacher \email{dominic.schuhmacher@mathematik.uni-goettingen.de} ('Shortsimplex 'optimal transport method adapted from their code) [contributor] + \item Nicolas Bonneel ('Network Simplex' algorithm adapted from their code) [contributor] } } diff --git a/tests/testthat/test-WPL0.R b/tests/testthat/test-WPL0.R index 23f9cbe..ad4ca16 100644 --- a/tests/testthat/test-WPL0.R +++ b/tests/testthat/test-WPL0.R @@ -262,13 +262,13 @@ testthat::test_that("WPL0 with hilbert transport", { transp <- "hilbert" - l0 <- WPL0(X = x, Y = NULL, theta = post_beta, power = 2, + l0 <- WpProj:::WPL0(X = x, Y = NULL, theta = post_beta, power = 2, method = c("selection.variable"), transport.method = transp, epsilon = 0.05, OTmaxit = 100, parallel = NULL) - l0.1 <- WPL0(X = x, Y = NULL, theta = post_beta, power = 2, + l0.1 <- WpProj:::WPL0(X = x, Y = NULL, theta = post_beta, power = 2, method = c("projection"), transport.method = transp, epsilon = 0.05, OTmaxit = 100,