STK++ 0.9.13
STK_KernelParameters.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------*/
2/* Copyright (C) 2004-2017 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::Clustering
27 * created on: Sep 8, 2017
28 * Author: iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29 **/
30
37#ifndef STK_KERNELPARAMETERS_H
38#define STK_KERNELPARAMETERS_H
39
40#include "../STK_Clust_Util.h"
41
44
46
47namespace STK
48{
52template<>
53struct ModelParameters<Clust::Kmm_s_>
54{
59
64
68 ModelParameters(int nbCluster);
72 ModelParameters( ModelParameters const& param);
75
77 inline Real const& sigma2(int k) const { return sigma2_;}
79 inline Real const& dim(int k) const { return dim_[k];}
80
82 void updateStatistics();
84 void setStatistics();
86 void releaseStatistics();
87
93 template<class Array>
95 {
96 sigma2_ = 0.;
97 for(int k=dim_.begin(); k<dim_.end(); ++k)
98 { sigma2_ += params(k, baseIdx) ;
99 dim_[k] = params(k, baseIdx+1);
100 }
101 sigma2_ /= dim_.size();
102 }
103};
104
108template<>
109struct ModelParameters<Clust::Kmm_sk_>
110{
119
123 ModelParameters(int nbCluster);
127 ModelParameters( ModelParameters const& param);
130
132 inline Real const& sigma2(int k) const { return sigma2_[k];}
134 inline Real const& dim(int k) const { return dim_[k];}
135
137 void updateStatistics();
139 void setStatistics();
141 void releaseStatistics();
142
148 template<class Array>
150 {
151 for(int k=dim_.begin(); k<dim_.end(); ++k)
152 { sigma2_[k] = params(k, baseIdx) ;
153 dim_[k] = params(k, baseIdx+1);
154 }
155 }
156};
157
158} // namespace STK
159
160#endif /* STK_KERNELPARAMETERS_H */
In this file we define and implement the final class Array1D.
In this file we implement the final class CArrayPoint.
This file contain the definition and implementation of the Online classes.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
const int baseIdx
base index of the containers created in STK++.
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.
Stat::Online< Real, Real > stat_sigma2_
sigma2 statistics
Real sigma2_
variance of the variables
Array1D< Stat::Online< Real, Real > > stat_dim_
Array of the dim statistics.
CPointX dim_
dimension of the gaussian kernel
void setParameters(ExprBase< Array > const &params)
Set the parameters of the mixture model.
Array1D< Stat::Online< Real, Real > > stat_sigma2_
Array of the sigma2 statistics.
CPointX dim_
dimension of the gaussian kernel
Array1D< Stat::Online< Real, Real > > stat_dim_
Array of the dim statistics.
CPointX sigma2_
variance of the variables
void setParameters(ExprBase< Array > const &params)
Set the parameters of the mixture model.
struct storing the parameters of the mixture.