Issue 91547 - ODFF: enhance BETADIST to support probability density function
Summary: ODFF: enhance BETADIST to support probability density function
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: programming (show other issues)
Version: DEV300m20
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: oc
QA Contact: issues@sc
URL:
Keywords:
Depends on: 91602
Blocks:
  Show dependency tree
 
Reported: 2008-07-10 14:38 UTC by Regina Henschel
Modified: 2013-08-07 15:14 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
necessary changes in header file for new functions (1007 bytes, text/plain)
2008-07-18 23:02 UTC, Regina Henschel
no flags Details
changes for BETADIST (12.96 KB, text/plain)
2008-07-18 23:03 UTC, Regina Henschel
no flags Details
changes for new BetaDist (1.60 KB, text/plain)
2008-08-22 22:53 UTC, Regina Henschel
no flags Details
version with ASYM for x near mean and alpha,beta large (19.17 KB, text/plain)
2008-08-22 22:54 UTC, Regina Henschel
no flags Details
Same testcases, the blue values are correct (42.40 KB, application/vnd.oasis.opendocument.spreadsheet)
2008-08-22 22:58 UTC, Regina Henschel
no flags Details
testcases for the density cases (25.05 KB, application/vnd.oasis.opendocument.spreadsheet)
2008-08-22 23:00 UTC, Regina Henschel
no flags Details
test document to compare new and old values (42.28 KB, text/plain)
2008-12-03 19:06 UTC, Regina Henschel
no flags Details
patch for source/ui/src/scfuncs.src based on odff05 (846 bytes, text/plain)
2008-12-03 19:08 UTC, Regina Henschel
no flags Details
patch for source/core/inc/interpre.hxx based on odff05 (1014 bytes, text/plain)
2008-12-03 19:09 UTC, Regina Henschel
no flags Details
patch for souce/core/tool/interpr3.cxx based on odff05 (11.82 KB, text/plain)
2008-12-03 19:10 UTC, Regina Henschel
no flags Details
Testdocuments for Test Case Specification (41.27 KB, application/vnd.oasis.opendocument.spreadsheet)
2008-12-17 15:19 UTC, oc
no flags Details
TestCaseSpecification (6.29 KB, text/html)
2008-12-17 15:21 UTC, oc
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
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