Issue 91547

Summary: ODFF: enhance BETADIST to support probability density function
Product: Calc Reporter: Regina Henschel <rb.henschel>
Component: programmingAssignee: oc
Status: CLOSED FIXED QA Contact: issues@sc <issues>
Severity: Trivial    
Priority: P3 CC: issues
Version: DEV300m20   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: PATCH Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on: 91602    
Issue Blocks:    
Attachments:
Description Flags
necessary changes in header file for new functions
none
changes for BETADIST
none
changes for new BetaDist
none
version with ASYM for x near mean and alpha,beta large
none
Same testcases, the blue values are correct
none
testcases for the density cases
none
test document to compare new and old values
none
patch for source/ui/src/scfuncs.src based on odff05
none
patch for source/core/inc/interpre.hxx based on odff05
none
patch for souce/core/tool/interpr3.cxx based on odff05
none
Testdocuments for Test Case Specification
none
TestCaseSpecification none

Description Regina Henschel 2008-07-10 14:38:39 UTC
Currently the BETADIST function covers only the cumulative case. In OpenFormula
1.2. the BETADIST function has a fifth parameter to switch between cumulative
and density case. OOo should support this parameter too.
Comment 1 oc 2008-07-15 10:43:39 UTC
reassigning features and enhancements to user requirements@openoffice.org which
will be the default owner for those tasks (was introduced some time ago)
Comment 2 Regina Henschel 2008-07-18 23:02:38 UTC
Created attachment 55226 [details]
necessary changes in header file for new functions
Comment 3 Regina Henschel 2008-07-18 23:03:45 UTC
Created attachment 55227 [details]
changes for BETADIST
Comment 4 Regina Henschel 2008-07-18 23:11:56 UTC
I have attached a patch for the enhancement and for improving the accuracy of
BETADIST. This proposed changes give a better accuracy for BETADIST than the
current implementation in OOoDEV300m20. But there are still some problems and a
final version of the patch will be needed.

Please try the patch. You can get the probability density function with an
additional sixth parameter false() for densitiy and true() for cumulative. The
current form without sixth parameter will still work.

For discussion use the mailinglist dev@sc.openoffice.org, please.
Comment 5 ooo 2008-07-30 16:50:34 UTC
Considering for OOo3.1 if remaining issues are solved until then.
Comment 6 Regina Henschel 2008-08-22 22:53:03 UTC
Created attachment 55950 [details]
changes for new BetaDist
Comment 7 Regina Henschel 2008-08-22 22:54:35 UTC
Created attachment 55951 [details]
version with ASYM for x near mean and alpha,beta large
Comment 8 Regina Henschel 2008-08-22 22:58:05 UTC
Created attachment 55952 [details]
Same testcases, the blue values are correct
Comment 9 Regina Henschel 2008-08-22 23:00:22 UTC
Created attachment 55953 [details]
testcases for the density cases
Comment 10 Regina Henschel 2008-12-03 19:05:23 UTC
Hi Eike, this is ready now too. I'll attach the three needed patches.
I have made changes in scfuncs.src, interpre.hxx and interpr3.cxx. Please notice
first to implement the patch of i91602 to get expm1 and log1p.

In addition I have added columns to the test document containing the values that
the current OOo gives. So you can see, that even in those cases, where we are
less accurate than Gnumeric and CAS, the improvement compared to the current
solution is so considerable, that you should not hesitate to apply the patch.
Comment 11 Regina Henschel 2008-12-03 19:06:34 UTC
Created attachment 58481 [details]
test document to compare new and old values
Comment 12 Regina Henschel 2008-12-03 19:08:26 UTC
Created attachment 58482 [details]
patch for source/ui/src/scfuncs.src based on odff05
Comment 13 Regina Henschel 2008-12-03 19:09:31 UTC
Created attachment 58483 [details]
patch for source/core/inc/interpre.hxx based on odff05
Comment 14 Regina Henschel 2008-12-03 19:10:43 UTC
Created attachment 58484 [details]
patch for souce/core/tool/interpr3.cxx based on odff05
Comment 15 ooo 2008-12-04 23:36:10 UTC
In cws odff05:

revision 264879
sc/source/core/inc/interpre.hxx
sc/source/core/tool/interpr3.cxx
sc/source/ui/src/scfuncs.src

This yields indeed a _much_ better precision than before.

I noticed that for unxlngi6 non-pro in the test case documents the
calculated values slightly differ from the ones copied to the "OOo"
column. This may be due to different compilers, optimizations et al.
Interestingly in most cases the calculated values were a little bit
closer to the MuPad values than the copied values, but only in the
second-last displayed digit or so. I'll recheck in a product build.
Comment 16 ooo 2008-12-11 14:07:08 UTC
Reassigning to QA for verification.
Comment 17 oc 2008-12-17 15:19:51 UTC
Created attachment 58896 [details]
Testdocuments for Test Case Specification
Comment 18 oc 2008-12-17 15:21:19 UTC
Created attachment 58899 [details]
TestCaseSpecification
Comment 19 oc 2008-12-17 15:21:50 UTC
verified in internal build cws_odff05
Comment 20 amy2008 2009-04-14 09:15:44 UTC
Verified in OOo310m9 on WinXP and Fedora9
Closing
Li Meiying