stieltjes | R Documentation |
Computes the Stieltjes integral
of a function f
with respect to a function M
.
stieltjes(f, M, ...)
f |
The integrand. A function in the R language. |
M |
The cumulative function against which |
... |
Additional arguments passed to |
This command computes the Stieltjes integral
I = \int 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"
).
Objects of class "stepfun"
are returned by
ecdf
, ewcdf
,
and other utilities.
A list containing the value of the Stieltjes integral
computed using each of the versions of the function M
.
.
x <- runif(100)
w <- runif(100)
H <- ewcdf(x, w)
stieltjes(function(x) { x^2 }, H)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.