Newer
Older
/* glm.h
Mark Woolrich, FMRIB Image Analysis Group
Copyright (C) 1999-2000 University of Oxford */
/* CCOPYRIGHT */
#include <iostream>
#include <fstream>
#include "newmatap.h"
#include "newmatio.h"
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
#define BATCHSIZE 50
class Glm
{
public:
Glm() : y(NULL),
x(NULL),
contrasts(NULL) {}
void setData(Matrix& p_y, Matrix& p_x, Matrix& p_contrasts);
const Matrix& ComputeResids();
const float ComputeVar();
const float Computecb();
const ColumnVector& Computeb();
const ColumnVector& Getb() const {return b;}
const Matrix& Getr() const {return r;}
void SetContrast(const int p_num) {c = contrasts->Row(p_num).t();}
private:
Glm(const Glm&);
Glm& operator=(const Glm& p_glm);
// y = bx + r
Matrix* y;
Matrix* x;
// Contrast
Matrix* contrasts;
ColumnVector c;
int numTS;
int sizeTS;
Matrix r;
Matrix inv_xx;
float cb;
ColumnVector b;
float var;
};