This repository has been archived by the owner. It is now read-only.
Continuous transformations from ℝ or ℝⁿ to various open sets
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
src bump versions (#13) Sep 4, 2018

Deprecation notice

IMPORTANT: this package is now abandoned, please use TransformVariables.jl instead.


Lifecycle Project Status: Unsupported – The project has reached a stable, usable state but the author(s) have ceased all work on it. A new maintainer may be desired. Build Status Coverage Status Documentation

Continuous transformations (or more precisely, homeomorphisms) from ℝ (and two-point compactified version) and ℝⁿ to various open (or closed) sets used in statistics and numerical methods, such as intervals, simplexes, ordered vectors.

Work in progress, API may change without notice.


This package was born because I was tired of coding the same transformations over and over, with occasional bugs, and wanted something well-tested.

Transformations defined by the package can be

  1. called as functions,
  2. provide the logjac(transformation, x) method for the log Jacobian determinant,
  3. prodide the inverse(transformation, x) method for the inverse.

Log jacobian determinants and their log are useful for domain transformations in MCMC, among other things.

In addition, the package includes types to represent intervals, and some basic methods of working with them. The concept of intervals is slightly different from IntervalSet.jl and ValidatedNumerics.jl, and as a result not compatible with either.

The convenience function bridge(dom, img) figures out the right transformation from dom to img. Currently implemented for intervals.


using ContinuousTransformations
t = bridge(ℝ, Segment(0.0, 3.0)) # will use a real-circle transformation, stretched
t(0.0)             # 1.5
inverse(t, 1.5)    # ≈ 0.0
logjac(t, 0)       # ≈ 0.405
image(t)           # Segment(0.0, 3.0)

ArrayTransformation(transformation, dimensions...) transforms a vector of numbers to an array elementwise using transformation.

TransformationTuple(transformations) can be used for heterogeneous collections of transformations.

TransformLogLikelihood wraps a log likelihood function, and TransformDistribution transforms a distribution. Both of them take care of the log Jacobian determinant adjustment.

Special transformations, useful for Bayesian methods, are also available (WIP). Feature and pull requests are appreciated.


  • Stan Development Team (2017). "Modeling Language User's Guide and Reference Manual, Version 2.17.0" (pdf)

  • Lewandowski, Daniel, Dorota Kurowicka, and Harry Joe. "Generating random correlation matrices based on vines and extended onion method." Journal of multivariate analysis 100.9 (2009): 1989–2001.