Message Boards Message Boards

5 Replies
7 Total Likes
View groups...
Share this post:

AccuracyGoal in NIntegrate puzzle

Posted 11 years ago
I used NIntegrate to solve a multivariate integral, but needed to use AccuracyGoal of 6 or less for the integral to evaluate.

The results looked suspicious and it was suggested that I was looking at rounding errors.

When AccuracyGoal was set to Infinity, the result was as expected.

Why did the incremental increase in the value of AccuracyGoal not lead to a convergence on the Infinity setting value?
POSTED BY: Luther Nayhm
5 Replies
Posted 11 years ago
My comment about AccuracyGoal->Infinity meaning that no AccuracyGoal is set was a sarcastic response to the equivalent of going into a society where nodding the head means no and shaking it means yes.

However, your points are well taken. Here's the results of following up on your suggestions.

There are no comments to any of the NIntegrate executions. Once any accuracy, preciision, working precision, and max and min recursions are set, I get the same output with no comments. The results that are plotted use ?NumericQ and is a plot of the quotent of two NIntegrate functions which have similar manitudes at about 10^(-10) units. In other words, I have normalized one function with the other. Even performing a point by point integration and normalization, the results are consistent with the parametric plots.

The integrand has no poles and, unlike some others integrals, it does not give me an excessive integrand oscillation notice. It is a multivariate integration, and I have switched the order of integration within the constraints of certain dependencies.

It looks like my anomalous results are the real results and not getting my results is the real anomaly.

That said, I have another similar set of functions that give me spikey garbage using ?NumericQ and I do get messages about the convergence. In this case, the integrand also does not have poles and I am trying to understand why the approach does not work. But that's another story.
POSTED BY: Luther Nayhm
>>NIntegrate essentially ignores AccuracyGoal->Infinity!!!!!! Wow.

As clearly stated in the documentation. (And this behavior is not just for NIntegrate.)

>>How can you tell if the unexpected results are the correct results?

You need to know more about (i) the integrand and (ii) the numerical integration algorithms used.
Here are some questions worth answering:
Do you get any messages from NIntegrate?Of what magnitude is the value of the integral?If you increase both MinRecursion and MaxRecursion do you get the same result? Do you get the same result using different combinations of integration strategies and integration rules?Do you use any singularity handlers? What results do you get without (1) singularity handling and (2) symbolic preprocessing?Is the computation of the integrand prone to cancelation errors?

I hope these help...

NIntegrate's advanced documentation explains the integration strategies, rules, and singularity handlers and provides examples and prototype implementations.
POSTED BY: Anton Antonov
Generally  NIntegrate  proceeds until either  AccuracyGoal  or  PrecisionGoal  is achieved.  Setting  AccuracyGoal  to  Infinity  effectively makes  NIntegrate  ignore it.  See the "Details" section of and
POSTED BY: Michael Rogers
Posted 11 years ago
NIntegrate essentially ignores AccuracyGoal->Infinity!!!!!! Wow.

So, what does this really mean? I performed my NIntegrate setting AccuracyGoal from 1 to 100 and got the same answer. I set it to Infinity and I got a different answer. The different answer is an expected answer and the others are consistent but unexpected. If those are the correct results, the findings are remarkable and will have an impact on certain physics.

How can you tell if the unexpected results are the correct results?

I read both of the descriptions you identified but missed the details in the AccuracyGoal writeup.

I need to iterate my NIntegrate with various PrecisionGoal iterations and see what happens.

Thanks for the suggestions.
POSTED BY: Luther Nayhm
It is hard to give an explanation without seeing the actual integral. May be you can figure out what is going on by reading NIntegrate's advanced documentation section "Examples of pathological behavior" in the chapter "NIntegrate Integration Rules". 
POSTED BY: Anton Antonov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract