forum.alglib.net
http://forum.alglib.net/

Question about gqgenerategaussjacobi
http://forum.alglib.net/viewtopic.php?f=2&t=33
Page 1 of 1

Author:  MKl [ Wed Jun 23, 2010 2:56 pm ]
Post subject:  Question about gqgenerategaussjacobi

Hello,

I'm using the routine gqgenerategaussjacobi to generate points and weights for Gauss-Jacobi integration. When debugging my code I observed that the weights of the generated rules don't add up to 1, but rather to 1.0666... . Is this intentionally? And if the answer is yes, is there any particular reason for choosing the weights in such way?

Thanks for your answers.

Author:  Sergey.Bochkanov [ Wed Jun 23, 2010 4:56 pm ]
Post subject:  Re: Question about gqgenerategaussjacobi

MKl wrote:
I'm using the routine gqgenerategaussjacobi to generate points and weights for Gauss-Jacobi integration. When debugging my code I observed that the weights of the generated rules don't add up to 1, but rather to 1.0666...

It's alright. Sum of weights is equal to integral(a,b,1*W(x)dx) (try to calculate this integral using Gauss-Jacobi formula and you will see why).

This integral is equal to 2.0 only in the Gauss-Legendre case (alpha=beta=0.0). Note - to 2.0, not to 1.0. In the general case it may have arbitrary value.

Author:  MKl [ Fri Jun 25, 2010 10:56 pm ]
Post subject:  Re: Question about gqgenerategaussjacobi

Thank you for your reply.

I'm using Gauss-Jacobi rules to calculate the expectation of functions of beta distributed variables and therefore expected the sum of weights to be one. Thanks again for pointing out my mistake.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/