On 3/1/2011 6:51 AM, Alzer Kong wrote:
> 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
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
1. In maxima you'd better use %pi instead of PI.
2. If you want to compute a chebyshev approximation for your data,
you presumably have some finite interval in mind. Computing
via a discrete cosine transform is the fastest way, and can
probably be done with the FFT in some fashion. I wrote some
programs that use some pre-packaged DCT and are maybe 75 times
faster.
3. Integrating a chebyshev series is pretty easy.
4. If you are benchmarking because speed is important, you may
find Maxima slow. If you are benchmarking because programming
time is important, not clear.
I will send you a file (not to whole list..)
RJF