mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/regression] Add escape case if data is not suitable for regression
Change-Id: Ie2e028a5030e1b0d3f133efdde971645d5b4687b
This commit is contained in:
committed by
Émilie Feral
parent
b2d7ee800a
commit
f58633b03c
@@ -349,7 +349,12 @@ double Store::computeDeterminationCoefficient(int series, Poincare::Context * gl
|
||||
const int numberOfPairs = numberOfPairsOfSeries(series);
|
||||
for (int k = 0; k < numberOfPairs; k++) {
|
||||
// Difference between the observation and the estimated value of the model
|
||||
double residual = m_data[series][1][k] - yValueForXValue(series, m_data[series][0][k], globalContext);
|
||||
double evaluation = yValueForXValue(series, m_data[series][0][k], globalContext);
|
||||
if (std::isnan(evaluation) || std::isinf(evaluation)) {
|
||||
// Data Not Suitable for evaluation
|
||||
return NAN;
|
||||
}
|
||||
double residual = m_data[series][1][k] - evaluation;
|
||||
ssr += residual * residual;
|
||||
// Difference between the observation and the overall observations mean
|
||||
double difference = m_data[series][1][k] - mean;
|
||||
|
||||
Reference in New Issue
Block a user