GeneralizedChiSquared.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2020 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/GeneralizedChiSquared.h
10 
11 #include "BinaryStatistic.h"
12 #include "ndArray.h"
13 
14 namespace BinaryStatistics
15 {
17 
19  class GeneralizedChiSquared : public BinaryStatistic
20  {
21  bool robust_linear_fit;
22  double outlier_threshold;
23  double max_zap_fraction;
24 
25  std::vector<double> residual;
26 
27  public:
28 
30 
31  double get (const std::vector<double>&, const std::vector<double>&);
32 
34  const std::vector<double>& get_residual () const { return residual; }
35 
36  GeneralizedChiSquared* clone () const { return new GeneralizedChiSquared; }
37 
39  unsigned get_neigen () const { return eigenvalues.size(); }
40 
41  ndArray<2,double> eigenvectors;
42  ndArray<1,double> eigenvalues;
43 
44  };
45 }
GeneralizedChiSquared * clone() const
Derived types must also define clone method.
Definition: GeneralizedChiSquared.h:46
FILE * fptr
The file to which auxiliary data will be printed.
Definition: BinaryStatistic.h:50
T val
The value, .
Definition: Estimate.h:42
Computes the generalized squared interpoint distance between vectors.
Definition: GeneralizedChiSquared.h:24
double get(const std::vector< double > &, const std::vector< double > &)
Derived types define the value returned.
Definition: GeneralizedChiSquared.C:67
const std::vector< double > & get_residual() const
Return the residual.
Definition: GeneralizedChiSquared.h:44
unsigned get_neigen() const
Return the number of eigenvalue/vector pairs.
Definition: GeneralizedChiSquared.h:49
Commmon statistics that can be derived from two arrays of floats.
Definition: BinaryStatistic.h:17

Generated using doxygen 1.8.17