34#ifndef STK_LINEARAAMODEL_H
35#define STK_LINEARAAMODEL_H
43#ifdef STK_AAMODELS_VERBOSE
133 bool run(
int const&
dim);
229{
if (p_regressor_)
delete p_regressor_;}
235 this->setDimension(dim);
263 p_reducer_->setData(*p_workData_);
267 this->computeProjectedCovariance();
268#ifdef STK_AAMODELS_VERBOSE
269 stk_cout <<
_T(
"In LinearAAModel::run(), reduction done.\n");
272 p_regressor_->setY(*p_workData_);
273 p_regressor_->setX(*p_reduced_);
276#ifdef STK_AAMODELS_VERBOSE
277 stk_cout <<
_T(
"In LinearAAModel::run(), regression done.\n");
279 this->computeModelParameters();
281 if (this->isStandardized()) { this->unstandardizeResults();}
282 else if (this->isCentered()){ this->uncenterResults();}
286 this->
msg_error_ =
_T(
"Error in LinearAAModel::run():\nWhat: ");
297 this->setDimension(dim);
308 p_reducer_->setData(*p_workData_);
312 this->computeProjectedCovariance();
313#ifdef STK_AAMODELS_VERBOSE
314 stk_cout <<
_T(
"In LinearAAModel::run(weights), reduction done.\n");
317 p_regressor_->setY(*p_workData_);
318 p_regressor_->setX(*p_reduced_);
321#ifdef STK_AAMODELS_VERBOSE
322 stk_cout <<
_T(
"In LinearAAModel::run(weights), regression done.\n");
324 this->computeModelParameters();
326 if (this->isStandardized()) { this->unstandardizeResults();}
327 else if (this->isCentered()){ this->uncenterResults();}
331 this->
msg_error_ =
_T(
"Error in LinearAAModel::run(weights): ");
353 , Array&
proj, Array& data
356 if (data.cols() != mu.range())
360#ifdef STK_AAMODELS_VERBOSE
365#ifdef STK_AAMODELS_VERBOSE
370#ifdef STK_AAMODELS_VERBOSE
374#ifdef STK_AAMODELS_DEBUG
378 data = data * (
proj *
proj.transpose());
381 for (
int j= data.beginCols();
j< data.endCols();
j++)
384 for (
int i= data.beginRows();
i< data.endRows();
i++)
This file define methods for displaying Arrays and Expressions.
In this file we declare the class GaussianAAModel for the auto-associative models.
In this file we define the GramSchmidt method.
In this file we define the interface base class ILinearReduct.
In this file we define the Normal probability law class.
#define STKERROR_NO_ARG(Where, Error)
#define STKRUNTIME_ERROR_NO_ARG(Where, Error)
In this file we define the MultidimRegression class.
#define stk_cerr
Standard stk error stream.
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
Sdk class for all library Exceptions.
virtual const String error() const
Returns a C-style character string describing the general cause of the current error.
Gaussian Auto-Associative models.
virtual void setWorkData(Array &workData)
Set a new working data set.
Array * p_residuals_
Array of the residuals: the data set is shared with p_regressor and set when the regression method is...
PointX const & std() const
Reducer * p_reducer_
pointer on the reeducer.
Array * p_workData_
Array of the local data set.
void reductionStep()
compute the reduction of the data set and store the result in the p_reduced_ container.
Array * p_reduced_
Array of the reduced data set : the data set is shared with p_reducer and set when the regression met...
void regressionStep()
compute the regression of the original data set and set the results in p_predicted and p_residuals.
Regressor * p_regressor_
pointer on the regression method.
Array * p_predicted_
Array of the predicted data set: the data set is shared with p_regressor and set when the regression ...
virtual bool run()
run the computations.
String msg_error_
String with the last error message.
String const & error() const
get the last error message.
Abstract class for all classes making unsupervised learning.
virtual void setData(Array const *p_data)
Set the data set.
Interface base class for all the univariate distributions.
A Linear AutoAssociative Model (LAAM) is a generalization of the PCA model for projecting variables o...
virtual bool run()
run the estimation of the AA model.
static void simul(const Law::IUnivLaw< Real > &law, VectorX const &mu, Real const &std, Array &proj, Array &data)
Simulate a centered auto-associative linear model in of the form.
virtual LinearAAModel * clone() const
clone pattern
GaussianAAModel< Array > Base
IRunnerUnsupervised< Array, VectorX > Runner
virtual ~LinearAAModel()
Virtual destructor.
Array workData_
working data set;
LinearAAModel(Array const &data)
constructor.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
virtual bool regressionStep()
compute the regression function.
void gramSchmidt(ArrayBase< TContainer2D > &A)
The gramSchmidt method perform the Gram Schmidt orthonormalization of an Array of Real.
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.