integration: discrete integration of series or a function

Description Usage Arguments Value

Description

Numeric discrete integration of series or function y over variable x.

Usage

1
2
integration(y, x = seq(f = from, t = to, len = n), from = min(x),
  to = max(x), n = length(x), method = "center")

Arguments

y

The values to integrate. Either a numeric vector of function values corresponding to elements in x or a function that takes a single argument x and returns the corresponding value y.
For example: y = function(x) x ^ 2.

x

numeric vector of y-value-positions. Can be left unspecified if from, to and n are given.

from

lower bound of integration, will be used as smallest x. Unused if x is specified.

to

upper bound of integration, will be used as highest x. Unused if x is specified.

n

integer. Amount of steps / resolution of integration. Determines the length of x. Unused if x is specified.

method

integration method. Either center,left,right,upper or lower.

Value

numeric value of integration


nobodyinperson/functionutils documentation built on May 23, 2019, 9:31 p.m.