[statistics] chi-square test with boost
Hello, I have to implement chi square tests. As I already use the boost library boost_1_38 for other purposes, I would like to use it for this purpose too. However I can find no documentation relative to this or the information I find is not correct. Can somebody indicate me how I can to use accumulators/statistics ? Is the boost_1_38 appropriate ? Which file should I include and which function should I use ? I just need to specify the columns in a matrix I wish to test for independence, the data itself and a threshold alpha. I would like the test statistic in return, as well as the p-value. If my question is not the object of this diffusion list, please tell me. Thank you in advance. Regards.
Christine SINOQUET wrote:
Hello,
I have to implement chi square tests. As I already use the boost library boost_1_38 for other purposes, I would like to use it for this purpose too. However I can find no documentation relative to this or the information I find is not correct.
Can somebody indicate me how I can to use accumulators/statistics ? Is the boost_1_38 appropriate ? Which file should I include and which function should I use ?
I just need to specify the columns in a matrix I wish to test for independence, the data itself and a threshold alpha. I would like the test statistic in return, as well as the p-value.
If my question is not the object of this diffusion list, please tell me.
Thank you in advance.
Regards.
I tend to find Boost.Accumulators most useful when you want to compute a statistics in a sequential fashion say for n = 10, 20, 30. In your case, Boost.Accumulators would be useful to update a contingency table as observations are accumulated. The actual statistics would be in a separate "feature" that depends on the former (that's the beauty of Boost.Acc). You can find an example along those lines for the kolmogorov statistic: https://svn.boost.org/svn/boost/sandbox/statistics/non_parametric/boost/stat... If you already have a contingency table (as seems the case from your question) I can only suggest to compute the statistics (std::accumulate?) and and compare it to its critical value using http://www.boost.org/doc/libs/1_40_0/libs/math/doc/sf_and_dist/html/math_too... HTH, but if it's too trivial, better safe than sorry.
In your case, Boost.Accumulators would be useful to update a contingency table as observations are accumulated. The actual statistics would be in
Please find such an accumulator here: http://svn.boost.org/svn/boost/sandbox/statistics/non_parametric/boost/stati... An example side by side with R code https://svn.boost.org/svn/boost/sandbox/statistics/non_parametric/libs/stati... Warning : tested under OSX only, for now. This has necessitated extensions: http://svn.boost.org/svn/boost/sandbox/statistics/support/boost/accumulators... http://svn.boost.org/svn/boost/sandbox/statistics/support/boost/fusion/ http://svn.boost.org/svn/boost/sandbox/statistics/support/boost/mpl/ May the authors of the relevant library please notify me if they think feature requests are warranted? Thanks.
Hi Erwann, On 5/30/2010 12:47 PM, er wrote:
In your case, Boost.Accumulators would be useful to update a contingency table as observations are accumulated. The actual statistics would be in
Please find such an accumulator here: http://svn.boost.org/svn/boost/sandbox/statistics/non_parametric/boost/stati...
From just a glance it looks like it could be useful, but it's too much for me to digest. It will certainly needs docs and tests. Perhaps that would help.
An example side by side with R code https://svn.boost.org/svn/boost/sandbox/statistics/non_parametric/libs/stati...
Warning : tested under OSX only, for now.
This has necessitated extensions: http://svn.boost.org/svn/boost/sandbox/statistics/support/boost/accumulators...
I don't see what changed to weighted_count.hpp besides your changing the comment at the top to "factor.hpp", deleting my copyright (!!!), and commenting out the weighted_count_of_variates features and extractor. And what is the purpose of unpack_depends_on.hpp?
http://svn.boost.org/svn/boost/sandbox/statistics/support/boost/fusion/ http://svn.boost.org/svn/boost/sandbox/statistics/support/boost/mpl/
May the authors of the relevant library please notify me if they think feature requests are warranted?
Thanks.
-- Eric Niebler BoostPro Computing http://www.boostpro.com
On 5/31/10 12:47 AM, er wrote:
This has necessitated extensions: http://svn.boost.org/svn/boost/sandbox/statistics/support/boost/accumulators...
http://svn.boost.org/svn/boost/sandbox/statistics/support/boost/fusion/ http://svn.boost.org/svn/boost/sandbox/statistics/support/boost/mpl/
May the authors of the relevant library please notify me if they think feature requests are warranted?
Looks good to me. Are there docs and tests? Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Christine SINOQUET Sent: Tuesday, March 30, 2010 2:53 PM To: boost-users@lists.boost.org Subject: [Boost-users] [statistics] chi-square test with boost
I have to implement chi square tests. As I already use the boost library boost_1_38 for other purposes, I would like to use it for this purpose too. However I can find no documentation relative to this or the information I find is not correct.
(If you download the latest version 1_42) You will find some code to calculate and use many statistical distributions documented at http://www.boost.org/doc/libs/1_42_0/libs/math/doc/sf_and_dist/html/index.ht... It includes several fully worked and documented examples of using the chi_sqr distribution, and links to the source code.
Can somebody indicate me how I can to use accumulators/statistics ?
How you do this using the accumulator library, I am not qualified to advise. HTH Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com
I have to implement chi square tests. As I already use the boost library boost_1_38 for other purposes, I would like to use it for this purpose too. However I can find no documentation relative to this or the information I find is not correct.
Is this what you're looking for: http://www.boost.org/doc/libs/1_42_0/libs/math/doc/sf_and_dist/html/math_too... John.
participants (6)
-
Christine SINOQUET
-
er
-
Eric Niebler
-
Joel de Guzman
-
John Maddock
-
Paul A. Bristow