SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
multiplelinearregression.h
Go to the documentation of this file.
1#ifndef MULTIPLELINEARREGRESSION_H
2#define MULTIPLELINEARREGRESSION_H
3
4#include "interface.h"
5#include "cmbmatrix.h"
6
8
10{
11public:
15 double Regress(const vector<vector<double>> &independent, const vector<double> dependent, const vector<string> &indep_vars_names);
16 double SSE_reduced_model(const vector<vector<double>> &independent, const vector<double> dependent, int eliminated_var);
17 QJsonObject toJsonObject() const override;
18 string ToString() const override;
19 bool ReadFromJsonObject(const QJsonObject &jsonobject) override;
20 vector<double> CoefficientsIntercept() const;
21 vector<string> &GetIndependentVariableNames() {
23 }
24 vector<string> GetIndependentVariableNames() const
25 {
27 }
28 vector<double> &IndependentData(const string &var_name);
29 vector<double> &DependentData()
30 {
31 return dependent_data;
32 }
33 double MeanIndependentVar(int i);
34 double GeoMeanIndependentVar(int i);
37 vector<double> P_Value() {return p_value;}
38 void SetEffective(int i, bool eff) {make_effective[i] = eff;}
39 bool Effective(int i) const {return make_effective[i];}
42 regressionEquation = form;
43 }
44 void SetPValueThreshold(const double &p) {
46 }
48 {
49 return p_value_threshold;
50 }
51private:
53 vector<vector<double>> independent_data;
54 vector<double> dependent_data;
58 double chisq, R2, R2_adj;
59 vector<double> p_value;
60 double p_value_threshold = 0.05;
61 vector<bool> make_effective;
63};
64
65#endif // MULTIPLELINEARREGRESSION_H
Matrix class with labeled rows and columns for Chemical Mass Balance analysis.
Definition cmbmatrix.h:19
Abstract base class providing common serialization and visualization interface.
Definition interface.h:65
regression_form Equation() const
vector< string > & GetIndependentVariableNames()
QJsonObject toJsonObject() const override
Serialize object to JSON format.
vector< double > & IndependentData(const string &var_name)
vector< string > GetIndependentVariableNames() const
MultipleLinearRegression & operator=(const MultipleLinearRegression &mp)
void SetDependentVariableName(const string name)
double SSE_reduced_model(const vector< vector< double > > &independent, const vector< double > dependent, int eliminated_var)
void SetPValueThreshold(const double &p)
string ToString() const override
Convert object to string representation.
double Regress(const vector< vector< double > > &independent, const vector< double > dependent, const vector< string > &indep_vars_names)
void SetEffective(int i, bool eff)
vector< double > CoefficientsIntercept() const
bool ReadFromJsonObject(const QJsonObject &jsonobject) override
Deserialize object from JSON format.
void SetEquation(regression_form form)
vector< vector< double > > independent_data
vector< string > independent_variables_names