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 GRETL_MIDAS_H 21 #define GRETL_MIDAS_H 22 23 typedef enum { 24 MIDAS_U, /* "unrestricted MIDAS" */ 25 MIDAS_NEALMON, /* normalized exponential Almon */ 26 MIDAS_BETA0, /* normalized beta, last lag 0 */ 27 MIDAS_BETAN, /* normalized beta, non-zero last lag */ 28 MIDAS_ALMONP, /* plain Almon polynomial */ 29 MIDAS_BETA1, /* as MIDAS_BETA0, but 1st coeff clamped */ 30 MIDAS_MAX /* sentinel */ 31 } MidasType; 32 33 int midas_days_per_period (int days_per_week, int pd); 34 35 int is_valid_midas_frequency_ratio (const DATASET *dset, int m); 36 37 int get_midas_frequency (const DATASET *dset, int m); 38 39 int midas_m_from_pd (const DATASET *dset, int freq); 40 41 const char *midas_pdstr (const DATASET *dset, int cfac); 42 43 DATASET *midas_aux_dataset (const int *list, 44 const DATASET *dset, 45 int *err); 46 47 gretl_matrix *midas_list_to_vector (const int *list, 48 const DATASET *dset, 49 int *err); 50 51 int midas_forecast_setup (const MODEL *pmod, 52 DATASET *dset, 53 ForecastMethod method, 54 char **pformula); 55 56 MODEL midas_model (const int *list, const char *param, 57 DATASET *dset, gretlopt opt, 58 PRN *prn); 59 60 char *get_midas_term_line (const MODEL *pmod, int i); 61 62 #endif /* GRETL_MIDAS_H */ 63