[gretl] Initial import (20100917)

hannes hannes at fedoraproject.org
Fri Sep 17 16:33:14 UTC 2010


commit 7629c224fd78bd511bd2027c53b3d9dc79ec9919
Author: johannes lips <johannes at fedorabox.localdomain>
Date:   Fri Sep 17 18:34:15 2010 +0200

    Initial import (20100917)

 .gitignore                      |    1 +
 gretl-1.9.1-lib64.patch         |   21 ++
 gretl-1.9.1-removal-lad.c.patch |  733 +++++++++++++++++++++++++++++++++++++++
 gretl.spec                      |  152 ++++++++
 gretl_plugins.txt               |   95 +++++
 sources                         |    1 +
 6 files changed, 1003 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..23b55df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/gretl-1.9.1.tar.bz2
diff --git a/gretl-1.9.1-lib64.patch b/gretl-1.9.1-lib64.patch
new file mode 100644
index 0000000..aad324a
--- /dev/null
+++ b/gretl-1.9.1-lib64.patch
@@ -0,0 +1,21 @@
+diff -up gretl-1.9.1/gretl.pc.in.lib64 gretl-1.9.1/gretl.pc.in
+--- gretl-1.9.1/gretl.pc.in.lib64	2010-08-28 17:24:10.578765300 +0300
++++ gretl-1.9.1/gretl.pc.in	2010-08-28 17:25:10.354600547 +0300
+@@ -1,6 +1,6 @@
+ prefix=@prefix@
+ exec_prefix=${prefix}
+-libdir=${exec_prefix}/lib
++libdir=@libdir@
+ includedir=${prefix}/include
+ ompopt=@OPENMP_CFLAGS@
+ 
+diff -up gretl-1.9.1/lib/Makefile.in.lib64 gretl-1.9.1/lib/Makefile.in
+--- gretl-1.9.1/lib/Makefile.in.lib64	2010-08-28 17:23:58.211799376 +0300
++++ gretl-1.9.1/lib/Makefile.in	2010-08-28 17:24:31.552707701 +0300
+@@ -56,7 +56,6 @@ else
+ endif
+ 
+ # Installation directories
+-libdir = $(prefix)/lib
+ includedir = $(prefix)/include/gretl
+ pkgconfigdir = $(libdir)/pkgconfig
diff --git a/gretl-1.9.1-removal-lad.c.patch b/gretl-1.9.1-removal-lad.c.patch
new file mode 100644
index 0000000..0027457
--- /dev/null
+++ b/gretl-1.9.1-removal-lad.c.patch
@@ -0,0 +1,733 @@
+From 1c9f4f244123826a758d96be0aaedda3ac4b61a5 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Tue, 14 Sep 2010 12:18:07 +0400
+Subject: [PATCH] Remove the only plugin under unclear licensing conditions
+
+---
+ plugin/Makefile.in |    5 -
+ plugin/lad.c       |  683 ----------------------------------------------------
+ 2 files changed, 0 insertions(+), 688 deletions(-)
+ delete mode 100644 plugin/lad.c
+
+diff --git a/plugin/Makefile.in b/plugin/Makefile.in
+index fa5e98f..b4c0159 100644
+--- a/plugin/Makefile.in
++++ b/plugin/Makefile.in
+@@ -83,7 +83,6 @@ SRCS = excel_import.c \
+ 	jrestrict.c \
+ 	jalpha.c \
+ 	kernel.c \
+-	lad.c \
+ 	longname.c \
+ 	mp_ols.c \
+ 	pca.c \
+@@ -131,7 +130,6 @@ PLUGINS = arbond.la \
+ 	garch.la \
+ 	johansen.la \
+ 	kernel.la \
+-	lad.la \
+ 	nistcheck.la \
+ 	range-mean.la \
+ 	stats_tables.la \
+@@ -234,9 +232,6 @@ jmulti_import.la: jmulti_import.lo
+ fractals.la: fractals.lo
+ 	$(LINK) -o $@ $< $(GRETLLIB)
+ 
+-lad.la: lad.lo
+-	$(LINK) -o $@ $< $(GRETLLIB)
+-
+ kernel.la: kernel.lo
+ 	$(LINK) -o $@ $< $(GRETLLIB)
+ 
+diff --git a/plugin/lad.c b/plugin/lad.c
+deleted file mode 100644
+index b34c391..0000000
+--- a/plugin/lad.c
++++ /dev/null
+@@ -1,683 +0,0 @@
+-/* lad.c -- Least Absolute Deviation regression for gretl */
+-
+-#include "libgretl.h"
+-
+-static double toler = 1.0e-9;
+-
+-static void col_ (double *v1, double *v2, double amlt, 
+-		  int m1, int iout)
+-{
+-    int i;
+-
+-    /* Parameter adjustments */
+-    --v2;
+-    --v1;
+-
+-    for (i=1; i<=m1; i++) {
+-	if (i != iout) {
+-	    v1[i] -= v2[i] * amlt;
+-	}
+-    }
+-}
+-
+-/*    Based on SUBROUTINE L1(M,N,TOLER,X,A,B)
+-C
+-C  ***************************************************************
+-C  *  COMMUNICATIONS OF THE ASSOCIATION FOR COMPUTING MACHINERY  *
+-C  *  ALGORITHM 478                                              *
+-C  *  SOLUTION OF AN OVERDETERMINED SYSTEM OF EQUATIONS IN THE   *
+-C  *  L1 NORM -- I. BARRODALE AND F.D.K. ROBERTS                 *
+-C  ***************************************************************
+-C
+-C  ****************************************************************
+-C  * THIS SUBROUTINE USES A MODIFICATION OF THE SIMPLEX METHOD OF *
+-C  * LINEAR PROGRAMMING TO CALCULATE AN L1 SOLUTION TO THE OVER-  *
+-C  * DETERMINED SYSTEM OF LINEAR EQUATIONS, A*X = B.
+-C  *                                                              *
+-C  *                         PARAMETERS                           *
+-C  *                                                              *
+-C  * M     - NUMBER OF EQUATIONS.  NOTE THAT THIS IS THE N IN     *
+-C  *         SUBROUTINE LAD.                                      *
+-C  * N     - NUMBER OF UNKNOWNS (M.GE.N).                         *
+-C  * TOLER - A SMALL POSITIVE TOLERANCE. THE ROUTINE REGARDS ANY  *
+-C  *         QUANTITY AS ZERO UNLES ITS MAGNITUDE EXCEEDS TOLER.  *
+-C  *         EMPIRICAL EVIDENCE SUGGESTS TOLER = 10**(-D*2/3)     *
+-C  *         WHERE D REPRESENTS THE NUMBER OF DECIMAL DIGITS OF   *
+-C  *         ACCURACY AVAILABLE.                                  *
+-C  * X     - ONE DIMENSIONAL REAL ARRAY.  ON EXIT, THIS ARRAY     *
+-C  *         CONTAINS A SOLUTION TO THE L1 PROBLEM.               *
+-C  *                                                              *
+-C  * THE ORIGINAL CONTENTS OF THE ARRAYS A AND B ARE DESTROYED BY *
+-C  * THIS ROUTINE.                                                *
+-C  *                                                              *
+-C  * ON EXIT FROM THE SUBROUTINE, THE ARRAY A CONTAINS THE        *
+-C  * FOLLOWING INFORMATION.                                       *
+-C  *                                                              *
+-C  * A(M+1,N+1)  THE MINIMUM SUM OF THE ABSOLUTE VALUES OF THE    *
+-C  *             RESIDUALS.                                       *
+-C  * A(M+1,N+2)  THE RANK OF THE MATRIX OF COEFFICIENTS.          *
+-C  * A(M+2,N+1)  EXIT CODE WITH VALUES                            *
+-C  *             0 - OPTIMAL SOLUTION - PROBABLY NON-UNIQUE       *
+-C  *             1 - UNIQUE OPTIMAL SOLUTION                      *
+-C  *             2 - PREMATURE TERMINATION DUE TO ROUNDING ERRORS *
+-C  * A(M+2,N+2)  NUMBER OF SIMPLEX ITERATIONS PERFORMED.          *
+-C  *                                                              *
+-C  ****************************************************************
+-C */
+-
+-/* Modifications to the above: "toler" is not entered as a parameter,
+-   it is "global" to this translation unit.  Regression residuals
+-   are found in the array e on exit.  The following function was
+-   translated from the Fortran by f2c, then rendered into slightly more
+-   idiomatic C by me.  Allin Cottrell, September 2002.
+-*/
+-
+-static int l1_ (int m, int n, 
+-		double *a, double *b, 
+-		double *x, double *e)
+-{
+-    const double big = 1e200;
+-    double amin, amax;
+-    int test = 0, stage;
+-    double sum;
+-    int iout = 0;
+-    int i, j, k, l;
+-    int m1, n1, m2, n2, kount;
+-    double d, pivot;
+-    int kl, in = 0, kr, *ls;
+-    int nrows = m + 2;
+-
+-    ls = malloc(m * sizeof *ls);
+-
+-    /* Parameter adjustments */
+-    --e;
+-    --x;
+-    --b;
+-    a -= (nrows + 1);
+-
+-    m1 = m + 1;
+-    n1 = n + 1;
+-    m2 = m + 2;
+-    n2 = n + 2;
+-
+-    for (j = 1; j <= n; ++j) {
+-	a[m2 + j * nrows] = (double) j;
+-	x[j] = 0.0;
+-    }
+-
+-    for (i = 1; i <= m; ++i) {
+-	a[i + n2 * nrows] = (double) (n + i);
+-	a[i + n1 * nrows] = b[i];
+-	if (b[i] < 0.0) {
+-	    for (j = 1; j <= n2; ++j) {
+-		a[i + j * nrows] = -a[i + j * nrows];
+-	    }
+-	}
+-	e[i] = 0.0;
+-    }
+-
+-    for (j = 1; j <= n1; ++j) {
+-	sum = 0.0;
+-	for (i = 1; i <= m; ++i) {
+-	    sum += a[i + j * nrows];
+-	}
+-	a[m1 + j * nrows] = sum;
+-    }
+-
+-    stage = 1;
+-    kount = 0;
+-    kr = 1;
+-    kl = 1;
+-
+-L70:
+-    amax = -1.0;
+-    for (j = kr; j <= n; ++j) {
+-	if (fabs(a[m2 + j * nrows]) > (double) n) {
+-	    continue;
+-	}
+-	d = fabs(a[m1 + j * nrows]);
+-	if (d <= amax) {
+-	    continue;
+-	}
+-	amax = d;
+-	in = j;
+-    }
+-
+-    if (a[m1 + in * nrows] < 0.0) {
+-	for (i = 1; i <= m2; ++i) {
+-	    a[i + in * nrows] = -a[i + in * nrows];
+-	}
+-    }
+-
+-L100:
+-    k = 0;
+-    for (i = kl; i <= m; ++i) {
+-	d = a[i + in * nrows];
+-	if (d > toler) {
+-	    ++k;
+-	    b[k] = a[i + n1 * nrows] / d;
+-	    ls[k - 1] = i;
+-	    test = 1;
+-	}
+-    }
+-
+-L120:
+-    if (k <= 0) {
+-	test = 0;
+-	goto L150;
+-    }
+-
+-    amin = big;
+-    for (i = 1; i <= k; ++i) {
+-	if (b[i] < amin) {
+-	    j = i;
+-	    amin = b[i];
+-	    iout = ls[i - 1];
+-	}
+-    }
+-    b[j] = b[k];
+-    ls[j - 1] = ls[k - 1];
+-    --k;
+-
+-L150:
+-    if (test || !stage) {
+-	goto L170;
+-    }
+-    for (i = 1; i <= m2; ++i) {
+-	d = a[i + kr * nrows];
+-	a[i + kr * nrows] = a[i + in * nrows];
+-	a[i + in * nrows] = d;
+-    }
+-    ++kr;
+-    goto L260;
+-
+-L170:
+-    if (test) {
+-	goto L180;
+-    }
+-    a[m2 + n1 * nrows] = 2.0;
+-    goto L350;
+-
+-L180:
+-    pivot = a[iout + in * nrows];
+-    if (a[m1 + in * nrows] - pivot - pivot <= toler) {
+-	goto L200;
+-    }
+-    for (j = kr; j <= n1; ++j) {
+-	d = a[iout + j * nrows];
+-	a[m1 + j * nrows] = a[m1 + j * nrows] - d - d;
+-	a[iout + j * nrows] = -d;
+-    }
+-    a[iout + n2 * nrows] = -a[iout + n2 * nrows];
+-    goto L120;
+-
+-L200:
+-    for (j = kr; j <= n1; ++j) {
+-	if (j != in) {
+-	    a[iout + j * nrows] /= pivot;
+-	}
+-    }
+-    for (j = kr; j <= n1; ++j) {
+-	if (j != in) {
+-	    col_(&a[j * nrows + 1], &a[in * nrows + 1], a[iout + j * nrows], 
+-		 m1, iout);
+-	}
+-    }
+-    for (i = 1; i <= m1; ++i) {
+-	if (i != iout) {
+-	    a[i + in * nrows] = -a[i + in * nrows] / pivot;
+-	}
+-    }
+-
+-    a[iout + in * nrows] = 1.0 / pivot;
+-    d = a[iout + n2 * nrows];
+-    a[iout + n2 * nrows] = a[m2 + in * nrows];
+-    a[m2 + in * nrows] = d;
+-    ++kount;
+-
+-    if (!stage) {
+-	goto L270;
+-    }
+-
+-    ++kl;
+-    for (j = kr; j <= n2; ++j) {
+-	d = a[iout + j * nrows];
+-	a[iout + j * nrows] = a[kount + j * nrows];
+-	a[kount + j * nrows] = d;
+-    }
+-
+-L260:
+-    if (kount + kr != n1) {
+-	goto L70;
+-    }
+-
+-    stage = 0;
+-
+-L270:
+-    amax = -big;
+-    for (j = kr; j <= n; ++j) {
+-	d = a[m1 + j * nrows];
+-	if (d < 0.0) {
+-	    if (d > -2.0) {
+-		continue;
+-	    }
+-	    d = -d - 2.0;
+-	}
+-	if (d <= amax) {
+-	    continue;
+-	}
+-	amax = d;
+-	in = j;
+-    }
+-
+-    if (amax > toler) {
+-	if (a[m1 + in * nrows] > 0.0) {
+-	    goto L100;
+-	}
+-	for (i = 1; i <= m2; ++i) {
+-	    a[i + in * nrows] = -a[i + in * nrows];
+-	}
+-	a[m1 + in * nrows] -= 2.0;
+-	goto L100;
+-    }
+-
+-    l = kl - 1;
+-    for (i = 1; i <= l; ++i) {
+-	if (a[i + n1 * nrows] < 0.0) {
+-	    for (j = kr; j <= n2; ++j) {
+-		a[i + j * nrows] = -a[i + j * nrows];
+-	    }
+-	}
+-    }
+-
+-    a[m2 + n1 * nrows] = 0.0;
+-    if (kr != 1) {
+-	goto L350;
+-    }
+-
+-    for (j = 1; j <= n; ++j) {
+-	d = fabs(a[m1 + j * nrows]);
+-	if (d <= toler || 2.0 - d <= toler) {
+-	    goto L350;
+-	}
+-    }
+-    a[m2 + n1 * nrows] = 1.0;
+-
+-L350:
+-    for (i = 1; i <= m; ++i) {
+-	k = (int) a[i + n2 * nrows];
+-	d = a[i + n1 * nrows];
+-	if (k <= 0) {
+-	    k = -k;
+-	    d = -d;
+-	}
+-	if (i >= kl) {
+-	    k -= n;
+-	    e[k] = d;
+-	} else {
+-	    x[k] = d;
+-	}
+-    }
+-
+-    a[m2 + n2 * nrows] = (double) kount;
+-    a[m1 + n2 * nrows] = (double) (n1 - kr);
+-
+-    sum = 0.0;
+-    for (i = kl; i <= m; ++i) {
+-	sum += a[i + n1 * nrows];
+-    }
+-
+-    a[m1 + n1 * nrows] = sum;
+-
+-    free(ls);
+-
+-    return 0;
+-} 
+-
+-static int missobs_before (const MODEL *pmod, int t)
+-{
+-    int i, c = 0;
+-
+-    for (i=0; i<t; i++) {
+-	if (pmod->missmask[i + pmod->t1] == '1') {
+-	    c++;
+-	}
+-    }
+-
+-    return c;
+-}
+-
+-static void 
+-adjust_sample_for_missing (int *sample, int n, const MODEL *pmod)
+-{
+-    int i;
+-
+-    for (i=0; i<n; i++) {
+-	sample[i] += missobs_before(pmod, sample[i]);
+-    }
+-}
+-
+-#define ITERS 500
+-#define RESAMPLE_RESIDUALS 0
+-
+-#if RESAMPLE_RESIDUALS
+-
+-/* populate dependent var using resampled residuals */
+-
+-static void
+-make_data_arrays (MODEL *pmod, double **Z,
+-		  double *a, double *b,
+-		  const int *sample,
+-		  int nrows, int k, int m)
+-{
+-    int i, j, v, t;
+-
+-    /* we need to do this on each iteration because the "a" array is
+-       overwritten by the LAD calculations
+-    */
+-    for (j=0; j<k; j++) {
+-	v = pmod->list[j+2];
+-	t = pmod->t1;
+-	for (i=0; i<m; i++) {
+-	    while (model_missing(pmod, t)) {
+-		t++;
+-	    }
+-	    a[i + j * nrows] = Z[v][t++];
+-	}
+-    }
+-
+-    t = pmod->t1;
+-
+-    for (i=0; i<m; i++) {
+-	while (model_missing(pmod, t)) {
+-	    t++;
+-	}
+-	b[i] = a[i + k * nrows] = 
+-	    pmod->yhat[t++] + pmod->uhat[sample[i]];
+-    }
+-}
+-
+-#else
+-
+-/* populate both y and X using resampled data rows */
+-
+-static void
+-make_data_arrays (MODEL *pmod, double **Z,
+-		  double *a, double *b,
+-		  const int *sample,
+-		  int nrows, int k, int m)
+-{
+-    int i, j, v, t;
+-
+-    for (i=0; i<m; i++) {
+-	t = sample[i];
+-	for (j=0; j<k; j++) {
+-	    v = pmod->list[j+2];
+-	    a[i + j * nrows] = Z[v][t];
+-	}
+-	v = pmod->list[1];
+-	b[i] = a[i + k * nrows] = Z[v][t];
+-    }
+-}
+-
+-#endif
+-
+-/* obtain bootstrap estimates of LAD covariance matrix */
+-
+-static int bootstrap_vcv (MODEL *pmod, double **Z,
+-			  double *a, double *b, double *e, double *x,
+-			  int m, int n, int dim)
+-{
+-    double **coeffs = NULL;
+-    double *meanb = NULL;
+-    int *sample = NULL;
+-    double xi, xj;
+-    int i, j, k;
+-    int nvcv, nrows = m + 2;
+-    int err = 0;
+-
+-    /* note: new_vcv sets all entries to zero */
+-    err = gretl_model_new_vcv(pmod, &nvcv);
+-    if (err) {
+-	return err;
+-    }
+-
+-    /* an array for each coefficient */
+-    coeffs = malloc(pmod->ncoeff * sizeof *coeffs);
+-    if (coeffs == NULL) {
+-	err = E_ALLOC;
+-	goto bailout;
+-    }
+-
+-    /* a scalar for each coefficient mean */
+-    meanb = malloc(pmod->ncoeff * sizeof *meanb);
+-    if (meanb == NULL) {
+-	err = E_ALLOC;
+-	goto bailout;
+-    }    
+-
+-    /* each array has length ITERS */
+-    for (i=0; i<pmod->ncoeff; i++) {
+-	coeffs[i] = malloc(ITERS * sizeof **coeffs);
+-	if (coeffs[i] == NULL) {
+-	    for (k=0; k<i; k++) {
+-		free(coeffs[k]);
+-	    }
+-	    free(coeffs);
+-	    coeffs = NULL;
+-	    err = E_ALLOC;
+-	    goto bailout;
+-	}
+-    }
+-
+-    /* sample array has length pmod->nobs */
+-    sample = malloc(m * sizeof *sample);
+-    if (sample == NULL) {
+-	err = E_ALLOC;
+-	goto bailout;
+-    }
+-
+-    for (k=0; k<ITERS; k++) {
+-
+-	/* create random sample index array */
+-	for (i=0; i<m; i++) {
+-	    sample[i] = pmod->t1 + gretl_rand_int_max(m);
+-	}
+-
+-	if (pmod->missmask != NULL) {
+-	    adjust_sample_for_missing(sample, m, pmod);
+-	}
+-
+-	/* initialize arrays */
+-	for (i=0; i<dim; i++) {
+-	    a[i] = 0.0;
+-	}
+-	for (i=0; i<m; i++) {
+-	    e[i] = b[i] = 0.0;
+-	}
+-	for (i=0; i<n; i++) {
+-	    x[i] = 0.0;
+-	}
+-
+-	make_data_arrays(pmod, Z, a, b, sample, nrows, n, m);
+-
+-	/* estimate LAD model and store coeffs */
+-	l1_(m, n, a, b, x, e);
+-
+-	for (i=0; i<n; i++) {
+-	    coeffs[i][k] = x[i];
+-	}
+-    }
+-
+-    /* find means of coeff estimates */
+-    for (i=0; i<pmod->ncoeff; i++) {
+-	double bbar = 0.0;
+-
+-	for (k=0; k<ITERS; k++) {
+-	   bbar += coeffs[i][k];
+-	} 
+-	meanb[i] = bbar / ITERS;
+-    }    
+-
+-    /* find variances and covariances */
+-    for (i=0; i<pmod->ncoeff; i++) {
+-	double vi = 0.0;
+-
+-	for (k=0; k<ITERS; k++) {
+-	    xi = coeffs[i][k] - meanb[i];
+-	    vi += xi * xi;
+-	    for (j=0; j<=i; j++) {
+-		xj = coeffs[j][k] - meanb[j];
+-		pmod->vcv[ijton(i, j, pmod->ncoeff)] += xi * xj;
+-	    }
+-	}
+-	pmod->sderr[i] = sqrt(vi / ITERS);
+-    }
+-
+-    for (i=0; i<nvcv; i++) {
+-	pmod->vcv[i] /= ITERS;
+-    }
+-
+- bailout:
+-
+-    free(sample);
+-
+-    if (coeffs != NULL) {
+-	for (i=0; i<pmod->ncoeff; i++) {
+-	    free(coeffs[i]);
+-	}
+-	free(coeffs);
+-    }
+-
+-    free(meanb);
+-
+-    return 0;
+-}
+-
+-static void lad_loglik (MODEL *pmod)
+-{
+-    double tau = 0.5, R = 0.0;
+-    int n = pmod->nobs;
+-    int t;
+-
+-    for (t=pmod->t1; t<=pmod->t2; t++) {
+-	R += pmod->uhat[t] * (tau - (pmod->uhat[t] < 0));
+-    }
+-
+-    pmod->lnL = n * (log(tau * (1-tau)) - 1 - log(R/n));
+-    mle_criteria(pmod, 0);
+-}
+-
+-int lad_driver (MODEL *pmod, double **Z, DATAINFO *pdinfo)
+-{
+-    double *a = NULL, *b = NULL, *e = NULL, *x = NULL;
+-    int i, j, t, m, n, nrows, dim;
+-    int yno = pmod->list[1];
+-    int ladcode;
+-
+-    m = pmod->nobs;
+-    n = pmod->list[0] - 1;
+-
+-    nrows = m + 2;
+-    dim = nrows * (n + 2);
+-
+-    a = malloc(dim * sizeof *a);
+-    x = malloc(n * sizeof *x);
+-    e = malloc(m * sizeof *e);
+-    b = malloc(m * sizeof *b);
+-
+-    if (a == NULL || x == NULL || e == NULL || b == NULL) {
+-	free(a);
+-	free(x);
+-	free(e);
+-	free(b);
+-	return 1;
+-    }
+-
+-    /* initialize arrays */
+-    for (i=0; i<dim; i++) {
+-	a[i] = 0.0;
+-    }
+-    for (i=0; i<m; i++) {
+-	e[i] = b[i] = 0.0;
+-    }
+-    for (i=0; i<n; i++) {
+-	x[i] = 0.0;
+-    }
+-
+-    /* populate data array */
+-    for (j=0; j<n; j++) {
+-	int v = pmod->list[j+2];
+-
+-	t = pmod->t1;
+-	for (i=0; i<m; i++) {
+-	    while (model_missing(pmod, t)) {
+-		t++;
+-	    }
+-	    a[i + j * nrows] = Z[v][t++];
+-	}
+-    }
+-
+-    t = pmod->t1;
+-    for (i=0; i<m; i++) {
+-	while (model_missing(pmod, t)) {
+-	    t++;
+-	}
+-	b[i] = a[i + n * nrows] = Z[yno][t++];
+-    }
+-
+-    l1_(m, n, a, b, x, e);
+-
+-    /* handle case where exit code indicates numeric error */
+-    ladcode = (int) a[m + 1 + n * nrows];
+-    if (ladcode == 2) {
+-	pmod->errcode = E_SINGULAR;
+-    } else if (ladcode == 0) {
+-	gretl_model_set_int(pmod, "nonunique", 1);
+-    }
+-
+-    if (pmod->errcode == 0) {
+-	double SAR = a[m + n * nrows];
+-
+-	for (i=0; i<n; i++) {
+-	    pmod->coeff[i] = x[i];
+-	}
+-
+-	pmod->ess = 0.0;
+-	for (i=0; i<m; i++) {
+-	    t = i + pmod->t1;
+-	    pmod->yhat[t] = Z[yno][t] - e[i];
+-	    pmod->uhat[t] = e[i];
+-	    pmod->ess += e[i] * e[i];
+-	}
+-
+-	/* sum of absolute residuals */
+-	gretl_model_set_double(pmod, "ladsum", SAR);
+-
+-	/* median of dependent variable */
+-	gretl_model_add_y_median(pmod, Z[yno]);
+-
+-	/* set various stats to missing value */
+-	pmod->rsq = pmod->adjrsq = NADBL;
+-	pmod->fstt = pmod->chisq = NADBL;
+-
+-	/* LaPlace errors: equivalent of standard error is sum of
+-	   absolute residuals over nobs */
+-	pmod->sigma = SAR / pmod->nobs; 
+-
+-	lad_loglik(pmod);
+-
+-	if (bootstrap_vcv(pmod, Z, a, b, e, x, m, n, dim)) {
+-	    pmod->errcode = E_ALLOC;
+-	}
+-    }
+-
+-    pmod->ci = LAD;
+-
+-    free(a);
+-    free(x);
+-    free(e);
+-    free(b);
+-
+-    return 0;
+-}
+-- 
+1.7.2.2
+
diff --git a/gretl.spec b/gretl.spec
new file mode 100644
index 0000000..63cbc10
--- /dev/null
+++ b/gretl.spec
@@ -0,0 +1,152 @@
+Name: gretl		
+Version: 1.9.1	
+Release:	6%{?dist}
+Summary: A tool for econometric analysis	
+
+Group: Applications/Engineering
+License: GPLv3+ and BSD and MIT
+URL: http://gretl.sourceforge.net/
+Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
+#Licensing of plugins used in gretl
+Source1: gretl_plugins.txt
+#Usage of the right libdir on all arches
+#http://sourceforge.net/tracker/?func=detail&aid=3054932&group_id=36234&atid=416803
+Patch0: %{name}-%{version}-lib64.patch
+#Removal of the questionable plugin lad.c
+Patch1: %{name}-%{version}-removal-lad.c.patch
+
+BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+
+BuildRequires: desktop-file-utils
+BuildRequires:	gtk2-devel
+BuildRequires:	glib2-devel
+BuildRequires:	blas-devel
+BuildRequires:	fftw-devel
+BuildRequires:	gettext
+BuildRequires:	libxml2-devel
+BuildRequires:	gtksourceview-devel
+BuildRequires:	libgnomeui-devel
+BuildRequires:	lapack-devel
+BuildRequires:	readline-devel
+BuildRequires:	ncurses-devel
+BuildRequires:	gmp-devel
+BuildRequires:	mpfr-devel
+BuildRequires:	gnuplot
+BuildRequires: gnu-free-sans-fonts
+BuildRequires: bitstream-vera-sans-mono-fonts
+BuildRequires: bitstream-vera-sans-fonts
+
+Requires: gnuplot
+Requires: gtksourceview
+Requires: gnu-free-sans-fonts
+Requires: bitstream-vera-sans-mono-fonts
+Requires: bitstream-vera-sans-fonts
+
+%description
+A cross-platform software package for econometric analysis, 
+written in the C programming language.
+
+%package devel
+Summary: Development files for %{name}
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+
+%description devel
+This package contains the development files for %{name}.
+
+%prep
+%setup -q
+%patch0 -p1 -b .lib64
+%patch1 -p1 -b .removal
+
+%build
+%configure --disable-static
+make %{?_smp_mflags}
+cp %{SOURCE1} %{_builddir}/%{name}-%{version}/gretl_plugins.txt
+
+
+
+%install
+rm -rf %{buildroot}
+make install DESTDIR=%{buildroot}
+%find_lang %{name}
+rm -rf %{buildroot}/%{_libdir}/libgretl*.la
+rm -rf %{buildroot}/%{_libdir}/gretl-gtk2/*.la
+
+#font installation
+rm -rf %{buildroot}/%{_datadir}/%{name}/fonts/*
+ln -s %{_datadir}/fonts/bitstream-vera/Vera.ttf %{buildroot}/%{_datadir}/%{name}/fonts/Vera.ttf
+ln -s %{_datadir}/fonts/bitstream-vera/VeraMono.ttf %{buildroot}/%{_datadir}/%{name}/fonts/VeraMono.ttf
+ln -s %{_datadir}/fonts/gnu-free/FreeSans.ttf %{buildroot}/%{_datadir}/%{name}/fonts/FreeSans.ttf
+
+rm -rf %{buildroot}/%{_datadir}/%{name}/doc
+
+desktop-file-install						\
+--remove-category="Application;Science;Econometrics" \
+--add-category="Education;Science;Math;Economy;"  \
+--dir=%{buildroot}%{_datadir}/applications     \
+%{buildroot}/%{_datadir}/applications/gretl.desktop
+
+
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%files -f %{name}.lang
+%defattr(-,root,root,-)
+%{_bindir}/gretl*
+%{_libdir}/gretl-gtk2
+%{_datadir}/%{name}/
+%{_mandir}/man1/*.gz
+%{_libdir}/libgretl-1.0.so.*
+%{_datadir}/mime-info/gretl*
+%{_datadir}/gtksourceview-1.0/language-specs/*.lang
+%{_datadir}/pixmaps/*
+%{_datadir}/applications/gretl*
+
+%doc ChangeLog CompatLog README.audio README gretl_plugins.txt
+
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/pkgconfig/gretl.pc
+%{_libdir}/libgretl*.so
+%{_includedir}/%{name}/
+
+
+%changelog
+* Sat Sep 11 2010 Johannes Lips <Johannes.Lips googlemail com> 1.9.1-6
+- added the patch from Peter Lemenkov to remove the plugin lad.c
+
+* Sat Sep 11 2010 Johannes Lips <Johannes.Lips googlemail com> 1.9.1-5
+- removed the bundled fonts and symlinked system fonts
+- added gretl_plugins.txt regarding the license of gretl plugins
+- changed the Group of the devel package to Development/Libraries
+
+* Fri Sep 10 2010 Johannes Lips <Johannes.Lips googlemail com> 1.9.1-4
+- removed *.la files, bundled fonts and doc directory
+- fixed the .desktop file
+- removed duplicate COPYING file
+- added gtksourceview as a requirement
+- added the licenses for Minpack (BSD), mpack (MIT), rq (MIT)
+
+* Thu Sep 09 2010 Johannes Lips <Johannes.Lips googlemail com> 1.9.1-3
+- removed the static library
+- fixed the sourceforge url
+- restructured the %%files section
+
+
+* Thu Sep 09 2010 Johannes Lips <Johannes.Lips googlemail com> 1.9.1-2
+- split into an extra devel package
+- changed the license
+- added the url to the upstream bugreport
+- fixed the %%files section
+- usage of the %%find_lang macro to package language files
+
+* Sat Aug 28 2010 Johannes Lips <Johannes.Lips googlemail com> 1.9.1-1
+- initial fedora spec 
diff --git a/gretl_plugins.txt b/gretl_plugins.txt
new file mode 100644
index 0000000..e475ad7
--- /dev/null
+++ b/gretl_plugins.txt
@@ -0,0 +1,95 @@
+Analysis of source and data files in gretl's plugin directory
+Allin Cottrell, 2010-09-10
+
+anova.c           fully native/GPL
+arbond.c          "
+arma.c            "
+arma_common.c     "
+arma_init.c       "
+arma_priv.h       "
+arma_x12.c        "
+audio.c           "
+audioprint.c      "
+biff.h            Gnumeric-based/GPL
+dpanel.c          fully native/GPL
+duration.c        "
+eviews_import.c   "
+excel_import.c    native/Gnumeric-based/GPL
+fcp.c             derived from FIORENTINI, CALZOLARI, PANATTONI; 
+                  specific permission of authors obtained for use
+                  under GPL
+fiml.c            fully native/GPL
+fractals.c        "
+garch.c           "
+garch.h           "
+gnumeric_import.c "
+gretlzip.c        "
+gtk_compat.h      "
+heckit.c          "
+import_common.c   "
+importer.h        "
+interpolate.c     "
+interval.c        "
+jalpha.c          "
+jmulti_import.c   "
+johansen.c        "
+jprivate.h        "
+jrestrict.c       "
+kernel.c          "
+lad.c             includes reworked BARRODALE/ROBERTS code
+                  (ACM algorithm 478)
+leverage.c        fully native/GPL
+liml.c            "
+mailer.c          "
+miditypes.h       public domain
+midi_utils.c      fully native/GPL
+midi_utils.h      "
+mod_garch.c       "
+mp_ols.c          "
+odbc_import.c     "
+ods_import.c      "
+pca.c             "
+poisson.c         "
+progress_bar.c    "
+quantreg.c        "
+range-mean.c      "
+sas_import.c      "
+spss_import.c     based on GNU R/GPL
+stata_import.c    based on GNU R/GPL
+stats_tables.c    fully native/GPL
+sysest.c          "
+sysml.h           "
+tobit.c           "
+tramo_options.c   "
+tramo-x12a.c      "
+tramo_x12a.h      "
+urcdist.c         includes code copyright James G. MacKinnon, with
+                  author's specific permission to release under GPL
+vif.c             fully native/GPL
+workbook.c        "
+ 
+data/dwdata.gz    fully native/GPL
+data/urcdata.gz   as urcdist.c
+
+libole2/ms-ole.c  Gumeric-based/GPL
+libole2/ms-ole.h  Gumeric-based/GPL
+
+mpack/codes.c     Carnegie Mellon University License
+mpack/encode.c    "
+mpack/md5c.c      "
+mpack/md5.h       "
+mpack/mpack.h     "
+
+rq/rqbr.c         University of Illinois/NCSA Open Source License  
+rq/rqfnb.c        "
+rq/uiuc-ncsa.txt  copy of the above license
+
+zipunzip/LICENSE         copy of the Info-ZIP license
+zipunzip/zfileio.c       based on code under Info-ZIP license
+zipunzip/ziperr.h        "
+zipunzip/zipfile.c       "
+zipunzip/zipmain.c       "
+zipunzip/zipunzip.h      "
+zipunzip/zipwork.c       "
+zipunzip/zsystem.c       "
+zipunzip/zunz_private.h  "
diff --git a/sources b/sources
index e69de29..6d257ca 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+1227de74bdc4dde33df33103de3fdf76  gretl-1.9.1.tar.bz2


More information about the scm-commits mailing list