lg: An R package for Local Gaussian Approximations

The package lg for the R programming language provides implementations of recent methodological advances on applications of the local Gaussian correlation. This includes the estimation of the local Gaussian correlation itself, multivariate density estimation, conditional density estimation, various tests for independence and conditional independence, as well as a graphical module for creating dependence maps. This paper describes the lg package, its principles, and its practical use.

Håkon Otneim

CRAN packages used

lg, localgauss, magrittr, dplyr, ggplot2, mvtnorm

CRAN Task Views implied by cited packages

Databases, Distributions, Finance, ModelDeployment, Multivariate, Phylogenetics, TeachingStatistics, WebTechnologies


Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".


For attribution, please cite this work as

Otneim, "The R Journal: lg: An R package for Local Gaussian Approximations", The R Journal, 2021

BibTeX citation

  author = {Otneim, Håkon},
  title = {The R Journal: lg: An R package for Local Gaussian Approximations},
  journal = {The R Journal},
  year = {2021},
  note = {https://doi.org/10.32614/RJ-2021-079},
  doi = {10.32614/RJ-2021-079},
  volume = {13},
  issue = {2},
  issn = {2073-4859},
  pages = {38-56}