Marsyas  0.6.0-alpha
/usr/src/RPM/BUILD/marsyas-0.6.0/src/marsyas/statistics.h
Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 2011 Eric Nichols <epnichols@gmail.com>
00003 **
00004 ** This program is free software; you can redistribute it and/or modify
00005 ** it under the terms of the GNU General Public License as published by
00006 ** the Free Software Foundation; either version 2 of the License, or
00007 ** (at your option) any later version.
00008 **
00009 ** This program is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 ** GNU General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU General Public License
00015 ** along with this program; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 */
00018 
00019 #if !defined(__statistics_h)
00020 #define __statistics_h
00021 
00022 
00023 #include <cmath>
00024 #include <cstdio>
00025 #include <vector>
00026 #include <limits>
00027 #include <marsyas/common_header.h>
00028 #include <marsyas/realvec.h>
00029 
00030 namespace Marsyas
00031 {
00039 class marsyas_EXPORT statistics
00040 {
00041 private:
00042   static mrs_real momentN(const realvec& zData, const realvec& weights, int n);
00043   static realvec zDataWeighted(const realvec& data, const realvec& weights, mrs_real mean);
00044 
00045 public:
00046 
00047   statistics();
00048   ~statistics();
00049 
00050   static mrs_real meanWeighted(const realvec& data, const realvec& weights);
00051   static mrs_real stddevWeighted(const realvec& data, const realvec& weights, mrs_real mean);
00052   static mrs_real varWeighted(const realvec& data, const realvec& weights, mrs_real mean);
00053   static mrs_real skewnessWeighted(const realvec& data, const realvec& weights, mrs_real mean);
00054   static mrs_real kurtosisWeighted(const realvec& data, const realvec& weights, mrs_real mean);
00055 };
00056 
00057 
00058 } //namespace Marsyas
00059 
00060 #endif //__statistics_h