-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathREADME
49 lines (32 loc) · 1.82 KB
/
README
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
C++ implementation of the Iteratively Re-Weighted Least Squares algorithm (IRLS)
for generalized linear models (GLM)
IRLS is free software, you can redistribute it and/or modify it under
the terms of the GNU General Public License.
The GNU General Public License does not permit this software to be
redistributed in proprietary programs.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** Install and usage
prerequisite: GNU Scientific Library (GSL <= 1.16 or >= 2.3)
and C++ compiler (for instance g++)
Modify the Makefile if necessary, then execute "make".
If the GSL is installed in your home directory,
you can use the following command:
make CXXFLAGS="-Wall -Wextra -g -I$HOME/include" \
LDFLAGS="-L$HOME/lib -Wl,-rpath -Wl,$HOME/lib"
To test, run `R --vanilla < test.R`. This will:
- simulate data;
- run the built-in glm() function (output shown on stdout);
- save data in files (test_y.dat, test_X.dat and test_offset.dat);
- compile c++ code (test.cpp) and run IRLS (output also shown on stdout).
You may have to edit test.R if you installed the GSL in your
home directory.
Look at test.cpp to see how to use the library in your own code.
** Extension to other GLM
To add a new link function, create a class mimicking "LogLink".
The new class should inherit from "LinkFunc" (base class) and
implement all required methods.
** References
Dobson, A. J. An Introduction to Generalized Linear Models (Chapman and Hall/CRC, 2002), second edn. URL http://www.worldcat.org/isbn/1584881658.
McCullagh, P. & Nelder, J. A. Generalized Linear Models. Monographs on Statistics & Applied Probability (Chapman & Hall/CRC, London, United Kingdom, 1989), second edition edn. URL http://www.worldcat.org/isbn/0412317605.