You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#' @param dimension The dimension of each derivative
196
-
#' @param initial_time The initial time
197
-
#' @param F The function oracle F(x, t) in the ODE.
198
-
#' @param method The method to be used
199
-
#' @param initial_conditions The initial conditions provided to the solver. Must be provided in a list with keys "x_1", ..., "x_n" and column vectors as values. The state "x_n" represents the (n-1)-th order derivative with respect to time
200
-
#' @param domains A list of n H-polytopes with keys "P_1", "P_2", ..., "P_n" that correspond to each derivative's domain
201
-
#'
202
-
#' @return A list which contains elements "x_1", ..., "x_n" representing each derivative results. Each "x_i" corresponds to a d x n matrix where each column represents a certain timestep of the solver.
#' @param n The number of points that the function is going to sample from the convex polytope.
312
288
#' @param random_walk Optional. A list that declares the random walk and some related parameters as follows:
313
289
#' \itemize{
314
-
#' \item{\code{walk} }{ A string to declare the random walk: i) \code{'CDHR'} for Coordinate Directions Hit-and-Run, ii) \code{'RDHR'} for Random Directions Hit-and-Run, iii) \code{'BaW'} for Ball Walk, iv) \code{'BiW'} for Billiard walk, v) \code{'dikin'} for dikin walk, vi) \code{'vaidya'} for vaidya walk, vii) \code{'john'} for john walk, viii) \code{'BCDHR'} boundary sampling by keeping the extreme points of CDHR or ix) \code{'BRDHR'} boundary sampling by keeping the extreme points of RDHR x) \code{'HMC'} for Hamiltonian Monte Carlo (logconcave densities) xi) \code{'ULD'} for Underdamped Langevin Dynamics using the Randomized Midpoint Method xii) \code{'ExactHMC'} for exact Hamiltonian Monte Carlo with reflections (spherical Gaussian or exponential distribution). The default walk is \code{'aBiW'} for the uniform distribution or \code{'CDHR'} for the Gaussian distribution and H-polytopes and \code{'BiW'} or \code{'RDHR'} for the same distributions and V-polytopes and zonotopes.}
290
+
#' \item{\code{walk} }{ A string to declare the random walk: i) \code{'CDHR'} for Coordinate Directions Hit-and-Run,
291
+
#' ii) \code{'RDHR'} for Random Directions Hit-and-Run, iii) \code{'BaW'} for Ball Walk, iv) \code{'BiW'} for Billiard walk,
292
+
#' v) \code{'dikin'} for dikin walk, vi) \code{'vaidya'} for vaidya walk, vii) \code{'john'} for john walk,
293
+
#' viii) \code{'BCDHR'} boundary sampling by keeping the extreme points of CDHR or ix) \code{'BRDHR'} boundary sampling by keeping the extreme points of RDHR,
294
+
#' x) \code{'NUTS'} for NUTS Hamiltonian Monte Carlo sampler (logconcave densities), xi) \code{'HMC'} for Hamiltonian Monte Carlo (logconcave densities),
295
+
#' xii) CRHMC for Riemannian HMC with H-polytope constraints (uniform and general logconcave densities),
296
+
#' xiii) \code{'ULD'} for Underdamped Langevin Dynamics using the Randomized Midpoint Method (logconcave densities),
297
+
#' xiii) \code{'ExactHMC'} for exact Hamiltonian Monte Carlo with reflections (spherical Gaussian or exponential distribution).
298
+
#' The default walk is \code{'aBiW'} for the uniform distribution, \code{'CDHR'} for the Gaussian distribution and H-polytopes and
299
+
#' \code{'BiW'} or \code{'RDHR'} for the same distributions and V-polytopes and zonotopes. \code{'NUTS'} is the default sampler for logconcave densities and \code{'CRHMC'}
300
+
#' for logconcave densities with H-polytope and sparse constrainted problems.}
315
301
#' \item{\code{walk_length} }{ The number of the steps per generated point for the random walk. The default value is \eqn{1}.}
316
302
#' \item{\code{nburns} }{ The number of points to burn before start sampling. The default value is \eqn{1}.}
317
303
#' \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()}.}
#' l = loadSdpaFormatFile(paste0(path,'/sdpa_n2m3.txt'))
410
-
#' @export
411
-
loadSdpaFormatFile<-function(inputFile=NULL) {
412
-
.Call(`_volesti_loadSdpaFormatFile`, inputFile)
413
-
}
414
-
415
363
#' The main function for volume approximation of a convex Polytope (H-polytope, V-polytope, zonotope or intersection of two V-polytopes). It returns a list with two elements: (a) the logarithm of the estimated volume and (b) the estimated volume
416
364
#'
417
365
#' For the volume approximation can be used three algorithms. Either CoolingBodies (CB) or SequenceOfBalls (SOB) or CoolingGaussian (CG). An H-polytope with \eqn{m} facets is described by a \eqn{m\times d} matrix \eqn{A} and a \eqn{m}-dimensional vector \eqn{b}, s.t.: \eqn{P=\{x\ |\ Ax\leq b\} }. A V-polytope is defined as the convex hull of \eqn{m} \eqn{d}-dimensional points which correspond to the vertices of P. A zonotope is desrcibed by the Minkowski sum of \eqn{m} \eqn{d}-dimensional segments.
Copy file name to clipboardExpand all lines: README.md
+38-28Lines changed: 38 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -5,58 +5,68 @@ The `volesti` package provides [R](https://www.r-project.org/) with functions fo
5
5
6
6
`volesti` computes approximations of volume of polytopes given as a set of points or linear inequalities or as a Minkowski sum of segments (zonotopes). There are algorithms for volume approximation as well as algorithms for sampling, rounding and rotating polytopes. Last but not least, `volesti` provides implementations of geometric algorithms to compute the score of a portfolio given asset returns and to detect financial crises in stock markets.
7
7
8
+
9
+
The latest **stable** version is available from CRAN.
* The latest stable version is available from CRAN.
11
-
* The latest development version is available on Github `https://github.com/GeomScale/Rvolesti`
25
+
To use the development version you need to follow these steps:
12
26
13
-
To use the development version of `volesti` that includes the C++ code, you need to clone the repository and fetch the submodule. Follow these steps:
27
+
* Clone the `Rvolesti`repository.
14
28
15
-
* Clone the main `Rvolesti` repository.
16
-
* Fetch the submodule from the [volesti](https://github.com/GeomScale/volesti) repository:
17
-
```
18
-
git submodule update --recursive --init --remote
19
-
```
20
-
* Build package by running:
21
-
```
29
+
* Build and install the package by running (from an `R` terminal):
30
+
```R
22
31
Rcpp::compileAttributes()
23
32
devtools::build()
24
-
```
25
-
* Install Rvolesti by running:
26
-
```
27
33
install.packages("volesti")
28
34
```
35
+
or from a bash terminal:
36
+
```bash
37
+
Rscript -e 'Rcpp::compileAttributes()'
38
+
R CMD INSTALL --no-multiarch --with-keep.source .
39
+
```
29
40
30
-
The package-dependencies are: `Rcpp`, `RcppEigen`, `BH`.
41
+
The following packages should be installed: `Rcpp`, `RcppEigen`, `BH`.
31
42
32
43
## Documentation
33
44
34
45
*[Using the R Interface](https://github.com/GeomScale/volesti/blob/v1.1.1/doc/r_interface.md)
35
46
*[Wikipage with Tutorials and Demos](https://github.com/GeomScale/volesti/wiki)
36
47
*[Tutorial given to PyData meetup](https://vissarion.github.io/tutorials/volesti_tutorial_pydata.html)
37
48
38
-
## How to update the volesti R package?
39
-
40
-
The C++ source code is retrieved from [volesti](https://github.com/GeomScale/volesti) package and placed in `src/include` of the current repository. To update the current C++ code we have to follow two steps:
49
+
The user can generate or update the documentation:
41
50
42
-
- Update the `cran_include` branch in [volesti](https://github.com/GeomScale/volesti)
43
-
- Clone the main `volesti` repository
44
-
- Checkout to the `cran_include` branch
45
-
- Update your code and open a PR similar to https://github.com/GeomScale/volesti/pull/277
46
-
- Retrieve the new `include` directory using submodule
47
-
```
48
-
git submodule update --recursive --init --remote
51
+
```R
52
+
Rcpp::compileAttributes() # updates the Rcpp layer from C++ to R
53
+
roxygen2::roxygenize(roclets="rd") # updates the docs based on roxygen comments
49
54
```
50
55
51
-
*Note:* it is possible the this update will brake the R interface, thus this operation should be processed with care.
*[Contributors and Package History](https://github.com/GeomScale/volesti/blob/v1.1.1/doc/credits.md)
56
67
*[List of Publications](https://github.com/GeomScale/volesti/blob/v1.1.1/doc/publications.md)
57
68
58
-
Copyright (c) 2012-2023 Vissarion Fisikopoulos
59
-
60
-
Copyright (c) 2018-2023 Apostolos Chalkis
69
+
Copyright (c) 2012-2024 Vissarion Fisikopoulos
70
+
Copyright (c) 2018-2024 Apostolos Chalkis
61
71
62
72
You may redistribute or modify the software under the GNU Lesser General Public License as published by Free Software Foundation, either version 3 of the License, or (at your option) any later version. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
0 commit comments