Open Source R Packages

SphericalCubature – Numerical integration of functions over spheres and balls

Defines several methods to integrate functions over the unit sphere and ball in n-dimensional Euclidean space. Routines for converting to/from multivariate polar/spherical coordinates are also provided.
The following code fragment integrates a function of 3 variables over the sphere and over the ball.


f1 <- function( x ) { return(x[1]^2+3*x[2]+exp(x[3])) }
adaptIntegrateSphere( f1, n=3 )
adaptIntegrateBall( f1, n=3 )

Downloads from RStudio repository in the last month:

SimplicialCubature – Numerical integration of functions over simplices

Provides methods to integrate functions over m-dimensional simplices in n-dimensional Euclidean space. There are exact methods for polynomials and adaptive methods for integrating an arbitrary function.
The following code evaluates an integral over the canonical simplex in 4-dimensions.


S <- CanonicalSimplex( n=4 )
f1 <- function( x ) { x[1]^3 }
adaptIntegrateSimplex( f1, S )

Downloads from RStudio repository in the last month:

mvmesh – Multivariate meshes

Define, manipulate and plot multivariate meshes/grids in n-dimensional Euclidean space. Multivariate histograms based on these meshes are provided.
The following code produces the equal volume edge 4-subdivision of the solid simplex in 3-dimensions shown on the right.


plot( SolidSimplex( n=3,k=4), col="blue", lwd=2 )

Downloads from RStudio repository in the last month:

gensphere – Generalized spherical distributions

Define and compute with generalized spherical distributions – multivariate probability laws that are specified by a star shaped contour (directional behavior) and a radial component.

Downloads from RStudio repository in the last month:

ecdfHT – Empirical cdf for Heavy Tailed data

Computes and plots a transformed empirical CDF (ecdf) as a diagnostic for heavy tailed data, specifically data with power law decay on the tails. Routines for annotating the plot, comparing data to a model, fitting a nonparametric model, and some multivariate extensions are given.

Downloads from RStudio repository in the last month: