Holds information about the removal of predictor variables from a parameter calculation.
More...
#include <rw/analytics/regcalc.h>
template<class T, class S>
class RWRemovePredictors< T, S >
Class RWRemovePredictors contains information regarding the removal of predictor variables from a base parameter calculation object's base calculation. The removal information must consist of the following:
- The new regression matrix. This is the regression matrix used in the parameter calculation object's base calculation with the predictors removed.
- 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 predictors removed in the form of a starting index and number to remove.
- Synopsis
#include <rw/analytics/regcalc.h>
- Example
#include <rw/analytics/lsqqr.h>
#include <rw/rstream.h>
int main()
{
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]" );
{
cout << "Parameter calculation for full model failed" <<
endl;
return 1;
}
cout << "Parameters for full model:" <<
observationVec, 2, 1 );
{
cout << "Parameter calculation for reduced model failed" <<
endl;
return 1;
}
cout << "Parameters for reduced model:" <<
return 0;
}
template<class T, class S>
template<class T, class S>
Copy constructor. Constructs a copy of r.
template<class T, class S>
Constructs an RWRemovePredictors object with the given regression matrix and observation vector. It assumes that the matrix r is obtained from the base calculations regression matrix by deleting numRemoved columns beginning with index startIndex, and that the observation vector o is identical to the base calculations. If setBaseToLast is true
, the base calculations regression matrix is set to r.
template<class T, class S>
Returns the number of predictors removed.
template<class T, class S>
Sets the number of predictors to be removed.
template<class T, class S>
template<class T, class S>
Returns the starting index.