Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exact Hamiltonian Monte Carlo for exponential sampling #142

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3ef71df
implmentation of exact hmc walk
TolisChal Mar 6, 2021
932e2ae
implementation of boundary oracles for the hpolytope
TolisChal Mar 6, 2021
be84adc
add fake boundary oracles for the other polytope representations
TolisChal Mar 6, 2021
855f2af
implement c++ interface for exponential sampling
TolisChal Mar 6, 2021
462d132
improve boundary oracles and fix bugs
TolisChal Mar 6, 2021
da09805
add root finder for the degree two polynomial
TolisChal Mar 7, 2021
040efa6
complete the root computation and the failure check
TolisChal Mar 7, 2021
8e36064
improve R documentation and resolve gcc compile error
TolisChal Mar 7, 2021
436a780
improve R documentation
TolisChal Mar 7, 2021
eb9dab8
resolve PR reviews
TolisChal Mar 9, 2021
d1e9acf
fix compile errors
TolisChal Mar 9, 2021
f1e362a
Merge branch 'develop' into hmc_exponential
TolisChal Mar 11, 2021
b982f13
merge develop branch
TolisChal Mar 11, 2021
9c7735a
add burn in methods in exact hmc
TolisChal Mar 11, 2021
434de2f
resolve the reviews on the root computation
TolisChal Mar 12, 2021
1ac29c9
improve definition of macro RVOLESTI
TolisChal Mar 13, 2021
de8b3e0
add an example to sample from exponential exact HMC
TolisChal Mar 13, 2021
3442f5a
remove RVOLESTI macro
TolisChal Mar 19, 2021
60ed2bd
declare tol variable as static
TolisChal Mar 19, 2021
dff0c43
fix bug in variable declaration
TolisChal Mar 19, 2021
93d0658
change tolerance variable declaration
TolisChal Mar 19, 2021
29dfc59
Merge branch 'develop' into hmc_exponential
TolisChal Mar 21, 2021
dc1a67d
set upper bound for the number of relfections
TolisChal Mar 23, 2021
7bb8617
change the name of TOL to IN_INSIDE_BODY_TOLLERANCE
TolisChal Mar 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions R-proj/R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -302,18 +302,19 @@ rounding <- function(P, method = NULL, seed = NULL) {
#' \item{\code{starting_point} }{ A \eqn{d}-dimensional numerical vector that declares a starting point in the interior of the polytope for the random walk. The default choice is the center of the ball as that one computed by the function \code{inner_ball()}.}
#' \item{\code{BaW_rad} }{ The radius for the ball walk.}
#' \item{\code{L} }{ The maximum length of the billiard trajectory or the radius for the step of dikin, vaidya or john walk.}
#' \item{\code{solver}} {Specify ODE solver for logconcave sampling. Options are i) leapfrog, ii) euler iii) runge-kutta iv) richardson}
#' \item{\code{step_size} {Optionally chosen step size for logconcave sampling. Defaults to a theoretical value if not provided.}}
#' \item{\code{solver} }{ Specify ODE solver for logconcave sampling. Options are i) leapfrog, ii) euler iii) runge-kutta iv) richardson}
#' \item{\code{step_size }{ Optionally chosen step size for logconcave sampling. Defaults to a theoretical value if not provided.}}
#' }
#' @param distribution Optional. A list that declares the target density and some related parameters as follows:
#' \itemize{
#' \item{\code{density} }{ A string: (a) \code{'uniform'} for the uniform distribution or b) \code{'gaussian'} for the multidimensional spherical distribution. The default target distribution is uniform. c) Logconcave with form proportional to exp(-f(x)) where f(x) is L-smooth and m-strongly-convex. }
#' \item{\code{variance} }{ The variance of the multidimensional spherical gaussian. The default value is 1.}
#' \item{\code{density} }{ A string: (a) \code{'uniform'} for the uniform distribution or b) \code{'gaussian'} for the multidimensional spherical distribution c) \code{logconcave} with form proportional to exp(-f(x)) where f(x) is L-smooth and m-strongly-convex d) \code{'exponential'} for the exponential distribution. The default target distribution is uniform. }
#' \item{\code{variance} }{ The variance of the multidimensional spherical gaussian or the exponential distribution. The default value is 1.}
#' \item{\code{mode} }{ A \eqn{d}-dimensional numerical vector that declares the mode of the Gaussian distribution. The default choice is the center of the as that one computed by the function \code{inner_ball()}.}
#' \item{\code{L_}} { Smoothness constant (for logconcave). }
#' \item{\code{m}} { Strong-convexity constant (for logconcave). }
#' \item{\code{negative_logprob}} { Negative log-probability (for logconcave). }
#' \item{\code{negative_logprob_gradient}} { Negative log-probability gradient (for logconcave). }
#' \item{\code{bias} }{ The bias vector for the exponential distribution. The default vector is \eqn{c_1 = 1} and \eqn{c_i = 0} for \eqn{i \neq 1}.}
#' \item{\code{L_} }{ Smoothness constant (for logconcave). }
#' \item{\code{m} }{ Strong-convexity constant (for logconcave). }
#' \item{\code{negative_logprob} }{ Negative log-probability (for logconcave). }
#' \item{\code{negative_logprob_gradient} }{ Negative log-probability gradient (for logconcave). }
#' }
#' @param seed Optional. A fixed seed for the number generator.
#'
Expand Down
4 changes: 4 additions & 0 deletions R-proj/src/copula.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

//Contributed and/or modified by Apostolos Chalkis, as part of Google Summer of Code 2018 program.

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
Expand Down
4 changes: 4 additions & 0 deletions R-proj/src/direct_sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

//Contributed and/or modified by Apostolos Chalkis, as part of Google Summer of Code 2018 and 2019 program.

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
Expand Down
4 changes: 4 additions & 0 deletions R-proj/src/exact_vol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
// Copyright (c) 2012-2019 Vissarion Fisikopoulos
// Copyright (c) 2018-2019 Apostolos Chalkis

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
Expand Down
3 changes: 3 additions & 0 deletions R-proj/src/extractMatPoly.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
// Public License. If you did not receive this file along with HeaDDaCHe,
// see <http://www.gnu.org/licenses/>.

#ifndef RVOLESTI
#define RVOLESTI
#endif

#ifndef EXTRACTMATPOLY_H
#define EXTRACTMATPOLY_H
Expand Down
3 changes: 3 additions & 0 deletions R-proj/src/frustum_of_simplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// Copyright (c) 2012-2018 Vissarion Fisikopoulos
// Copyright (c) 2018 Apostolos Chalkis

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
Expand Down
4 changes: 4 additions & 0 deletions R-proj/src/get_full_dimensional_polytope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

//Contributed and/or modified by Alexandros Manochis, as part of Google Summer of Code 2020 program.

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
Expand Down
4 changes: 4 additions & 0 deletions R-proj/src/geweke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

//Contributed and/or modified by Alexandros Manochis, as part of Google Summer of Code 2020 program.

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
Expand Down
3 changes: 3 additions & 0 deletions R-proj/src/inner_ball.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Copyright (c) 2012-2018 Vissarion Fisikopoulos
// Copyright (c) 2018 Apostolos Chalkis

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
Expand Down
4 changes: 4 additions & 0 deletions R-proj/src/ode_solve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

//Contributed and/or modified by Marios Papachristou, as part of Google Summer of Code 2018 and 2019 program.

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
Expand Down
4 changes: 4 additions & 0 deletions R-proj/src/poly_gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

//Contributed and/or modified by Apostolos Chalkis, as part of Google Summer of Code 2018 program.

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
Expand Down
5 changes: 5 additions & 0 deletions R-proj/src/polytopes_modules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
// Copyright (c) 2012-2019 Vissarion Fisikopoulos
// Copyright (c) 2018-2019 Apostolos Chalkis

#ifndef RVOLESTI
#define RVOLESTI
#endif


#include <Rcpp.h>


Expand Down
4 changes: 4 additions & 0 deletions R-proj/src/psrf_multivariate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

//Contributed and/or modified by Alexandros Manochis, as part of Google Summer of Code 2020 program.

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
Expand Down
4 changes: 4 additions & 0 deletions R-proj/src/psrf_univariate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

//Contributed and/or modified by Alexandros Manochis, as part of Google Summer of Code 2020 program.

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
Expand Down
4 changes: 4 additions & 0 deletions R-proj/src/raftery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

//Contributed and/or modified by Alexandros Manochis, as part of Google Summer of Code 2020 program.

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
Expand Down
4 changes: 4 additions & 0 deletions R-proj/src/rotating.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

//Contributed and/or modified by Apostolos Chalkis, as part of Google Summer of Code 2018 program.

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
Expand Down
4 changes: 4 additions & 0 deletions R-proj/src/rounding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
//Contributed and/or modified by Apostolos Chalkis, as part of Google Summer of Code 2018 program.
//Contributed and/or modified by Alexandros Manochis, as part of Google Summer of Code 2020 program.

#ifndef RVOLESTI
#define RVOLESTI
#endif

#include <Rcpp.h>
#include <RcppEigen.h>
#include <chrono>
Expand Down
Loading