dlg: The locally Gaussian density estimator (LGDE)

Description Usage Arguments Details Value References Examples

View source: R/density_estimation.R

Description

Estimate a multivariate density function using locally Gaussian approximations

Usage

1
2
dlg(lg_object, grid, level = 0.95, normalization_points = NULL,
  bootstrap = F, B = 500)

Arguments

lg_object

An object of type lg, as produced by the lg_main-function.

grid

A matrix of grid points, where we want to evaluate the density estimate.

level

Specify a level if asymptotic standard deviations and confidence intervals should be returned.

normalization_points

How many grid points for approximating the integral of the density estimate, to use for normalization?

bootstrap

Calculate bootstrapped confidence intervals instead.

B

Number of bootstrap replications if using bootstrapped confidence intervals.

Details

This function does multivariate density estimation using the locally Gaussian density estimator (LGDE), that was introduced by Otneim & Tjøstheim (2017). The function takes as arguments an lg-object as produced by the main lg_main-function (where all the running parameters are specified), and a grid of points where the density estimate should be estimated.

Value

A list containing the density estimate as well as all the running parameters that has been used. The elements are:

References

Otneim, Håkon, and Dag Tjøstheim. "The locally gaussian density estimator for multivariate data." Statistics and Computing 27, no. 6 (2017): 1595-1616.

Examples

1
2
3
4
   x <- cbind(rnorm(100), rnorm(100), rnorm(100))
   lg_object <- lg_main(x)  # Put all the running parameters in here.
   grid <- cbind(seq(-4, 4, 1), seq(-4, 4, 1), seq(-4, 4, 1))
   density_estimate <- dlg(lg_object, grid = grid)

lg documentation built on Dec. 5, 2019, 5:13 p.m.

Related to dlg in lg...