# stieltjes: Compute Integral of Function Against Cumulative Distribution

### Description

Computes the Stieltjes integral of a function f with respect to a function M.

### Usage

 1 stieltjes(f, M, ...)

### Arguments

 f The integrand. A function in the R language. M The cumulative function against which f will be integrated. An object of class "fv" or "stepfun". ... Additional arguments passed to f.

### Details

This command computes the Stieltjes integral

I = integral f(x) dM(x)

of a real-valued function f(x) with respect to a nondecreasing function M(x).

One common use of the Stieltjes integral is to find the mean value of a random variable from its cumulative distribution function F(x). The mean value is the Stieltjes integral of f(x)=x with respect to F(x).

The argument f should be a function in the R language. It should accept a numeric vector argument x and should return a numeric vector of the same length.

The argument M should be either a step function (object of class "stepfun") or a function value table (object of class "fv", see fv.object). Objects of class "stepfun" are returned by ecdf, ewcdf, spatialcdf and other utilities. Objects of class "fv" are returned by the commands Kest, Gest, etc.

### Value

A list containing the value of the Stieltjes integral computed using each of the versions of the function M.

\spatstatAuthors

.

### Examples

 1 2 3 4 5 6 7 8 9 10 # estimate cdf of nearest neighbour distance in redwood data G <- Gest(redwood) # compute estimate of mean nearest neighbour distance stieltjes(function(x){x}, G) # estimated probability of a distance in the interval [0.1,0.2] stieltjes(function(x,a,b){ (x >= a) & (x <= b)}, G, a=0.1, b=0.2) # stepfun example H <- spatialcdf(bei.extra\$elev, normalise=TRUE) stieltjes(function(x){x}, H)

Search within the spatstat package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.