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
14namespace 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
29 GeneralizedChiSquared ();
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}
BinaryStatistic(const std::string &name, const std::string &description)
Construct with a name and description.
Definition BinaryStatistic.C:122
unsigned get_neigen() const
Return the number of eigenvalue/vector pairs.
Definition GeneralizedChiSquared.h:39
GeneralizedChiSquared * clone() const
Derived types must also define clone method.
Definition GeneralizedChiSquared.h:36
double get(const std::vector< double > &, const std::vector< double > &)
Derived types define the value returned.
Definition GeneralizedChiSquared.C:71
const std::vector< double > & get_residual() const
Return the residual.
Definition GeneralizedChiSquared.h:34
An N-dimensional array of elements of type T, defined recursively.
Definition ndArray.h:22

Generated using doxygen 1.14.0