trapz {kldest}R Documentation

Trapezoidal integration in 1 or 2 dimensions

Description

Trapezoidal integration in 1 or 2 dimensions

Usage

trapz(h, fx)

Arguments

h

A length d numeric vector of grid widths.

fx

A d-dimensional array (or a vector, if d=1).

Value

The trapezoidal approximation of the integral.

Examples

# 1D example
trapz(h = 1, fx = 1:10)
# 2D example
trapz(h = c(1,1), fx = matrix(1:10, nrow = 2))

[Package kldest version 1.0.0 Index]