Holds information about the addition of predictor variables to a parameter calculation.
More...
template<class T, class S>
class RWAddPredictors< T, S >
Class RWAddPredictors holds information about the addition of predictor variables to a parameter calculation object's base calculation. This information must consist of the following:
- The new regression matrix. This is the regression matrix used in the parameter calculation's objects base calculation with the predictors to be added appended.
- The new observation vector. This is assumed to be the same as the observation vector used in the parameter calculation object's base calculation.
- The number of predictors added.
- Synopsis
#include <rw/analytics/regcalc.h>
Holds information about the addition of predictor variables to a parameter calculation.
Definition regcalc.h:210
- Example
#include <rw/analytics/lsqqr.h>
#include <rw/rstream.h>
int main() {
"6x3 ["
" 1 1.3 .54"
" 1 3.5 .65"
" 1 -2.3 .88"
" 1 8.2 .76"
" 1 -4.2 .32"
" 1 2.4 .43"
"]");
44.1 32.5 65.2]" );
calcObject.
setBaseCalc( reducedRegMat, observationVec );
{
cout << "Parameter calculation for reduced model failed" << endl;
return 1;
}
cout << "Parameters for reduced model:" <<
observationVec, 1 );
{
cout << "Parameter calculation for full model failed" << endl;
return 1;
}
cout << "Parameters for full model:" <<
return 0;
}
A templatized general matrix class.
Definition genmat.h:741
Calculates linear regression parameters using QR decomposition.
Definition lsqqr.h:68
virtual void setBaseCalc(const RWGenMat< double > &, const RWMathVec< double > &)
virtual void addPredToBaseCalc(const RWAddPredictors< double, double > &dataChange)
virtual RWMathVec< double > parameters(void) const
virtual bool fail(void) const
Definition lsqqr.h:99
A templatized vector class.
Definition mathvec.h:667
Represents an index that can be used for subscripting vectors, matrices, and arrays.
Definition rwslice.h:105