STK++ 0.9.13
STK_PenCriterion.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------*/
2/* Copyright (C) 2004-2016 Serge Iovleff, Université Lille 1, Inria
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to the
16 Free Software Foundation, Inc.,
17 59 Temple Place,
18 Suite 330,
19 Boston, MA 02111-1307
20 USA
21
22 Contact : S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
23*/
24
25/*
26 * Project: stkpp::Model
27 * created on: 22 juil. 2011
28 * Purpose: define the Interface base class ICriterion.
29 * Author: iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
30 *
31 **/
32
37#ifndef STK_PENCRITERION_H
38#define STK_PENCRITERION_H
39#include <Sdk.h>
40
41#include "STK_IStatModelBase.h"
42
43namespace STK
44{
51{
52 protected:
54 inline ICriterion() : p_model_(), value_(Arithmetic<Real>::NA()) {}
64 : p_model_(&model), value_(Arithmetic<Real>::NA()) {}
70
71 public:
73 inline virtual ~ICriterion() {}
75 inline Real const& value() const { return value_;}
77 inline void setModel( IStatModelBase const* p_model) { p_model_ = p_model;}
79 inline void setModel( IStatModelBase const& model) { p_model_ = &model;}
80
81 protected:
86};
87
98{
99 public:
115 inline virtual ~AICCriterion() {}
117 inline AICCriterion* clone() const { return new AICCriterion(*this);}
119 virtual bool run();
120};
121
122//* Compute AIC Criterion */
123inline bool AICCriterion::run()
124{
125 if (!p_model_)
127 return false;
128 }
130 return true;
131}
132
143{
144 public:
160 inline virtual ~BICCriterion() {}
162 inline BICCriterion* clone() const { return new BICCriterion(*this);}
164 virtual bool run();
165};
166
167//* Compute BIC Criterion */
168inline bool BICCriterion::run()
169{
170 if (!p_model_)
172 return false;
173 }
175 return true;
176}
177} // namespace STK
178
179#endif
In this file we define the interface base class IStatModelBase.
#define STKERROR_NO_ARG(Where, Error)
Definition STK_Macros.h:49
This file include all the other header files of the project Sdk.
Derived class of Criterion for computing the AIC Criterion The AIC criteria is a penalization of the ...
AICCriterion()
Default Constructor.
virtual ~AICCriterion()
virtual destructor.
AICCriterion(AICCriterion const &criterion)
copy Constructor.
AICCriterion * clone() const
clone pattern
AICCriterion(IStatModelBase const &model)
Constructor.
virtual bool run()
implementation of the virtual method run
AICCriterion(IStatModelBase *const p_model)
Constructor.
Derived class of Criterion for computing the BIC Criterion The Bic criteria is a penalization of the ...
BICCriterion(BICCriterion const &criterion)
copy Constructor.
BICCriterion * clone() const
clone pattern
BICCriterion()
Default Constructor.
virtual bool run()
implementation of the virtual method run
BICCriterion(IStatModelBase *const p_model)
Constructor.
BICCriterion(IStatModelBase const &model)
Constructor.
virtual ~BICCriterion()
virtual destructor.
Interface base class for the selection model criterion.
void setModel(IStatModelBase const &model)
ICriterion()
Default Constructor.
virtual ~ICriterion()
Destructor.
Real value_
Computed value of the criterion.
Real const & value() const
void setModel(IStatModelBase const *p_model)
ICriterion(ICriterion const &criterion)
copy Constructor.
ICriterion(IStatModelBase const &model)
Constructor.
ICriterion(IStatModelBase const *p_model)
Constructor.
IStatModelBase const * p_model_
The current statistical model to use.
Abstract base class for all classes having a.
Definition STK_IRunner.h:65
String msg_error_
String with the last error message.
Definition STK_IRunner.h:96
Interface base class for all Statistical Models.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.
Arithmetic properties of STK fundamental types.