help-gsl
[Top][All Lists]

## Re: [Help-gsl] Numerical quadrature performed on a set of points

 From: John D Lamb Subject: Re: [Help-gsl] Numerical quadrature performed on a set of points Date: Sat, 12 Jul 2008 16:42:48 +0100

```On Sat, 2008-07-12 at 20:56 +0800, Hongzheng Wang wrote:
> My question is, if the function
> is known only on a set of points, how can the integration be
> calculated conveniently?

I may not have understood your question. But ...

If you have a function f and know its values at points x_1,...,x_n only
and wish to estimate the integral of f, you have two problems

(1) find g to estimate f.
(2) find G to estimate the integral of g.

There are several possibilities for (1) depending on the circumstances.
Here are three possibilities. There are more.

(1) Estimate g as a piecewise linear function between x_1 and x_n. Then
the integral of g is easily found without numerical integration. In this
case it is not even necessary to find g explicitly.

(2) Estimate g using cubic splines. Then, again, the integral of g can
be found without numerical integration.

(3) Estimate g using some more complex regression model. Depending on
the model, you may or may not be able to find the integral of g
explicitly. If not, you can use numerical integration methods on g.

--
JDL

```