2021-01-15 17:39:14 +00:00
|
|
|
// A regression line and confidence area
|
|
|
|
#ifndef REGRESSION_H
|
|
|
|
#define REGRESSION_H
|
|
|
|
|
|
|
|
#include "chartitem.h"
|
|
|
|
|
|
|
|
class StatsAxis;
|
2021-02-16 16:05:39 +00:00
|
|
|
class StatsTheme;
|
2021-01-15 17:39:14 +00:00
|
|
|
class StatsView;
|
|
|
|
|
|
|
|
struct regression_data {
|
|
|
|
double a,b;
|
|
|
|
double res2, r2, sx2, xavg;
|
|
|
|
int n;
|
|
|
|
};
|
|
|
|
|
|
|
|
class RegressionItem : public ChartPixmapItem {
|
|
|
|
public:
|
|
|
|
RegressionItem(StatsView &view, regression_data data, StatsAxis *xAxis, StatsAxis *yAxis);
|
|
|
|
~RegressionItem();
|
|
|
|
void updatePosition();
|
2021-01-19 10:18:10 +00:00
|
|
|
void setFeatures(bool regression, bool confidence);
|
2021-01-15 17:39:14 +00:00
|
|
|
private:
|
2021-02-16 16:05:39 +00:00
|
|
|
const StatsTheme &theme; // Initialized once in constructor
|
2021-01-15 17:39:14 +00:00
|
|
|
StatsAxis *xAxis, *yAxis;
|
|
|
|
regression_data reg;
|
2021-01-19 10:18:10 +00:00
|
|
|
bool regression, confidence;
|
2021-01-15 17:39:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|