ContingencyTable.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef _ContingencyTable_h_
  2. #define _ContingencyTable_h_
  3. /* ContingencyTable.h
  4. *
  5. * Copyright (C) 1993-2018 David Weenink
  6. *
  7. * This code is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * This code is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #include "TableOfReal.h"
  21. #include "Confusion.h"
  22. Thing_define (ContingencyTable, TableOfReal) {
  23. void v_info ()
  24. override;
  25. };
  26. // Precondition: All entries in a ContingencyTable are nonnegative numbers
  27. autoContingencyTable ContingencyTable_create (integer numberOfRows, integer numberOfColumns);
  28. double ContingencyTable_chisqProbability (ContingencyTable me);
  29. double ContingencyTable_cramersStatistic (ContingencyTable me);
  30. double ContingencyTable_contingencyCoefficient (ContingencyTable me);
  31. void ContingencyTable_chisq (ContingencyTable me, double *out_chisq, double *out_df);
  32. void ContingencyTable_getEntropies (ContingencyTable me, double *out_h, double *out_hx, double *out_hy, double *out_hygx, double *out_hxgy, double *out_uygx, double *out_uxgy, double *out_uxy);
  33. autoContingencyTable Confusion_to_ContingencyTable (Confusion me);
  34. autoContingencyTable TableOfReal_to_ContingencyTable (TableOfReal me);
  35. #endif // _ContingencyTable_h_