-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCorrelation.H
42 lines (35 loc) · 1.12 KB
/
Correlation.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/****************************************************************
Correlation.H
BOOM : Bioinformatics Object Oriented Modules
Copyright (C)2012 William H. Majoros ([email protected]).
This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
License (GPL) version 3, as described at www.opensource.org.
****************************************************************/
#ifndef INCL_Correlation_H
#define INCL_Correlation_H
#include <iostream>
#include <utility>
#include "Vector.H"
using namespace std;
namespace BOOM {
typedef pair<double,double> DblPoint;
typedef BOOM::Vector<DblPoint> DblPointVector;
class Correlation
{
public:
Correlation(const DblPointVector &);
Correlation(const Vector<float> &,const Vector<float> &);
Correlation(const Vector<double> &,const Vector<double> &);
double getR();
bool isSignificant(double alpha);
double getP(); // left-tailed cumulative pdf value
static double computeR(double sumX,double sumXX,double sumY,double sumYY,
double sumXY,int n);
private:
double r;
int n;
void computeR(double sumX,double sumXX,double sumY,double sumYY,
double sumXY);
};
}
#endif