Gretl Manual

Total Page:16

File Type:pdf, Size:1020Kb

Gretl Manual Gretl Manual Gnu Regression, Econometrics and Time-series Library Allin Cottrell Department of Economics Wake Forest University August, 2005 Gretl Manual: Gnu Regression, Econometrics and Time-series Library by Allin Cottrell Copyright © 2001–2005 Allin Cottrell Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation (see http://www.gnu.org/licenses/fdl.html). iii Table of Contents 1. Introduction........................................................................................................................................... 1 Features at a glance ......................................................................................................................... 1 Acknowledgements .......................................................................................................................... 1 Installing the programs................................................................................................................... 2 2. Getting started ...................................................................................................................................... 4 Let’s run a regression ...................................................................................................................... 4 Estimation output............................................................................................................................. 6 The main window menus................................................................................................................ 7 The gretl toolbar............................................................................................................................. 11 3. Modes of working .............................................................................................................................. 12 Command scripts ........................................................................................................................... 12 Saving script objects...................................................................................................................... 13 The gretl console ............................................................................................................................ 14 The Session concept ...................................................................................................................... 14 4. Data files ............................................................................................................................................... 18 Native format .................................................................................................................................. 18 Other data file formats.................................................................................................................. 18 Binary databases............................................................................................................................. 18 Creating a data file from scratch ................................................................................................ 19 Missing data values........................................................................................................................ 21 Data file collections........................................................................................................................ 22 5. Special functions in genr.................................................................................................................. 24 Introduction..................................................................................................................................... 24 Time-series filters........................................................................................................................... 24 Resampling and bootstrapping ................................................................................................... 25 Handling missing values ............................................................................................................... 25 Retrieving internal variables ........................................................................................................ 25 6. Sub-sampling a dataset ..................................................................................................................... 27 Introduction..................................................................................................................................... 27 Setting the sample.......................................................................................................................... 27 Restricting the sample................................................................................................................... 27 Random sampling........................................................................................................................... 29 The Sample menu items................................................................................................................ 29 7. Panel data ............................................................................................................................................. 30 Panel structure................................................................................................................................ 30 Dummy variables............................................................................................................................ 30 Lags and differences with panel data......................................................................................... 31 Pooled estimation........................................................................................................................... 31 Illustration: the Penn World Table.............................................................................................. 32 8. Graphs and plots ................................................................................................................................ 33 Gnuplot graphs ............................................................................................................................... 33 Boxplots............................................................................................................................................ 34 9. Nonlinear least squares .................................................................................................................... 36 Introduction and examples .......................................................................................................... 36 Initializing the parameters ........................................................................................................... 36 NLS dialog window ......................................................................................................................... 36 Analytical and numerical derivatives......................................................................................... 37 Controlling termination ................................................................................................................ 37 Details on the code......................................................................................................................... 38 Numerical accuracy........................................................................................................................ 38 iv 10. Loop constructs................................................................................................................................ 40 Introduction..................................................................................................................................... 40 Loop control variants .................................................................................................................... 40 Progressive mode ........................................................................................................................... 42 Loop examples ................................................................................................................................ 42 11. User-defined functions ................................................................................................................... 46 Introduction..................................................................................................................................... 46 Defining a function ........................................................................................................................ 46 Calling a function ........................................................................................................................... 46 Scope of variables........................................................................................................................... 47 Return values................................................................................................................................... 47 Error checking ................................................................................................................................. 48 12. Cointegration and Vector Error Correction Models................................................................ 49 The Johansen
Recommended publications
  • Introduction to IDL®
    Introduction to IDL® Revised for Print March, 2016 ©2016 Exelis Visual Information Solutions, Inc., a subsidiary of Harris Corporation. All rights reserved. ENVI and IDL are registered trademarks of Harris Corporation. All other marks are the property of their respective owners. This document is not subject to the controls of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). Contents 1 Introduction To IDL 5 1.1 Introduction . .5 1.1.1 What is ENVI? . .5 1.1.2 ENVI + IDL, ENVI, and IDL . .6 1.1.3 ENVI Resources . .6 1.1.4 Contacting Harris Geospatial Solutions . .6 1.1.5 Tutorials . .6 1.1.6 Training . .7 1.1.7 ENVI Support . .7 1.1.8 Contacting Technical Support . .7 1.1.9 Website . .7 1.1.10 IDL Newsgroup . .7 2 About This Course 9 2.1 Manual Organization . .9 2.1.1 Programming Style . .9 2.2 The Course Files . 11 2.2.1 Installing the Course Files . 11 2.3 Starting IDL . 11 2.3.1 Windows . 11 2.3.2 Max OS X . 11 2.3.3 Linux . 12 3 A Tour of IDL 13 3.1 Overview . 13 3.2 Scalars and Arrays . 13 3.3 Reading Data from Files . 15 3.4 Line Plots . 15 3.5 Surface Plots . 17 3.6 Contour Plots . 18 3.7 Displaying Images . 19 3.8 Exercises . 21 3.9 References . 21 4 IDL Basics 23 4.1 IDL Directory Structure . 23 4.2 The IDL Workbench . 24 4.3 Exploring the IDL Workbench .
    [Show full text]
  • A Comparative Evaluation of Matlab, Octave, R, and Julia on Maya 1 Introduction
    A Comparative Evaluation of Matlab, Octave, R, and Julia on Maya Sai K. Popuri and Matthias K. Gobbert* Department of Mathematics and Statistics, University of Maryland, Baltimore County *Corresponding author: [email protected], www.umbc.edu/~gobbert Technical Report HPCF{2017{3, hpcf.umbc.edu > Publications Abstract Matlab is the most popular commercial package for numerical computations in mathematics, statistics, the sciences, engineering, and other fields. Octave is a freely available software used for numerical computing. R is a popular open source freely available software often used for statistical analysis and computing. Julia is a recent open source freely available high-level programming language with a sophisticated com- piler for high-performance numerical and statistical computing. They are all available to download on the Linux, Windows, and Mac OS X operating systems. We investigate whether the three freely available software are viable alternatives to Matlab for uses in research and teaching. We compare the results on part of the equipment of the cluster maya in the UMBC High Performance Computing Facility. The equipment has 72 nodes, each with two Intel E5-2650v2 Ivy Bridge (2.6 GHz, 20 MB cache) proces- sors with 8 cores per CPU, for a total of 16 cores per node. All nodes have 64 GB of main memory and are connected by a quad-data rate InfiniBand interconnect. The tests focused on usability lead us to conclude that Octave is the most compatible with Matlab, since it uses the same syntax and has the native capability of running m-files. R was hampered by somewhat different syntax or function names and some missing functions.
    [Show full text]
  • Sage 9.4 Reference Manual: Finite Rings Release 9.4
    Sage 9.4 Reference Manual: Finite Rings Release 9.4 The Sage Development Team Aug 24, 2021 CONTENTS 1 Finite Rings 1 1.1 Ring Z=nZ of integers modulo n ....................................1 1.2 Elements of Z=nZ ............................................ 15 2 Finite Fields 39 2.1 Finite Fields............................................... 39 2.2 Base Classes for Finite Fields...................................... 47 2.3 Base class for finite field elements.................................... 61 2.4 Homset for Finite Fields......................................... 69 2.5 Finite field morphisms.......................................... 71 3 Prime Fields 77 3.1 Finite Prime Fields............................................ 77 3.2 Finite field morphisms for prime fields................................. 79 4 Finite Fields Using Pari 81 4.1 Finite fields implemented via PARI’s FFELT type............................ 81 4.2 Finite field elements implemented via PARI’s FFELT type....................... 83 5 Finite Fields Using Givaro 89 5.1 Givaro Finite Field............................................ 89 5.2 Givaro Field Elements.......................................... 94 5.3 Finite field morphisms using Givaro................................... 102 6 Finite Fields of Characteristic 2 Using NTL 105 6.1 Finite Fields of Characteristic 2..................................... 105 6.2 Finite Fields of characteristic 2...................................... 107 7 Miscellaneous 113 7.1 Finite residue fields...........................................
    [Show full text]
  • Python – an Introduction
    Python { AN IntroduCtion . default parameters . self documenting code Example for extensions: Gnuplot Hans Fangohr, [email protected], CED Seminar 05/02/2004 ² The wc program in Python ² Summary Overview ² Outlook ² Why Python ² Literature: How to get started ² Interactive Python (IPython) ² M. Lutz & D. Ascher: Learning Python Installing extra modules ² ² ISBN: 1565924649 (1999) (new edition 2004, ISBN: Lists ² 0596002815). We point to this book (1999) where For-loops appropriate: Chapter 1 in LP ² ! if-then ² modules and name spaces Alex Martelli: Python in a Nutshell ² ² while ISBN: 0596001886 ² string handling ² ¯le-input, output Deitel & Deitel et al: Python { How to Program ² ² functions ISBN: 0130923613 ² Numerical computation ² some other features Other resources: ² . long numbers www.python.org provides extensive . exceptions ² documentation, tools and download. dictionaries Python { an introduction 1 Python { an introduction 2 Why Python? How to get started: The interpreter and how to run code Chapter 1, p3 in LP Chapter 1, p12 in LP ! Two options: ! All sorts of reasons ;-) interactive session ² ² . Object-oriented scripting language . start Python interpreter (python.exe, python, . power of high-level language double click on icon, . ) . portable, powerful, free . prompt appears (>>>) . mixable (glue together with C/C++, Fortran, . can enter commands (as on MATLAB prompt) . ) . easy to use (save time developing code) execute program ² . easy to learn . Either start interpreter and pass program name . (in-built complex numbers) as argument: python.exe myfirstprogram.py Today: . ² Or make python-program executable . easy to learn (Unix/Linux): . some interesting features of the language ./myfirstprogram.py . use as tool for small sysadmin/data . Note: python-programs tend to end with .py, processing/collecting tasks but this is not necessary.
    [Show full text]
  • A Fast Dynamic Language for Technical Computing
    Julia A Fast Dynamic Language for Technical Computing Created by: Jeff Bezanson, Stefan Karpinski, Viral B. Shah & Alan Edelman A Fractured Community Technical work gets done in many different languages ‣ C, C++, R, Matlab, Python, Java, Perl, Fortran, ... Different optimal choices for different tasks ‣ statistics ➞ R ‣ linear algebra ➞ Matlab ‣ string processing ➞ Perl ‣ general programming ➞ Python, Java ‣ performance, control ➞ C, C++, Fortran Larger projects commonly use a mixture of 2, 3, 4, ... One Language We are not trying to replace any of these ‣ C, C++, R, Matlab, Python, Java, Perl, Fortran, ... What we are trying to do: ‣ allow developing complete technical projects in a single language without sacrificing productivity or performance This does not mean not using components in other languages! ‣ Julia uses C, C++ and Fortran libraries extensively “Because We Are Greedy.” “We want a language that’s open source, with a liberal license. We want the speed of C with the dynamism of Ruby. We want a language that’s homoiconic, with true macros like Lisp, but with obvious, familiar mathematical notation like Matlab. We want something as usable for general programming as Python, as easy for statistics as R, as natural for string processing as Perl, as powerful for linear algebra as Matlab, as good at gluing programs together as the shell. Something that is dirt simple to learn, yet keeps the most serious hackers happy.” Collapsing Dichotomies Many of these are just a matter of design and focus ‣ stats vs. linear algebra vs. strings vs.
    [Show full text]
  • A Note on Random Number Generation
    A note on random number generation Christophe Dutang and Diethelm Wuertz September 2009 1 1 INTRODUCTION 2 \Nothing in Nature is random. number generation. By \random numbers", we a thing appears random only through mean random variates of the uniform U(0; 1) the incompleteness of our knowledge." distribution. More complex distributions can Spinoza, Ethics I1. be generated with uniform variates and rejection or inversion methods. Pseudo random number generation aims to seem random whereas quasi random number generation aims to be determin- istic but well equidistributed. 1 Introduction Those familiars with algorithms such as linear congruential generation, Mersenne-Twister type algorithms, and low discrepancy sequences should Random simulation has long been a very popular go directly to the next section. and well studied field of mathematics. There exists a wide range of applications in biology, finance, insurance, physics and many others. So 2.1 Pseudo random generation simulations of random numbers are crucial. In this note, we describe the most random number algorithms At the beginning of the nineties, there was no state-of-the-art algorithms to generate pseudo Let us recall the only things, that are truly ran- random numbers. And the article of Park & dom, are the measurement of physical phenomena Miller (1988) entitled Random generators: good such as thermal noises of semiconductor chips or ones are hard to find is a clear proof. radioactive sources2. Despite this fact, most users thought the rand The only way to simulate some randomness function they used was good, because of a short on computers are carried out by deterministic period and a term to term dependence.
    [Show full text]
  • Package 'Randtoolbox'
    Package ‘randtoolbox’ January 31, 2020 Type Package Title Toolbox for Pseudo and Quasi Random Number Generation and Random Generator Tests Version 1.30.1 Author R port by Yohan Chalabi, Christophe Dutang, Petr Savicky and Di- ethelm Wuertz with some underlying C codes of (i) the SFMT algorithm from M. Mat- sumoto and M. Saito, (ii) the Knuth-TAOCP RNG from D. Knuth. Maintainer Christophe Dutang <[email protected]> Description Provides (1) pseudo random generators - general linear congruential generators, multiple recursive generators and generalized feedback shift register (SF-Mersenne Twister algorithm and WELL generators); (2) quasi random generators - the Torus algorithm, the Sobol sequence, the Halton sequence (including the Van der Corput sequence) and (3) some generator tests - the gap test, the serial test, the poker test. See e.g. Gentle (2003) <doi:10.1007/b97336>. The package can be provided without the rngWELL dependency on demand. Take a look at the Distribution task view of types and tests of random number generators. Version in Memoriam of Diethelm and Barbara Wuertz. Depends rngWELL (>= 0.10-1) License BSD_3_clause + file LICENSE NeedsCompilation yes Repository CRAN Date/Publication 2020-01-31 10:17:00 UTC R topics documented: randtoolbox-package . .2 auxiliary . .3 coll.test . .4 coll.test.sparse . .6 freq.test . .8 gap.test . .9 get.primes . 11 1 2 randtoolbox-package getWELLState . 12 order.test . 12 poker.test . 14 pseudoRNG . 16 quasiRNG . 22 rngWELLScriptR . 26 runifInterface . 27 serial.test . 29 soboltestfunctions . 31 Index 33 randtoolbox-package General remarks on toolbox for pseudo and quasi random number generation Description The randtoolbox-package started in 2007 during an ISFA (France) working group.
    [Show full text]
  • Introduction to GNU Octave
    Introduction to GNU Octave Hubert Selhofer, revised by Marcel Oliver updated to current Octave version by Thomas L. Scofield 2008/08/16 line 1 1 0.8 0.6 0.4 0.2 0 -0.2 -0.4 8 6 4 2 -8 -6 0 -4 -2 -2 0 -4 2 4 -6 6 8 -8 Contents 1 Basics 2 1.1 What is Octave? ........................... 2 1.2 Help! . 2 1.3 Input conventions . 3 1.4 Variables and standard operations . 3 2 Vector and matrix operations 4 2.1 Vectors . 4 2.2 Matrices . 4 1 2.3 Basic matrix arithmetic . 5 2.4 Element-wise operations . 5 2.5 Indexing and slicing . 6 2.6 Solving linear systems of equations . 7 2.7 Inverses, decompositions, eigenvalues . 7 2.8 Testing for zero elements . 8 3 Control structures 8 3.1 Functions . 8 3.2 Global variables . 9 3.3 Loops . 9 3.4 Branching . 9 3.5 Functions of functions . 10 3.6 Efficiency considerations . 10 3.7 Input and output . 11 4 Graphics 11 4.1 2D graphics . 11 4.2 3D graphics: . 12 4.3 Commands for 2D and 3D graphics . 13 5 Exercises 13 5.1 Linear algebra . 13 5.2 Timing . 14 5.3 Stability functions of BDF-integrators . 14 5.4 3D plot . 15 5.5 Hilbert matrix . 15 5.6 Least square fit of a straight line . 16 5.7 Trapezoidal rule . 16 1 Basics 1.1 What is Octave? Octave is an interactive programming language specifically suited for vectoriz- able numerical calculations.
    [Show full text]
  • A Tutorial on Reliable Numerical Computation
    A tutorial on reliable numerical computation Paul Zimmermann Dagstuhl seminar 17481, Schloß Dagstuhl, November 2017 The IEEE 754 standard First version in 1985, first revision in 2008, another revision for 2018. Standard formats: binary32, binary64, binary128, decimal64, decimal128 Standard rounding modes (attributes): roundTowardPositive, roundTowardNegative, roundTowardZero, roundTiesToEven p Correct rounding: required for +; −; ×; ÷; ·, recommended for other mathematical functions (sin; exp; log; :::) 2 Different kinds of arithmetic in various languages fixed precision arbitrary precision real double (C) GNU MPFR (C) numbers RDF (Sage) RealField(p) (Sage) MPFI (C) Boost Interval (C++) RealIntervalField(p) (Sage) real INTLAB (Matlab, Octave) RealBallField(p) (Sage) intervals RIF (Sage) libieeep1788 (C++) RBF (Sage) Octave Interval (Octave) libieeep1788 is developed by Marco Nehmeier GNU Octave Interval is developed by Oliver Heimlich 3 An example from Siegfried Rump Reference: S.M. Rump. Gleitkommaarithmetik auf dem Prüfstand [Wie werden verifiziert(e) numerische Lösungen berechnet?]. Jahresbericht der Deutschen Mathematiker-Vereinigung, 118(3):179–226, 2016. a p(a; b) = 21b2 − 2a2 + 55b4 − 10a2b2 + 2b Evaluate p at a = 77617, b = 33096. 4 Rump’s polynomial in the C language #include <stdio.h> TYPE p (TYPE a, TYPE b) { TYPE a2 = a * a; TYPE b2 = b * b; return 21.0*b2 - 2.0*a2 + 55*b2*b2 - 10*a2*b2 + a/(2.0*b); } int main() { printf ("%.16Le\n", (long double) p (77617.0, 33096.0)); } 5 Rump’s polynomial in the C language: results $ gcc -DTYPE=float rump.c && ./a.out -4.3870930862080000e+12 $ gcc -DTYPE=double rump.c && ./a.out 1.1726039400531787e+00 $ gcc -DTYPE="long double" rump.c && ./a.out 1.1726039400531786e+00 $ gcc -DTYPE=__float128 rump.c && ./a.out -8.2739605994682137e-01 6 The MPFR library A reference implementation of IEEE 754 in (binary) arbitrary precision in the C language.
    [Show full text]
  • Regression Models by Gretl and R Statistical Packages for Data Analysis in Marine Geology Polina Lemenkova
    Regression Models by Gretl and R Statistical Packages for Data Analysis in Marine Geology Polina Lemenkova To cite this version: Polina Lemenkova. Regression Models by Gretl and R Statistical Packages for Data Analysis in Marine Geology. International Journal of Environmental Trends (IJENT), 2019, 3 (1), pp.39 - 59. hal-02163671 HAL Id: hal-02163671 https://hal.archives-ouvertes.fr/hal-02163671 Submitted on 3 Jul 2019 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Distributed under a Creative Commons Attribution| 4.0 International License International Journal of Environmental Trends (IJENT) 2019: 3 (1),39-59 ISSN: 2602-4160 Research Article REGRESSION MODELS BY GRETL AND R STATISTICAL PACKAGES FOR DATA ANALYSIS IN MARINE GEOLOGY Polina Lemenkova 1* 1 ORCID ID number: 0000-0002-5759-1089. Ocean University of China, College of Marine Geo-sciences. 238 Songling Rd., 266100, Qingdao, Shandong, P. R. C. Tel.: +86-1768-554-1605. Abstract Received 3 May 2018 Gretl and R statistical libraries enables to perform data analysis using various algorithms, modules and functions. The case study of this research consists in geospatial analysis of Accepted the Mariana Trench, a hadal trench located in the Pacific Ocean.
    [Show full text]
  • Gretl User's Guide
    Gretl User’s Guide Gnu Regression, Econometrics and Time-series Allin Cottrell Department of Economics Wake Forest university Riccardo “Jack” Lucchetti Dipartimento di Economia Università di Ancona November, 2005 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation (see http://www.gnu.org/licenses/fdl.html). Contents 1 Introduction 1 1.1 Features at a glance ......................................... 1 1.2 Acknowledgements ......................................... 1 1.3 Installing the programs ....................................... 2 2 Getting started 4 2.1 Let’s run a regression ........................................ 4 2.2 Estimation output .......................................... 6 2.3 The main window menus ...................................... 7 2.4 The gretl toolbar ........................................... 10 3 Modes of working 12 3.1 Command scripts ........................................... 12 3.2 Saving script objects ......................................... 13 3.3 The gretl console ........................................... 14 3.4 The Session concept ......................................... 14 4 Data files 17 4.1 Native format ............................................. 17 4.2 Other data file formats ....................................... 17 4.3 Binary databases ........................................... 17 4.4 Creating a data file from scratch ................................
    [Show full text]
  • Gretl User's Guide
    Gretl User’s Guide Gnu Regression, Econometrics and Time-series Allin Cottrell Department of Economics Wake Forest university Riccardo “Jack” Lucchetti Dipartimento di Economia Università Politecnica delle Marche December, 2008 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation (see http://www.gnu.org/licenses/fdl.html). Contents 1 Introduction 1 1.1 Features at a glance ......................................... 1 1.2 Acknowledgements ......................................... 1 1.3 Installing the programs ....................................... 2 I Running the program 4 2 Getting started 5 2.1 Let’s run a regression ........................................ 5 2.2 Estimation output .......................................... 7 2.3 The main window menus ...................................... 8 2.4 Keyboard shortcuts ......................................... 11 2.5 The gretl toolbar ........................................... 11 3 Modes of working 13 3.1 Command scripts ........................................... 13 3.2 Saving script objects ......................................... 15 3.3 The gretl console ........................................... 15 3.4 The Session concept ......................................... 16 4 Data files 19 4.1 Native format ............................................. 19 4.2 Other data file formats ....................................... 19 4.3 Binary databases ..........................................
    [Show full text]