Chebyshev Integration



?I was wondering how to use Maxima to integrate a Normal Distribution Function

(1.0/sqrt(2.0*PI))*exp(-0.5*x*x),

under the Clenshaw-Curtis or Chebyshev Integration Schema, WITHOUT any weight function.

I'm using the above example to get used to Maxima in order to tackle a more protracted problem..

Namely, ideally I want to integrate a Chebyshev Fit for a set of points of a histogram distribution. i.e. calculate P( x <= b ), given that I already have the Chebyshev curve (and coefficients) that interpolates the data. There seems to be 2 approaches (a) compute the moments of the fitted curve and calculate the integral (b) Follow the suggestions albeit unclear in Numerical Recipies in C pp 196 - Clenshaw-Curtis Quatrature - paragraph 1.

I'd like to use Maxima to benchmark my implementation. Any ideas on how I might solve this second problem in Maxima - namely integrating Chebyshev fitted PDFs ? Any if anybody has any pointers wrt it's implementation, I'd very much appreciate it.

Kind regards,
Alan?
I am guessing that you have something like a series of functions fitting the points at different intervals.  Taking an example from interpol.mac which can do cubic splines.

You can do this.  You will need pw.mac too.


(%i6) load(interpol);
(out6)     C:/Maxima-5.23.2/share/maxima/5.23.2/share/numeric/interpol.mac
(%i7) load(pw);
(out7)        C:/Maxima-5.23.2/share/maxima/5.23.2/share/contrib/pw.mac
(%i8) P:[[2,4],[4,8],[5,8],[6,4]];
(out8)                      [[2, 4], [4, 8], [5, 8], [6, 4]]
(%i9) cspline(P)$
(%i10) pwint(%,x,2,6);
                                          618
                                          ---
                                           23

In your case you would want to use pw.mac?s between() function instead of charfun2.

for example.

f1(x)*between(x,minf,2)+f2(x)*between(x,2,3)+f3(x)*between(x,3,6)
pwint(%,x,a,b);

where f1, f2 and f3 are Chebyshev polynomials.

Rich

pw.mac is available from here.

http://maxima-project.org/wiki/index.php?title=Pw.mac