yat  0.14.5pre
PearsonDistance.h
1 #ifndef theplu_yat_statistics_pearson_distance_h
2 #define theplu_yat_statistics_pearson_distance_h
3 
4 // $Id: PearsonDistance.h 3550 2017-01-03 05:41:02Z peter $
5 
6 /*
7  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson, Markus Ringnér
8  Copyright (C) 2010, 2016 Peter Johansson
9 
10  This file is part of the yat library, http://dev.thep.lu.se/yat
11 
12  The yat library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU General Public License as
14  published by the Free Software Foundation; either version 3 of the
15  License, or (at your option) any later version.
16 
17  The yat library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with yat. If not, see <http://www.gnu.org/licenses/>.
24 */
25 
26 #include "averager_traits.h"
27 #include "yat/utility/iterator_traits.h"
28 
29 namespace theplu {
30 namespace yat {
31 namespace statistics {
32 
39  {
58  template <typename ForwardIterator1, typename ForwardIterator2>
59  double operator()(ForwardIterator1 beg1, ForwardIterator1 end1,
60  ForwardIterator2 beg2) const
61  {
63  add(ap,beg1,end1,beg2);
64  return 1-ap.correlation();
65  }
66  };
67 
68 }}} // of namespace statistics, yat, and theplu
69 
70 #endif
Calculates the Pearson correlation distance between two points given by elements of ranges...
Definition: PearsonDistance.h:38
double operator()(ForwardIterator1 beg1, ForwardIterator1 end1, ForwardIterator2 beg2) const
Calculates the Pearson correlation distance between elements of two ranges.
Definition: PearsonDistance.h:59
void add(T &o, ForwardIterator first, ForwardIterator last, const classifier::Target &target)
Definition: utility.h:304
averager_traits< typename utility::weighted_if_any2< Iterator1, Iterator2 >::type >::pair_type type
Definition: averager_traits.h:104

Generated on Tue Sep 26 2017 02:33:29 for yat by  doxygen 1.8.5