annotate rDiff/src/locfit/Source/locf.h @ 1:08d3a6143873

Deleted selected files
author vipints
date Tue, 08 Oct 2013 06:54:25 -0400
parents 0f80a5141704
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
1 /*
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
2 * Copyright 1996-2006 Catherine Loader.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
3 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
4 #ifndef I_LOCF_H
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
5 #define I_LOCF_H
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
6
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
7 #include "stdlib.h"
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
8 #include "ctype.h"
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
9 #include "mut.h"
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
10
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
11 #ifdef WARN
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
12 #undef WARN
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
13 #endif
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
14
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
15 #define LERR(args) {mut_printf("Error: "); mut_printf args; mut_printf("\n"); lf_error=1;}
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
16 #define WARN(args) {mut_printf("Warning: "); mut_printf args; mut_printf("\n"); }
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
17
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
18 extern int lf_error;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
19 #define LOGPI 1.144729885849400174143427
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
20 #define HUBERC 2.0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
21 #define NOSLN 0.1278433
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
22 #define GFACT 2.5
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
23 #define EFACT 3.0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
24 #define ISWAP(a,b) { int zz; zz = a; a = b; b = zz; }
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
25 #define MAX(a,b) (((a)>(b)) ? (a) : (b))
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
26 #define MIN(a,b) (((a)<(b)) ? (a) : (b))
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
27 #define SGN(x) (((x)>0) ? 1 : -1)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
28 #define SQR(x) ((x)*(x))
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
29
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
30 extern int lf_error;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
31
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
32 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
33 double *wk, *coef, *xbar, *f;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
34 jacobian xtwx;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
35 int lwk, haspc;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
36 } paramcomp;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
37 #define haspc(pc) ((pc)->haspc)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
38
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
39 /*
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
40 * MXDIM and MXDEG are maximum dimension and local polynomial
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
41 * degree for Locfit. Note that some parts of the code may be
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
42 * more restrictive.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
43 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
44
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
45 #define MXDIM 15
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
46 #define MXDEG 7
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
47
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
48 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
49 double *x[MXDIM];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
50 double *y;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
51 double *w;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
52 double *b;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
53 double *c;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
54 double sca[MXDIM];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
55 double xl[2*MXDIM];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
56 int n, d, ord;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
57 int sty[MXDIM];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
58 } lfdata;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
59 #define resp(lfd,i) (((lfd)->y==NULL) ? 0.0 : (lfd)->y[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
60 #define base(lfd,i) (((lfd)->b==NULL) ? 0.0 : (lfd)->b[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
61 #define prwt(lfd,i) (((lfd)->w==NULL) ? 1.0 : (lfd)->w[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
62 #define cens(lfd,i) (((lfd)->c==NULL) ? 0 : (int)(lfd)->c[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
63 #define datum(lfd,i,j) ((lfd)->x[i][j])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
64 #define dvari(lfd,i) ((lfd)->x[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
65
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
66
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
67 /*
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
68 * The design structure used in Locfit, and associated macro definitions.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
69 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
70
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
71 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
72 int des_init_id;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
73 double *wk;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
74 int *ind;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
75 int lwk, lind;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
76
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
77 double *xev; /* fitting point, length p */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
78 double *X; /* design matrix, length n*p */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
79 double *w, *di, *res, *th, *wd, h;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
80 double *V, *P; /* matrices with length p*p */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
81 double *f1, *ss, *oc, *cf; /* work vectors, length p */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
82 double llk, smwt;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
83 double tr0, tr1, tr2; /* traces for local df computation */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
84 jacobian xtwx; /* to store X'WVX and decomposition */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
85 int cfn[1+MXDIM], ncoef;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
86 int *fix; /* integer vector for fixed coefficients. */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
87 int (*itype)(); /* density integration function */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
88 int n, p;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
89 } design;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
90
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
91 #define cfn(des,i) (des->cfn[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
92 #define d_x(des) ((des)->X)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
93 #define d_xi(des,i) (&(des)->X[i*((des)->p)])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
94 #define d_xij(des,i,j) ((des)->X[i*((des)->p)+j])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
95 #define is_fixed(des,i) ((des)->fix[i]==1)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
96 #define wght(des,i) ((des)->w[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
97 #define dist(des,i) ((des)->di[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
98 #define fitv(des,i) ((des)->th[i])
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
99 #define DES_INIT_ID 34988372
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
100
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
101 extern int des_reqd(), des_reqi();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
102
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
103 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
104 int deflink, canlink, quasi, robust;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
105 int (*vallink)(), (*family)(), (*initial)(), (*like)(), (*pcheck)();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
106 } family;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
107 #define isquasi(fam) ((fam)->quasi)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
108 #define isrobust(fam) ((fam)->robust)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
109 extern int inllmix; /* flag needed to ensure correct behavior in llmix. */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
110
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
111 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
112 double nn, fixh, adpen;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
113 int ker, kt;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
114 int deg, deg0, p;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
115 int acri;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
116 int fam, lin;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
117 family fami;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
118 int ubas;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
119 double (*vb)();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
120 void (*vbasis)();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
121 } smpar;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
122 #define nn(sp) ((sp)->nn)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
123 #define fixh(sp) ((sp)->fixh)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
124 #define pen(sp) ((sp)->adpen)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
125 #define ker(sp) ((sp)->ker)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
126 #define kt(sp) ((sp)->kt)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
127 #define deg(sp) ((sp)->deg)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
128 #define deg0(sp) ((sp)->deg0)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
129 #define npar(sp) ((sp)->p)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
130 #define acri(sp) ((sp)->acri)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
131 #define ubas(sp) ((sp)->ubas)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
132 #define fam(sp) ((sp)->fam)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
133 #define fami(sp) (&(sp)->fami)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
134 #define link(sp) ((sp)->lin)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
135
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
136 typedef struct {
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
137 int deriv[MXDEG+2];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
138 int nd;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
139 } deriv;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
140
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
141 /*
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
142 * Criteria for adaptive local fitting mi[MACRI]
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
143 * 1: localized CP; 2: ICI (katkovnik); 3: curvature model index
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
144 * 4: Increase bandwidth until locfit returns LF_OK
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
145 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
146 #define ANONE 0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
147 #define ACP 1
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
148 #define AKAT 2
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
149 #define AMDI 3
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
150 #define AOK 4
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
151
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
152 /*
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
153 * weight functions mi[MKER].
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
154 * see Table 3.1 or the function W() in weights.c for definitions.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
155 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
156 #define WRECT 1
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
157 #define WEPAN 2
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
158 #define WBISQ 3
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
159 #define WTCUB 4
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
160 #define WTRWT 5
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
161 #define WGAUS 6
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
162 #define WTRIA 7
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
163 #define WQUQU 8
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
164 #define W6CUB 9
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
165 #define WMINM 10
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
166 #define WEXPL 11
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
167 #define WMACL 12
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
168 #define WPARM 13
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
169
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
170 /*
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
171 * type of multivariate weight function mi[MKT]
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
172 * KSPH (spherical) KPROD (product)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
173 * others shouldn't be used at present.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
174 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
175 #define KSPH 1
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
176 #define KPROD 2
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
177 #define KCE 3
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
178 #define KLM 4
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
179 #define KZEON 5
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
180
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
181 /*
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
182 * Local likelihood family mi[MTG]
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
183 * for quasi-likelihood, add 64.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
184 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
185 #define TNUL 0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
186 #define TDEN 1
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
187 #define TRAT 2
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
188 #define THAZ 3
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
189 #define TGAUS 4
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
190 #define TLOGT 5
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
191 #define TPOIS 6
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
192 #define TGAMM 7
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
193 #define TGEOM 8
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
194 #define TCIRC 9
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
195 #define TROBT 10
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
196 #define TRBIN 11
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
197 #define TWEIB 12
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
198 #define TCAUC 13
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
199 #define TPROB 14
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
200 #define TQUANT 15
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
201
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
202 /*
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
203 * Link functions mi[MLINK].
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
204 * Mostly as in table 4.1 of the book.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
205 * LDEFAU and LCANON are used to select default and canonical
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
206 * links respectively. LINIT shouldn't be selected by user...
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
207 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
208 #define LINIT 0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
209 #define LDEFAU 1
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
210 #define LCANON 2
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
211 #define LIDENT 3
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
212 #define LLOG 4
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
213 #define LLOGIT 5
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
214 #define LINVER 6
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
215 #define LSQRT 7
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
216 #define LASIN 8
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
217
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
218 /*
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
219 * components of vector returned by the links() function
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
220 * in family.c. ZLIK the likelihood; ZMEAN = estimated mean;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
221 * ZDLL = derivative of log-likelihood; ZDDLL = - second derivative
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
222 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
223 #define LLEN 4
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
224 #define ZLIK 0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
225 #define ZMEAN 1
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
226 #define ZDLL 2
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
227 #define ZDDLL 3
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
228
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
229 /*
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
230 * return status for the locfit() function
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
231 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
232 #define LF_OK 0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
233 #define LF_DONE 1 /* done - forced break from iterations */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
234 #define LF_OOB 2 /* out of bounds, or large unstable parameter */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
235 #define LF_PF 3 /* perfect fit; interpolation; deviance=0 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
236 #define LF_NCON 4 /* not converged */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
237 #define LF_NSLN 5 /* no solution - eg separation in binomial. */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
238 #define LF_NOPT 6 /* no or insufficient points with non-zero wt */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
239 #define LF_INFA 7 /* initial failure e.g. log(0) */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
240 #define LF_DEMP 10 /* density -- empty integration region */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
241 #define LF_XOOR 11 /* density -- fit point outside xlim region */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
242 #define LF_DNOP 12 /* density version of 6 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
243 #define LF_BADP 81 /* bad parameters e.g. neg prob for binomial */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
244 #define LF_LNK 82 /* invalid link */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
245 #define LF_FAM 83 /* invalid family */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
246 #define LF_ERR 99 /* error */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
247
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
248 #define STANGL 4
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
249 #define STLEFT 5
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
250 #define STRIGH 6
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
251 #define STCPAR 7
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
252
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
253 /*
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
254 * Integration type mi[MIT] for integration in
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
255 * density estimation.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
256 */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
257 #define INVLD 0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
258 #define IDEFA 1
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
259 #define IMULT 2
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
260 #define IPROD 3
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
261 #define IMLIN 4
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
262 #define IHAZD 5
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
263 #define ISPHR 6
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
264 #define IMONT 7
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
265
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
266 /* density.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
267 extern int densinit(), likeden(), deitype();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
268 extern int fact[];
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
269 extern void prodintresp(), prresp();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
270 extern int de_mint, de_itype, de_renorm;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
271
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
272 /* dens_haz.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
273 extern void haz_init();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
274 extern int hazint();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
275
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
276 /* dens_odi.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
277 extern int onedint();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
278 extern void recurint();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
279
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
280 /* famquant.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
281 extern void lfquantile();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
282
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
283 /* family.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
284 extern int lffamily(), lflink();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
285 extern int links(), stdlinks(), defaultlink(), validlinks();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
286 extern double b2(), b3(), b4(), lf_link(), invlink();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
287 extern void setfamily();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
288
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
289 /* lf_adap.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
290 extern int alocfit(), lfacri();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
291
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
292 /* lf_fitfun.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
293 extern void fitfun(), makecfn(), designmatrix();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
294 extern int calcp(), coefnumber();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
295
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
296 /* lf_nbhd.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
297 extern double kordstat(), rho();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
298 extern void nbhd();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
299
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
300 /* lf_robust.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
301 extern double median();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
302 extern void lf_robust();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
303
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
304 /* lfstr.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
305 extern int pmatch();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
306
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
307 /* lf_vari.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
308 extern void lf_vcov(), comp_vari(), local_df();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
309
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
310 /* lf_wdiag.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
311 extern int wdiag(), wdiagp();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
312
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
313 /* locfit.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
314 extern int locfit(), des_reqd(), des_reqi(), likereg();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
315 extern int reginit();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
316 extern void lfdata_init(), smpar_init(), deriv_init(), des_init(), lfiter();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
317 extern int lf_maxit, lf_debug;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
318 extern void lf_status_msg();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
319
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
320 /* minmax.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
321 extern double ipower(), minmax();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
322
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
323 /* weight.c */
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
324 extern int lfkernel(), lfketype();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
325 extern double W(), weight(), weightd(), Wd(), Wdd(), wint();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
326 extern double Wconv(), Wconv1(), Wconv4(), Wconv5(), Wconv6(), Wikk();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
327 extern int iscompact(), wtaylor();
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
328
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
329 #endif /* define I_LOCF_H */