T O P I C R E V I E W |
pliszka |
Posted - 01/24/2006 : 06:00:24 AM incgamma(a,x)have two parameters x and a, I'd like to know what thehy mean? and what values I should put to obtain for example gamma(x) because in origin there isn't gamma function and I can't use lngamma() |
3 L A T E S T R E P L I E S (Newest First) |
larry_lan |
Posted - 12/13/2006 : 03:03:25 AM Hi Serhiy:
I just compare the OriginC incgamma(x, a) function with Matlab gammainc(x, a) function, the result is the same.
I think you might get the "incorrect result" by using the LabTalk incgamma(a, x) function. Note that the parameters' order is different between LabTalk and OriginC.
Larry OriginLab Technical Services |
sp973 |
Posted - 12/12/2006 : 11:11:32 PM Dear friends, the listed description of incomplete Gamma function is OK. But the real calculated data is different. Unfortunately the algorithm for this function is incorrect. Don't use the incgamma(a,x) at all. Use the special algorithm from this link: http://alglib.sources.ru/translator/download.php?location=/specialfunctions/gamma/igamma&target=csharp
Good luck ! Serhiy |
Mike Buess |
Posted - 01/24/2006 : 08:29:15 AM If you have Origin 7 or 7.5 you can use Origin C's nag_gamma function. LabTalk's gammaln function works in all versions... gamma(x) = exp(gammaln(x)).
...Here are the expressions for gamma and incgamma found in the programming guide.
gamma(x):
incgamma(a,x):
So incgamma(a,x=infinity) = gamma(a)/gamma(a) = 1, but it's not clear to me how to obtain gamma(a) from incgamma(a,x) for an arbitrary value of x. I suggest you use one of the methods discussed at the top of this post.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 01/24/2006 3:18:57 PM |
|
|