Learn R Programming

⚠️There's a newer version (1.1.2-9) of this package.Take me there.

Volume computation and sampling

About

The volesti package provides R with functions for volume estimation and sampling. In particular, it provides an R interface for the C++ library volesti.

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 two algorithms for volume approximation as well as algorithms for sampling, rounding and rotating polytopes.

Download and install

  • The latest stable version is available from CRAN.

  • The latest development version is available on Github www.github.com/GeomScale/volume_approximation

  • Install volesti by running:

install.packages("volesti")
  • The package-dependencies are: Rcpp, RcppEigen, BH.

Usage

  • The main function is volume(). It can be used to approximate the volume of a convex polytope given as a set of linear inequalities or a set of vertices (d-dimensional points) or as a Minkowski sum of segments (zonotope). There are two algorithms that can be used. The first is SequenceOfBalls and the second is CoolingGaussian.
  • sample_points() can be used to sample points from a convex polytope approximating uniform or multidimensional spherical gaussian target distribution using: (a) coordinate directions hit-and-run (default), (b) random directions hit-and-run or (c) ball walk. This function can be used as well in order to sample exact uniform points from simplices and the boundary or the interior of hyperspheres.
  • round_polytope() can be used to round a convex polytope.
  • rand_rotate() can be used to apply a random rotation to a convex polytope.
  • gen_cross() can be used to generate a d-dimensional cross polytope.
  • gen_cube() can be used to generate a d-dimensional unit cube.
  • gen_prod_simplex() can be used to generate a 2d-dimensional polytope that is defined as the product of two d-dimensional unit simplices.
  • gen_simplex() can be used to generate the d-dimensional unit simplex.
  • gen_skinny_cube() can be used to generate a d-dimensional skinny hypercube.
  • gen_rand_hpoly() can be used to generate a d-dimensional polytope in H-representation with m facets.
  • gen_rand_vpoly() can be used to generate a d-dimensional polytope in V-representation with m vertices.
  • gen_rand_zonotope() can be used to generate a random d-dimensional zonotope defined by the Minkowski sum of m d-dimensional segments.
  • file_to_polytope() takes the path for an ine or an ext file and returns the corresponding polytope.
  • frustum_of_simplex() can be used to evaluate the portion of of the d-dimensional unit simplex contained in a given half-space using M. Ali's version of G. Varsi's iterative formula.
  • inner_ball() can be used to compute an inscribed ball of a convex polytope (works for all the representations).
  • copula1() can be used to compute the copula when two families of parallel hyperplanes are given.
  • copula2() can be used to compute the copula when one familiy of parallel hyperplanes and a family of concentric ellipsoids are given.

For more details, features, examples and references you can read the documentation.

Credits

Copyright (c) 2012-2020 Vissarion Fisikopoulos
Copyright (c) 2018-2020 Apostolos Chalkis

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.

Main development by Vissarion Fisikopoulos while he was affiliated with University of Athens (UoA, Greece) and University of Brussels (ULB, Belgium), and Chalkis Apostolos affiliated with University of Athens. Part of the development was done while A.Chalkis (as student) and V.Fisikopoulos (as mentor) were participating in Google Summer of Code 2018 program.

Publications

  1. I.Z. Emiris and V. Fisikopoulos, Efficient random-walk methods for approximating polytope volume, In Proc. ACM Symposium on Computational Geometry, Kyoto, Japan, p.318-325, 2014.
  2. I.Z. Emiris and V. Fisikopoulos, Practical polytope volume approximation, ACM Transactions on Mathematical Software, vol 44, issue 4, 2018.
  3. L. Cales, A. Chalkis, I.Z. Emiris, V. Fisikopoulos, Practical volume computation of structured convex bodies, and an application to modeling portfolio dependencies and financial crises, Proc. of Symposium on Computational Geometry, Budapest, Hungary, 2018.

Copy Link

Version

Install

install.packages('volesti')

Monthly Downloads

382

Version

1.1.0

License

LGPL-3

Maintainer

Vissarion Fisikopoulos

Last Published

May 31st, 2020

Functions in volesti (1.1.0)

Hpolytope

An R class to represent H-polytopes.
gen_simplex

Generator function for simplices
Rcpp_Zonotope

An Rcpp class to represent zonotopes, exposed to R via modules.
Rcpp_Vpolytope

An Rcpp class to represent V-polytopes, exposed to R via modules.
gen_rand_hpoly

Generator function for random H-polytopes
gen_rand_vpoly

Generator function for random V-polytopes
gen_rand_zonotope

Generator function for zonotopes
Rcpp_VpolytopeIntersection

An Rcpp class to represent the intersection of two V-polytope, exposed to R via modules.
compute_indicators

Compute an indicator for each time period that describes the state of a market.
Zonotope

An R class to represent zonotopes.
zono_approx

An internal Rccp function for the over-approximation of a zonotope
Vpolytope

An R class to represent V-polytopes.
frustum_of_simplex

Compute the percentage of the volume of the simplex that is contained in the intersection of a half-space and the simplex.
direct_sampling

Sample perfect uniformly distributed points from well known convex bodies: (a) the unit simplex, (b) the canonical simplex, (c) the boundary of a hypersphere or (d) the interior of a hypersphere.
Rcpp_Hpolytope

An Rcpp class to represent H-polytopes, exposed to R via modules.
VpolytopeIntersection

An R class to represent the intersection of two V-polytopes.
sample_points

Sample uniformly or normally distributed points from a convex Polytope (H-polytope, V-polytope, zonotope or intersection of two V-polytopes).
copula

Construct a copula using uniform sampling from the unit simplex
gen_skinny_cube

Generator function for skinny hypercubes
file_to_polytope

function to get an ine or an ext file and returns the corresponding polytope
zonotope_approximation

A function to over-approximate a zonotope with PCA method and to evaluate the approximation by computing a ratio of fitness.
volume

The main function for volume approximation of a convex Polytope (H-polytope, V-polytope, zonotope or intersection of two V-polytopes)
rotate_polytope

Apply a random rotation to a convex polytope (H-polytope, V-polytope, zonotope or intersection of two V-polytopes)
exact_vol

Compute the exact volume of (a) a zonotope (b) an arbitrary simplex in V-representation or (c) if the volume is known and declared by the input object.
gen_cross

Generator function for cross polytopes
round_polytope

Apply rounding to a convex polytope (H-polytope, V-polytope or a zonotope)
rotating

An internal Rccp function for the random rotation of a convex polytope
rounding

Internal rcpp function for the rounding of a convex polytope
inner_ball

Compute an inscribed ball of a convex polytope
gen_cube

Generator function for hypercubes
poly_gen

An internal Rccp function as a polytope generator
gen_prod_simplex

Generator function for product of simplices