X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



4990 Rate this article:
No rating

Calculating Incomplete Gamma Functions with IDL

 

Tolerance controls allow you to calculate the accuracy of the incomplete beta and gamma functions. (See the Help Article #3181 for calculating Incomplete Beta Functions.)

Working With Iteration Controls in the Incomplete Gamma Function. The following example shows how increasing the maximum number of iterations can change the outcome of computing the incomplete gamma function. Normally, the calculation of the incomplete gamma function will not converge within 100 iterations (the default number of iterations) when the parametric exponent is set to 400 and the upper limit is set to 400. The ITMAX keyword to the IGAMMA routine is set to 200 to allow the calculation to converge to a value of 0.506649 within 144 iterations.

More accuracy usually provides better results, but can cause slower computation speeds. If faster speeds are important, a less accurate calculation may be more desirable. This trade-off can be maintained through tolerances. Iteration controls allow you to expand the computation enough to converge to a result. Calculation of these functions may not converge to a result within the default number of iterations. If the number of iterations is increased, the calculation may converge.

Code Example:

PRO usingIGAMMAwithITMAX
 
    ; Define parametric exponent.
    parameterA = 400.

    ; Define the upper limit of integration.
    upperLimits = 400.

    ; NOTE: with the above parameter and limit, IGAMMA will
    ; not converge unless the number of iterations is
    ; increased above the default of 100.

    ; Compute the incomplete gamma function.
    gammaFunction = IGAMMA(parameterA, upperLimits, $
     ITMAX = 200, ITER = numberIteration)

    ; Output results.
    PRINT, 'Resulting Gamma Function: ', gammaFunction
    PRINT, 'Number of Iterations: ', numberIteration
 
END
_____________________________________________________
Reviewed by BC on 09/05/2014
Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »