Correlation Coefficient (Pearson's r, Kendall Rank, Spearman Rank)
AcceptedPublic

Authored by devanshuagarwal on Jul 21 2019, 2:44 PM.

Details

Reviewers
sgerlach
asemke
Summary

I have added both frontend and backend for the correlation coefficient.

Diff Detail

Repository
R262 LabPlot
Lint
Lint Skipped
Unit
Unit Tests Skipped
devanshuagarwal created this object with edit policy "Administrators".
Restricted Application added a project: KDE Edu. · View Herald TranscriptJul 21 2019, 2:44 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
devanshuagarwal requested review of this revision.Jul 21 2019, 2:44 PM
sgerlach added inline comments.Jul 22 2019, 11:58 AM
src/backend/generalTest/CorrelationCoefficient.h
36

are all of them needed?

src/backend/generalTest/HypothesisTest.cpp
158

<= contradicts error message. Can std be < 0? (fix everywhere)

159

"atleast" -> "at least" (fix everywhere)

src/kdefrontend/dockwidgets/CorrelationCoefficientDock.cpp
483

you can combine all conditions in one if-statement

devanshuagarwal marked 2 inline comments as done.Jul 22 2019, 4:29 PM
devanshuagarwal added inline comments.
src/backend/generalTest/CorrelationCoefficient.h
36

Thanks, I removed unnecessary ones.

src/backend/generalTest/HypothesisTest.cpp
158

No std cant be < 0.

In starting I wrote

if (std[i] == 0) {
}

but then it shows warning.
Comparing floating point with == or != is unsafe.

Hence I have used <=

sgerlach added inline comments.Jul 22 2019, 4:35 PM
src/backend/generalTest/HypothesisTest.cpp
158

you should do a floating point comparison like "std[i] < DBL_MIN" or use gsl_fcmp().

devanshuagarwal marked an inline comment as done.Aug 7 2019, 6:14 PM
devanshuagarwal marked 4 inline comments as done.Aug 11 2019, 7:04 PM
sgerlach accepted this revision.Aug 16 2019, 7:30 AM
This revision is now accepted and ready to land.Aug 16 2019, 7:30 AM