D22163: Unit Testing of Two Sample Independent TTest

Stefan Gerlach noreply at phabricator.kde.org
Mon Jul 1 15:07:52 BST 2019


sgerlach added inline comments.

INLINE COMMENTS

> HypothesisTest.cpp:1073
>  		case HypothesisTest::Test::Tail::Two: {
> -			pValue = 2.*gsl_cdf_tdist_P(value, df);
> +			pValue = 2.*gsl_cdf_tdist_P(-1*abs(value), df);
>  

fabs instead of abs.
why "-1*" instead of just "-"?

> TTestTest.cpp:40
> +
> +	// This data set is taken from "JASP"
> +	QVector<double> col1Data = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};

add comment: "first sample"

> TTestTest.cpp:48
> +
> +	// This data set is taken from "JASP"
> +	col1Data = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

add comment "second sample"

> TTestTest.cpp:53
> +	pValue_expected = 0.028;
> +	QTest::newRow("directed control activities") << col1Data << col2Data << tValue_expected << pValue_expected;
> +}

add space before

> TTestTest.cpp:86
> +
> +	qDebug() << "tValue is " << tValue;
> +	qDebug() << "pValue is: " << pValue;

Can you use the DEBUG() macro instead of qDebug()?
QDEBUG("tValue is " << tValue)

> TTestTest.cpp:91
> +
> +	FuzzyCompare(tValue, tValue_expected, (0.01) / abs(tValue));
> +	FuzzyCompare(pValue, pValue_expected, (0.01) / abs(pValue));

using an absolute error of 0.01 depends heavily on tValue. Why is the error so big? Can you use relative errors instead?

> TTestTest.cpp:138
> +
> +	qDebug() << "tValue is " << tValue;
> +	qDebug() << "pValue is: " << pValue;

DEBUG()?

> TTestTest.cpp:143
> +
> +	FuzzyCompare(tValue, tValue_expected, (0.01) / abs(tValue));
> +	FuzzyCompare(pValue, pValue_expected, (0.01) / abs(pValue));

see above

> TTestTest.cpp:158
> +	QVector<double> col1Data = {13.2, 8.58, 14.08, 8.58, 10.56, 14.74, 7.92, 13.2, 12.76, 5.72, 11.66, 7.04, 3.08, 15.62, 14.3, 5.5};
> +	// weight after;
> +	double populationMean = 16;

check comment

> TTestTest.cpp:190
> +
> +	qDebug() << "tValue is " << tValue;
> +	qDebug() << "pValue is: " << pValue;

DEBUG()?

> TTestTest.cpp:195
> +
> +	FuzzyCompare(tValue, tValue_expected, (0.01) / abs(tValue));
> +	FuzzyCompare(pValue, pValue_expected, (0.01) / abs(pValue));

see above

REPOSITORY
  R262 LabPlot

REVISION DETAIL
  https://phabricator.kde.org/D22163

To: devanshuagarwal, sgerlach, asemke
Cc: asemke, kde-edu, sgerlach, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20190701/1e89a606/attachment-0001.html>


More information about the kde-edu mailing list