04-23-2015 4:33 PM
Hi All,
I need some mathematical assistance for a issue i have.
I have been tasked to automate a process that is currently being performed in Excel (who hasn't?)
However 1 of the cells on the Excel sheet is performing a beta distribution calculation i.e. (In Excel ) =BETA.DIST(x,alpha, beta, cumulative)
Within ABAP i am trying to replicate this Excel function, however i am having issues in doing so. I can see the standard statistical QF* functions but i am getting unstuck trying to combine the beta & normal functions.
Any assistance is greatly appreciated.
In Excel - the value x = 1.02E-30 (Scientific) alpha = 27.546 beta = 422.099 Cumulative Value = TRUE
Result = 0.5229858042
Regards,
Marc
04-24-2015 6:57 AM
Which QF functions have you tried. And where do you get unstuck?
I've not done the Beta distribution, but I have done Chi-Squared once - and had to entirely code the algorithm myself. Another approach would be to create an program executable on the application server that does the calculation (search here for issuing OS commands from ABAP) - such a program written in, e.g. C++, would be able to use freely available statistical libraries.
04-24-2015 11:54 AM
Hi Matthew - thanks for your reply.
I have tried using 2 functions QF00_BETA & QF10_CDF_NORMAL - i.e. I have used different combinations to try and get the output of my above example but i am struggling trying to get my head around it.
Due to outsourcing etc - we would not be able to put an executable on the App server as would not have the authorisation.
As you say - it might have to be coded..
Regards,
Marc
04-24-2015 12:22 PM
Due to outsourcing etc - we would not be able to put an executable on the App server as would not have the authorisation.
I love statements like this. The outsourced service providers work for us - they should be doing what they're told... What mismanagement to lose control over your systems like that! But I know that for us actually doing the work it's problematic. (I know one place where a manager, just under the CIO, took six months to get a logon on the P system so that he could verify the service provider was lying when they told him that there weren't "that many dumps in production". There were over 600 ... a day....!)
Anyway.
Another approach would be to write a web service in C++, C# or whatever that uses statistical libraries to calculate this function, and consume that.
04-24-2015 12:40 PM
I've done some digging around and what I can't figure out is what Excel is doing in BETA.DIST. The beta function itself is exactly what SAP have implemented in QF00_BETA.
04-24-2015 2:22 PM
Hi Matthew,
I think we have it sorted - we are using function QF00_BETAI - which according to wiki: http://en.wikipedia.org/wiki/Beta_function
States:
"The regularized incomplete beta function is the cumulative distribution function of the Beta distribution, and is related to the cumulative distribution function of a random variable Xfrom a binomial distribution, where the "probability of success" is p and the sample size is n"
Many thanks for your contribution - and i do share your tail wagging the dog comment above. Hopefully its cyclical!
Regards,
Marc