forum.alglib.net

ALGLIB forum
It is currently Thu Mar 28, 2024 2:56 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Question about gqgenerategaussjacobi
PostPosted: Wed Jun 23, 2010 2:56 pm 
Offline

Joined: Wed Jun 23, 2010 2:51 pm
Posts: 2
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.


Top
 Profile  
 
 Post subject: Re: Question about gqgenerategaussjacobi
PostPosted: Wed Jun 23, 2010 4:56 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 903
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.


Top
 Profile  
 
 Post subject: Re: Question about gqgenerategaussjacobi
PostPosted: Fri Jun 25, 2010 10:56 pm 
Offline

Joined: Wed Jun 23, 2010 2:51 pm
Posts: 2
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 54 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group