forked from insilico/plink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
linear.h
77 lines (53 loc) · 1.58 KB
/
linear.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//////////////////////////////////////////////////////////////////
// //
// PLINK (c) 2005-2009 Shaun Purcell //
// //
// This file is distributed under the GNU General Public //
// License, Version 2. Please see the file COPYING for more //
// details //
// //
//////////////////////////////////////////////////////////////////
#ifndef __LINEAR_H__
#define __LINEAR_H__
#include<vector>
#include "plink.h"
#include "model.h"
using namespace std;
class LinearModel : public Model {
public:
LinearModel(Plink *);
~LinearModel() { };
void setDependent();
void fitLM();
void fitUnivariateLM();
void pruneY();
void standardise();
void reset();
vector_t getCoefs();
vector_t getVar();
vector_t getSE();
vector_t getPVals();
double getPValue();
void HuberWhite();
void displayResults(ofstream &, Locus *);
double calculateRSS();
double calculateRSquared();
double calculateAdjustedRSquared();
double calculateMallowC(LinearModel *);
double calculateFTest(LinearModel *);
private:
vector_t Y;
vector<int> C;
vector<double> se;
double chisq;
vector<double> sig;
vector<double> w;
vector<vector<double> > u;
vector<vector<double> > v;
double varY;
double meanY;
double RSS;
void function(const int i, vector<double> & p );
void setVariance();
};
#endif