mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[apps/regression] Use a new helper to compute linear regression coefficients
This commit is contained in:
committed by
Léa Saviot
parent
13c63f495c
commit
ea4dd33826
17
apps/regression/linear_model_helper.cpp
Normal file
17
apps/regression/linear_model_helper.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "linear_model_helper.h"
|
||||
|
||||
namespace Regression {
|
||||
|
||||
namespace LinearModelHelper {
|
||||
|
||||
double Slope(double covariance, double variance) {
|
||||
return covariance / variance;
|
||||
}
|
||||
|
||||
double YIntercept(double meanOfY, double meanOfX, double slope) {
|
||||
return meanOfY - slope * meanOfX;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user