1 /*
2  *  gretl -- Gnu Regression, Econometrics and Time-series Library
3  *  Copyright (C) 2001 Allin Cottrell and Riccardo "Jack" Lucchetti
4  *
5  *  This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation, either version 3 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  */
19 
20 #ifndef COMPARE_H
21 #define COMPARE_H
22 
23 #include <stdio.h>
24 #include "gretl_matrix.h"
25 
26 typedef enum {
27     SAVE_LEVERAGE  = 1 << 0,
28     SAVE_INFLUENCE = 1 << 1,
29     SAVE_DFFITS    = 1 << 2,
30     SAVE_TREND     = 1 << 3,
31     SAVE_CYCLE     = 1 << 4
32 } SeriesSaveCode;
33 
34 /**
35  * ModelAuxCode:
36  * @AUX_NONE: not an auxiliary regression
37  * @AUX_SQ: nonlinearity test (squared terms)
38  * @AUX_LOG: nonlinearity test (log terms)
39  * @AUX_CHOW: Chow test
40  * @AUX_ADD: LM test regression for added variables
41  * @AUX_AR: autocorrelation test
42  * @AUX_ARCH: ARCH test
43  * @AUX_WHITE: heteroskedasticity (White's test)
44  * @AUX_COINT: cointegration test
45  * @AUX_DF: Dickey-Fuller test
46  * @AUX_ADF: augmented Dickey-Fuller test
47  * @AUX_KPSS: KPSS unit-root test
48  * @AUX_OMIT: unused
49  * @AUX_RESET: Ramsey's RESET
50  * @AUX_SYS: single equation from multivariate system
51  * @AUX_VAR: single equation from VAR system
52  * @AUX_VECM: single equation from VECM system
53  * @AUX_JOHANSEN: Johansen cointegration test
54  * @AUX_GROUPWISE: test for groupwise heteroskedasticity
55  * @AUX_HET_1: Pesaran-Taylor HET_1 test
56  * @AUX_BP: Breusch-Pagan heteroskedastcity test
57  * @AUX_AUX: auxiliary regression not otherwise specified
58  * @AUX_COMFAC: common factor test
59  * @AUX_BIPROB: biprobit initializer
60  *
61  * Symbolic names to keep track of auxiliary regression models,
62  * which are estimated either for the purpose of carrying out
63  * some sort of diagnostic test or which form part of a
64  * multi-equation system.
65  */
66 
67 typedef enum {
68     AUX_NONE,
69     AUX_SQ,
70     AUX_LOG,
71     AUX_CHOW,
72     AUX_ADD,
73     AUX_AR,
74     AUX_ARCH,
75     AUX_WHITE,
76     AUX_COINT,
77     AUX_DF,
78     AUX_ADF,
79     AUX_KPSS,
80     AUX_OMIT,
81     AUX_RESET,
82     AUX_SYS,
83     AUX_VAR,
84     AUX_VECM,
85     AUX_JOHANSEN,
86     AUX_GROUPWISE,
87     AUX_HET_1,
88     AUX_BP,
89     AUX_AUX,
90     AUX_COMFAC,
91     AUX_BIPROB,
92 } ModelAuxCode;
93 
94 double wald_omit_F (const int *list, MODEL *pmod);
95 
96 double wald_omit_chisq (const int *list, MODEL *pmod);
97 
98 int add_test (MODEL *pmod, const int *addvars,
99 	      DATASET *dset, gretlopt opt,
100 	      PRN *prn);
101 
102 int add_test_full (MODEL *orig, MODEL *pmod,
103 		   const int *addvars, DATASET *dset,
104 		   gretlopt opt, PRN *prn);
105 
106 int omit_test (MODEL *pmod, const int *omitvars,
107 	       DATASET *dset, gretlopt opt,
108 	       PRN *prn);
109 
110 int omit_test_full (MODEL *orig, MODEL *pmod,
111 		    const int *omitvars, DATASET *dset,
112 		    gretlopt opt, PRN *prn);
113 
114 int nonlinearity_test (MODEL *pmod, DATASET *dset,
115 		       ModelAuxCode aux, gretlopt opt, PRN *prn);
116 
117 int reset_test (MODEL *pmod, DATASET *dset,
118 		gretlopt opt, PRN *prn);
119 
120 int autocorr_test (MODEL *pmod, int order, DATASET *dset,
121 		   gretlopt opt, PRN *prn);
122 
123 int comfac_test (MODEL *pmod, DATASET *dset,
124 		 gretlopt opt, PRN *prn);
125 
126 double get_DW_pvalue_for_model (MODEL *pmod,
127 				DATASET *dset,
128 				int *err);
129 
130 int chow_test (int splitobs, MODEL *pmod, DATASET *dset,
131 	       gretlopt opt, PRN *prn);
132 
133 int chow_test_from_dummy (int splitvar, MODEL *pmod, DATASET *dset,
134 			  gretlopt opt, PRN *prn);
135 
136 int QLR_test (MODEL *pmod, DATASET *dset,
137 	      gretlopt opt, PRN *prn);
138 
139 double QLR_pval (double X2, int df, double p1, double p2);
140 
141 int cusum_test (MODEL *pmod, DATASET *dset,
142 		gretlopt opt, PRN *prn);
143 
144 int panel_specification_test (MODEL *pmod, DATASET *dset,
145 			      gretlopt opt, PRN *prn);
146 
147 int panel_hausman_test (MODEL *pmod, DATASET *dset,
148 			gretlopt opt, PRN *prn);
149 
150 int vif_test (MODEL *pmod, DATASET *dset,
151 	      gretlopt opt, PRN *prn);
152 
153 int bkw_test (MODEL *pmod, DATASET *dset,
154 	      gretlopt opt, PRN *prn);
155 
156 int leverage_test (MODEL *pmod, DATASET *dset,
157 		   gretlopt opt, PRN *prn);
158 
159 int add_leverage_values_to_dataset (DATASET *dset, gretl_matrix *m,
160 				    gretlopt opt, int flags);
161 
162 void print_add_omit_null (const int *list, const DATASET *dset,
163 			  gretlopt opt, PRN *prn);
164 
165 #endif /* COMPARE_H */
166