STK++ 1.0
STK::AAModelFactory Class Reference

@ More...

#include <STK_AAModelFactory.h>

Inheritance diagram for STK::AAModelFactory:

List of all members.

Public Member Functions

 AAModelFactory (Matrix const *p_data)
 Constructor.
virtual ~AAModelFactory ()
 virtual destuctor.
bool isCentered () const
 is the data set centered ?
bool isStandardized () const
 is the data set standardized ?
Point const & mean () const
 get the mean of the data set
Point const & std () const
 get the standard deviation of the data set
virtual bool run (Integer const &dim)
 run the estimation of the AA model.
virtual bool run (Vector const &weights, Integer const &dim)
 run the estimation of the weighted AA model.
void center ()
 center the data set.
void center (Vector const &weights)
 weighted centering of the data set.
void standardize ()
 standardize the data set.
void standardize (Vector const &weights)
 weighted standardization the data set.

Protected Attributes

Point mean_
 vector of the means
Point std_
 vector of the standard deviation
bool isCentered_
 a boolean true if the data set is centered, false otherwise
bool isStandardized_
 a boolean true if the data set is standardized, false otherwise

Detailed Description

@

Utility class for the AutoAssociative models.

The AAModel factory allow to center and to standradize the data set before the computation of the model. The results are then restablished after estimation.

Definition at line 51 of file STK_AAModelFactory.h.


Constructor & Destructor Documentation

STK::AAModelFactory::AAModelFactory ( Matrix const *  p_data)

Constructor.

Parameters:
p_dataa pointer on the data set to process

Definition at line 50 of file STK_AAModelFactory.cpp.

                              : IAAModel(p_data)
                              , mean_()
                              , std_()
                              , isCentered_(false)
                              , isStandardized_(false)
{ }
STK::AAModelFactory::~AAModelFactory ( ) [virtual]

virtual destuctor.

Definition at line 59 of file STK_AAModelFactory.cpp.

{ }

Member Function Documentation

bool STK::AAModelFactory::isCentered ( ) const [inline]

is the data set centered ?

Returns:
true if the data set is centered, false otherwise

Definition at line 65 of file STK_AAModelFactory.h.

References isCentered_.

{ return isCentered_;}
bool STK::AAModelFactory::isStandardized ( ) const [inline]

is the data set standardized ?

Returns:
true if the data set is standardized, false otherwise

Definition at line 69 of file STK_AAModelFactory.h.

References isStandardized_.

{ return isStandardized_;}
Point const& STK::AAModelFactory::mean ( ) const [inline]

get the mean of the data set

Returns:
the mean of the data set

Definition at line 74 of file STK_AAModelFactory.h.

References mean_.

{ return mean_;}
Point const& STK::AAModelFactory::std ( ) const [inline]

get the standard deviation of the data set

Returns:
the standard deviation of the data set

Definition at line 78 of file STK_AAModelFactory.h.

References std_.

{ return std_;}
bool STK::AAModelFactory::run ( Integer const &  dim) [virtual]

run the estimation of the AA model.

The behavior of the estimation is the following :

  • compute the projected data set and set the result in p_reduced_
  • regress the workData_ set using the p_reduced_ set as predictors
  • compute the restored data set using the AA model and set the result in the p_predicted_ container.
  • compute the residuals The data have to be centered before running the computations.
    Parameters:
    dimthe dimension of the AA Model

Reimplemented from STK::IAAModel.

Definition at line 64 of file STK_AAModelFactory.cpp.

References STK::Stat::decenter(), STK::Stat::destandardize(), STK::IRunnerBase::error(), isCentered_, isStandardized_, mean_, STK::IRunnerBase::msg_error_, STK::IAAModel::p_reduced_, STK::IAAModel::p_reductor_, STK::IAAModel::p_workData_, STK::IAAModel::run(), STK::IReduct::setData(), and std_.

{
  // set data to reductor
  p_reductor_->setData(p_workData_);
  // compute AAM
  if (!IAAModel::run(dim))
  {
    return false;
  }
  try
  {
    // check if data have been standardized or centered
    if (isStandardized_) Stat::destandardize(*p_reduced_, mean_, std_);
    else
      if (isCentered_)  Stat::decenter(*p_reduced_, mean_);
  }
  catch (std::exception error)
  {
    msg_error_ = error.what();
    return false;
  }
  return true;
}
bool STK::AAModelFactory::run ( Vector const &  weights,
Integer const &  dim 
) [virtual]

run the estimation of the weighted AA model.

The behavior of the estimation is the following :

  • compute the projected data set and set the result in p_reduced_
  • regress the data set using the reduced data set as predictors
  • compute the restored data set using the AA model and set the result in the p_predicted_ container
  • compute the residuals and set them in p_residual_ The data have to be centered before running the computations.
    Parameters:
    dimthe dimension of the AA Model
    p_weightsthe container of the weights

Reimplemented from STK::IAAModel.

Definition at line 90 of file STK_AAModelFactory.cpp.

References STK::Stat::decenter(), STK::Stat::destandardize(), STK::IRunnerBase::error(), isCentered_, isStandardized_, mean_, STK::IRunnerBase::msg_error_, STK::IAAModel::p_reduced_, STK::IAAModel::p_reductor_, STK::IAAModel::p_workData_, STK::IAAModel::run(), STK::IReduct::setData(), and std_.

{
  // set data to reductor
  p_reductor_->setData(p_workData_);
  // compute AAM
  if (!IAAModel::run(weights, dim)) { return false;}
  try
  {
  // check if data have been standardized or centered
  if (isStandardized_) Stat::destandardize(*p_reduced_, mean_, std_);
  else
    if (isCentered_)  Stat::decenter(*p_reduced_, mean_);
  }
  catch (std::exception error)
  {
    msg_error_ = error.what();
    return false;
  }
  return true;
}
void STK::AAModelFactory::center ( )

center the data set.

Definition at line 112 of file STK_AAModelFactory.cpp.

References STK::Stat::decenter(), isCentered_, mean_, and STK::IAAModel::p_workData_.

Referenced by center().

void STK::AAModelFactory::center ( Vector const &  weights)

weighted centering of the data set.

Parameters:
theweights of the samples

Definition at line 136 of file STK_AAModelFactory.cpp.

References center(), STK::Stat::decenter(), isCentered_, mean_, and STK::IAAModel::p_workData_.

void STK::AAModelFactory::standardize ( )
void STK::AAModelFactory::standardize ( Vector const &  weights)

weighted standardization the data set.

Parameters:
theweights of the samples

Definition at line 148 of file STK_AAModelFactory.cpp.

References STK::Stat::destandardize(), isStandardized_, mean_, STK::IAAModel::p_workData_, standardize(), and std_.


Member Data Documentation

vector of the means

Definition at line 120 of file STK_AAModelFactory.h.

Referenced by center(), mean(), run(), and standardize().

vector of the standard deviation

Definition at line 122 of file STK_AAModelFactory.h.

Referenced by run(), standardize(), and std().

a boolean true if the data set is centered, false otherwise

Definition at line 124 of file STK_AAModelFactory.h.

Referenced by center(), isCentered(), and run().

a boolean true if the data set is standardized, false otherwise

Definition at line 126 of file STK_AAModelFactory.h.

Referenced by isStandardized(), run(), and standardize().


The documentation for this class was generated from the following files: