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// SedSAT3 – Sediment Source Assessment Tool, version 3
2// U.S. Geological Survey. See LICENSE.md and DISCLAIMER.md in the repository root.
3
4#ifndef MULTIPLELINEARREGRESSION_H
5#define MULTIPLELINEARREGRESSION_H
6
7#include "interface.h"
8#include "cmbmatrix.h"
9
11
13{
14public:
18 double Regress(const vector<vector<double>> &independent, const vector<double>& dependent, const vector<string> &indep_vars_names);
19 double SSE_reduced_model(const vector<vector<double>> &independent, const vector<double>& dependent, int eliminated_var);
20 QJsonObject toJsonObject() const override;
21 string ToString() const override;
22 bool ReadFromJsonObject(const QJsonObject &jsonobject) override;
31 vector<double> &IndependentData(const string &var_name);
36 double MeanIndependentVar(int i);
37 double GeoMeanIndependentVar(int i);
41 void SetEffective(int i, bool eff) {make_effective[i] = eff;}
42 bool Effective(int i) const {return make_effective[i];}
45 regressionEquation = form;
46 }
47 void SetPValueThreshold(const double &p) {
49 }
51 {
52 return p_value_threshold;
53 }
54private:
61 double chisq{}, R2{}, R2_adj{};
63 double p_value_threshold = 0.05;
66};
67
68#endif // MULTIPLELINEARREGRESSION_H
Matrix class with labeled rows and columns for Chemical Mass Balance analysis.
Definition cmbmatrix.h:22
Interface()
Default constructor.
Definition interface.cpp:6
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)
double SSE_reduced_model(const vector< vector< double > > &independent, const vector< double > &dependent, int eliminated_var)
void SetDependentVariableName(const string &name)
double Regress(const vector< vector< double > > &independent, const vector< double > &dependent, const vector< string > &indep_vars_names)
void SetPValueThreshold(const double &p)
string ToString() const override
Convert object to string representation.
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
STL class.