Quick viewing(Text Mode)

Oxmetrics News AUGUST 2002 ISSUE 2 NEW MODULES NEW RELEASES FAQS USERS VIEWS COURSES and SEMINARS Users Views 1

Oxmetrics News AUGUST 2002 ISSUE 2 NEW MODULES NEW RELEASES FAQS USERS VIEWS COURSES and SEMINARS Users Views 1

TIM65_Newsletter Ox A/W 16/8/02 1:15 PM Page 2

OxMetrics news AUGUST 2002 ISSUE 2 NEW MODULES NEW RELEASES FAQS USERS VIEWS COURSES AND SEMINARS Users Views 1. Doing Applied Mathematics with Ox By Christine Choirat

Ox, the object-oriented matrix language underlying most OxMetrics™ Casella, Chapter 5, Monte Carlo Statistical Methods, 1999) and the wave software, is mainly known within the econometric community. Being induced by a drop of milk falling into milk (from S. Steer at INRIA). a mathematician, what immediately stroke me when I first tried Ox at Titles, axes, colormaps and orientations were interactively modified the beginning of my PhD three years ago was that a larger scientific with just a few mouse clicks. But above all, Ox Professional™ allows audience could take great advantage in using it too. Indeed not to users to write their own applications with user-friendly interfaces within mention Econometrics and , I know from experience that GiveWin™. If you want your applications to have a wide distribution, Ox is also competitive in other fields, in particular where massive you can even write them as contributed packages (for example G@RCH computation is crucial: Numerical Analysis, Control Theory, Signal by S. Laurent and J.P. Peters, among an increasing number of other Processing or simulation of Dynamical Systems to name a few. The packages) downloadable from www.timberlake.co.uk. console version of Ox is free for academic purposes. Together with its (also free for academic use) dedicated editor OxEdit, which is also by itself a nice text editor for Windows™, they constitute a very comfortable programming environment.

But here I would like to insist on the following point, which is to me the most remarkable feature of Ox: Ox combines the best aspects of both a programming language (such as FORTRAN or C) and an integrated scientific environment (such as Gauss™ or Matlab™) with a large number of in-built mathematical functions.

The adjective that best describes Ox as a programming language is Test function for optimization “fast”. Ox is even fast enough to compete with FORTRAN and C/C++. But it is also fast to learn since its syntax is very similar to the one of C and C++, that are used by a vast majority of applied mathematicians. Writing code is fast as well. As Ox is matrix-oriented, the user need not write a whole matrix calculus library and can work directly on the core of the program, getting an optimized code without unnecessary loops. Moreover, the user who knows about object-programming can develop classes that make further applications straightforward. But, Ox can also be regarded as a whole scientific environment: it includes, among many others, reliable differentiation and optimization routines, that are constantly needed when writing just about any scientific program and that are desperately lacking in usual programming languages. Ox can also produce publication quality graphics (PS, EPS, etc.). Other scientific Drop of milk falling into milk environments (take a look at www.scientificweb.de/ncrunch for example) are either far too slow or far too expensive when you As a conclusion, I would just like to say that among all the languages compare them to Ox. I have worked with Ox is the one that best associates speed and convenience. I believe that Ox can potentially become a language In addition to the features of Ox that I have just mentioned, Ox commonly used by applied mathematicians, especially knowing that all Professional™ is totally integrated to GiveWin™ and offers a context the mathematical tools that are not implemented in Ox (an Ordinary sensitive help and a debugger, which is most useful when the size of Differential Equation Solver for example) can be found in many C and your programs increases. Ox Professional™ has also much more Fortran libraries and can then be easily linked and used from within Ox. graphical capabilities and can for example manipulate 3D graphics. It Christine Choirat avoids the tedious operation of saving your graphics as PS or EPS and http://viab.dauphine.fr/~choirat then displaying them with another software. U.F.. Mathématiques de la Décision Centre de Recherche Viabilité, Jeux, To show the graphical possibilities of Ox Professional™, I have Contrôle Université Paris 9 Dauphine Place du Maréchal de Lattre de Tassigny reproduced a test function for optimization (from C.P. Robert and G. 75775 Paris CEDEX 16, FRANCE TIM65_Newsletter Ox A/W 16/8/02 1:15 PM Page 3

New Releases Users Views continued Ox™ 3.2

2.Why I chose PcGive The latest version of Ox is version 3.2, released occasionally stopped at an infeasible solution in August 2002. Version 3.2 fixes a few minor without signalling this), and much faster. by Michael Yap, PhD student bugs, but also has some interesting new features. Using the new SolveQP, there is now also a constrained maximizer, MaxSQPF. SQP stands My decision to purchase PcGive The main addition is SolveNLE, to solve for sequential quadratic programming, and the Professional was firstly facilitated by nonlinear systems of equations. This function F for feasible: starting from a feasible point, all the fact that I was able to download a can handle very large systems: the largest we subsequent iterates will be feasible. demo version and evaluate it tried to date involves 100,000 variables, taking thoroughly before making a final about one hour to compute. For large systems, Also new are functions for the (generalized) decision. I was also impressed with SolveNLE avoids storing the Jacobian matrix, real Schur decomposition, (decschur and the fact that the student version was which for the previous example would be decschurgen). The latter is useful for the made available at a significant 100,000 by 100,000 (or 80 gigabyte). SolveNLE solution of multivariate linear rational discount and yet it is the full version uses a Newton-tensor method, which means expectations models. with all the features — not one with that some second derivative information is Ox 3.2 is faster again for certain operations limited capability. used in addition to the Jacobian matrix. on large matrices, in particular the Choleski PcGive is easily one of the most SolveQP has been entirely rewritten, to use decomposition, and cross-product matrices powerful econometric packages recursive updating of the QR decomposition (a’a and a*a’). A kernel plug-in mode is under available. What I really like about it is (using the new decqrupdate function). This development, which allows the replacement that, although it’s largely menu- makes SolveQP more reliable (when starting of low-level matrix functions with versions driven, which makes it easy to use, from an infeasible point, the old version that are fully optimized for specific hardware. yet it allows the user plenty of opportunities to interact with it and ‘control’ test specifications. At the PcGive™ 10.1 same time, you don’t need to learn The latest version of PcGive is version 10.1, • Variable names are back above the parameters lots of programming. In that sense, released in June 2002. This is a minor release and in the cointegration restrictions. it’s ‘the best of both worlds’. In is available free of charge to version 10.0 users. • Recursive graphs include SE when beta particular, I feel that it extremely easy The upgrade is available for download (see Web is identified. to use for analysing dynamic models. addresses in contacts) or request a CD from I am also very impressed with the ** ** Timberlake Consultants. The new features are: Progress now orders the results correctly, way it handles cointegration analysis. and shows intermediate reductions. **Descriptive Statistics** has moved to It also provides powerful graphical ** ** the Package menu, and now includes Options : added possibility to automatically analysis that can be easily principal components analysis and the print Correlation matrix, Cointegration test, incorporated into reports. Its autocorrelation function. and Cointegration test with Max test. graphing options are the best that ** ** I’ve used so far. The manuals are also If **Heteroscedasticity consistent standard Dynamic analysis prints lag analysis in well-written and thorough. What I errors** (HCSE) is selected in options: reverse order; prints intermediate lag length F-tests for single equations. Added lag structure like best about them is that examples • two versions of the tests for restrictions analysis for VAR/multivariate models. of using the software are often are printed, the standard, and using the worked into the theoretical HC variance; **Heteroscedasticity test** now uses internal discussion on the topic. This greatly • in OLS: HCSE now also in standard scaling for enhanced accuracy of the auxiliary enhances our ability to understand equation output. regression. This can give different results the techniques. The manuals can, with data that is very unevenly scaling. Also **Further Output** includes an option to therefore, be used as econometric reintroduced output of Heteroscedasticity print residuals exceeding a certain level for textbooks. coefficients from Test/Test menu. outlier detection. In my opinion, PcGive is good value **Batch** for money. **Cointegrated VAR** • added “testres { ... }” command. General restrictions: now checking that • • commands to do cointegration tests after Michael Yap, PhD student, Singapore restriction does not access higher restriction estimating a VAR: [email protected] (lower is allowed). test(“I1”); 238, Jalan Seragam Reduced form beta now includes -I block for United Garden • test(“I2”); Off Old Klang Road clarity; prints standard errors if no additional 58200 Kuala Lumpur, MALAYSIA restrictions imposed. TIM65_Newsletter Ox A/W 16/8/02 1:15 PM Page 4

FAQs Explicit declaration and SsfPack™ 3.0 (Ox Package) http://staff.feweb.vu.nl/koopman/sjhead.html implicit types in Ox by Jurgen A. Doornik SsfPack, developed by Prof. Siem Jan Koopman be easily used for implementing, fitting and (Free University Amsterdam), Prof. Neil Shephard analysing Gaussian models relevant to many Explicit declaration avoids difficult to (Oxford University) and Dr. Jurgen A Doornik areas of econometrics and statistics. find bugs, caused by minor typos, and (Oxford University) is a suite of C routines for is shared by most other languages. SsfPack 3.0 beta version has been available for Implicit typing distinguishes Ox from carrying out computations involving the download for a while now. We expect the full low-level languages. Ox has many statistical analysis of univariate and multivariate version to be released in October 2002. This variable types, including integers, models in state space form. There is a fully double precision real values (`doubles’), new version provides new functions for putting implemented link to Ox 2.0 and higher. SsfPack matrices, strings, arrays of any types, models in state space and for implementing objects, etc. The presence of integers allows for a full range of different state space specific tasks such as forecasting and and scalar doubles distinguishes Ox from forms: from a simple time-invariant model to a many other matrix languages. bootstrapping. New versions of existing SsfPack complicated time-varying model. Functions can 2 functions are also provided while the original There are several reasons why Ox be used which put standard models such as has integers: functions are kept unchanged in SsfPack 3. The ARIMA and cubic spline models into state space • addition, subtraction and updated functions are improved in various ways; form. Basic functions are available for filtering, multiplication are exact; the most essential changes are the exact treatment moment smoothing and simulation smoothing. • matrix indexing involves integers; of diffuse initial conditions, the allowance for • efficiency of single index operations. Ready-to-use functions are provided for sparse structures in state space matrices and The scalar double is mainly present for standard tasks such as likelihood evaluation, the handling of multivariate computations. efficiency reasons. forecasting and signal extraction. SsfPack can In Ox, each expression has a type, e.g.: • concatenating two strings yields a string; • multiplying two matrices gives a matrix; (Ox package) http://www.egss.ulg.ac.be/garch/garchcore.htm G@RCH 2.3 • adding two integers gives an integer; • dividing two integers gives a double.

G@RCH, developed by Sébastien LAURENT econometric softwares, including various model In languages with explicit type declaration and Jean-Philippe PETERS, is an Ox package specifications, two standard errors estimation (as in almost all low-level languages) the dedicated to the estimation and the forecasting methods (Approximate Maximum Likelihood result of an expression is coerced into the of univariate GARCH models and many of its and Approximate Quasi-Maximum Likelihood) type of the variable (so 2/3 will be 0 when assigned to an integer). In Ox however, the extensions. It can be used via OxPack (with a and four distributions (normal, Student-t, GED variable inherits the type of the expression. dialog-oriented interface) or via the traditional or skewed Student-t). Moreover, explanatory Therefore x becomes a double in x=2/3, way (OxEdit or console). The available models variables can enter the mean and/or the while x=”a”~”b” makes x a string. are ARCH, GARCH, EGARCH, GJR, APARCH, variance equations. Finally, one-step-ahead All arithmetic on a computer has IGARCH, FIGARCH, FIEGARCH, FIAPARCH (density) forecasts of both the conditional limitations, and Ox does not escape these. and HYGARCH. mean and variance are available as well as Integers range from -2^31 to 2^31-1 (the corresponding constants, defined This package provides a lot of features many miss-specification tests (Nyblom, SBT, in oxfloat.h, are INT_MIN and unavailable in most of the traditional Pearson goodness-of-fit, Box-Pierce,...). INT_MAX). When integer computations overflow or underflow, the result just wraps around. So, adding 1 to the largest integer gives the largest negative value! Two new Ox packages by James Davidson http://www.cf.ac.uk/carbs/econ/davidsonje/ It is rare to encounter this in practice. One case I have been contacted about several (GARCH/FIGARCH/ HYGARCH). times is recursive evaluation of the facto- Bootstrap and Simulation Classes rial function, n! = n!*(n-1)*...*1; 0! = 1. These Ox 3.0 classes provide the functionality Implements Whittle likelihood and conditional Successive multiplication by integers for computing bootstrap tests and confidence quasi-ML. The Doornik-Ooms ARFIMA package keeps the result as an integer, and, when intervals, and doing simulations of the same. can be called, for exact ML. Not so compre- overflow occurs, negative numbers could result. Features include a numerically efficient hensive as the Laurent-Peters G@RCH package, but offers some useful features including: The following program illustrates: implementation (due to John Nankervis) of #include the double bootstrap, and also the fast double • robust standard errors by default factint(const n) { bootstrap of Davidson and MacKinnon. Monte • automatic fitting of all ARMA specifications if (n <= 1) return 1; Carlo experiments with the double bootstrap up to a preset order, for easy model selection return n * factint(n - 1); } are feasible! • facility to fix any subset of parameters while main() { Long Memory Modelling optimizing with respect to the remainder. for (decl i = 2; i < 18; ++i) Handy for likelihood plots, diagnosis of { A package to estimate models println(“%3d”, i, “! = “, convergence problems, LM tests (computed “%15.15g”, factorial(i), with long memory in conditional mean “ “, factint(i)); automatically), etc. } (ARIMA/ARFIMA) and variance } TIM65_Newsletter Ox A/W 16/8/02 1:15 PM Page 1

New Developments in PcGets™ FAQs continued by David F. Hendry

The function factint calls itself Model selection poses great difficulties: all the For example, reported coefficient standard errors recursively, until the integer 1 is returned. statistics for selecting models and evaluating in selected equations are close to those for the All subsequent multiplications involve integers, with the computations going their specifications have distributions—usually correct model, actual test sizes are close to wrong from 13! onwards (the correct interdependent—which may be altered by each nominal, yet test powers are close to those numbers on the left-hand side modelling decision. Recent advances in computer obtainable when the correct model is known and are computed with the built-in function factorial, which is new in Ox 3.2): automation of selection algorithms have does not need selected from a large candidate set. allowed a fresh look at this old problem, both 2! = 2 2 The program can implement any desired level 3! = 6 6 by revealing high success rates, and by allowing 4! = 24 24 of stringency in searches, but embodies two 5! = 120 120 operational studies of alternative strategies. 6! = 720 720 basic strategies, conservative (which tries to 7! = 504 5040 8! = 40320 40320 PcGets—an Ox package implementing automatic minimize retention of irrelevant variables), and 9! = 362880 362880 10! = 3628800 3628800 general-to-specific (Gets) modelling for linear liberal (which seeks to maximise the chances of 11! = 39916800 39916800 regression models—mimics the theory of keeping relevant variables). The structure of the 12! = 479001600 479001600 13! = 6227020800 1932053504 reduction, whereby empirical models arise. The problem under analysis helps determine which 14! = 87178291200 1278945280 15! = 1307674368000 2004310016 analysis commences from a general congruent strategy to use: a few large needles in a large 16! = 20922789888000 2004189184 17! = 355687428096000 -288522240 specification that embeds known evidence, which haystack (i.e., a small number of very important is then simplified to a minimal representation explanatory variables in a large candidate set) Switching to real numbers requires consistent with the desired selection criteria suggests the former, many average needles in a changing one line in the program: and the data evidence. The properties of PcGets medium haystack the latter and so on. Recent factdouble(const n) { suggest that model selection can be relatively developments include a `non-expert’ mode that if (n <= 1) return 1.0; non-distortionary in practice, and ensures seeks to assist in formulating the general model, return n * factdouble(n - 1); } consistent selection in sufficiently large samples. as well as selecting the final specification.

This allows the function to go much further, until 170! The floating point Timberlake Consultants Corner computations using doubles are also subject to limitations: Courses and Seminars Panel Data Analysis with Ox and PcGive • the largest value is approximately • 1.79e+308; Timberlake Consultants, the publishers and • Financial and Econometric Modelling Using • when overflow occurs, the result distributors of OxMetrics, organize the OxMetrics PcGive and PcGets is infinity; training programme. OxMetrics courses are Applications in Financial Econometrics • about 15 of precision digits are available; • • as a consequence there is an e such that designed to help professionals grow and develop using OxMetrics 1.0+e=1.0; this is the machine precision, their existing skills and keep up with the latest • Modelling with PcGets DBL_EPSILON (about 2.2e-16). theoretical and software developments in We are introducing, in January 2003, a new statistics and econometrics. Timberlake So we can only obtain the first 15 digits of course for EViews users with one day dedicated the larger factorials (the magnitude Consultants also organize FREE seminars to automatic model selection using PcGets: of the outcome is, of course, correct). aiming to allow participants to assess in detail • Financial Modelling and Forecasting Using the features of all the OxMetrics modules. Switching to doubles gave the EViews and PcGets factorial function a larger range. In In the last 18 months, we organized several most situations, the factorial is part of Site License Plus for academic organisations an expression which has an offsetting FREE seminars in London, Washington DC, Academic Organisations using OxMetrics for denominator. An example is the binomial New York, Chicago and Tokyo. Our next FREE coefficient. Computing 200!/(0!200!) teaching will greatly benefit from the use of Site factorial seminar is in Paris, Institut Henri Poincaré, using the function results in License Plus. These licenses are: .NaN, because it involves +.Inf/+.Inf. on the 6th December 2002 and others will binomial(200,0) perpetual without incurring annual Using instead, gives follow. The timetable for these events is found • the correct answer 1. A similar success maintenance fee could have been achieved with the on our Web sites. loggamma function: log(n!) = logG(n+1), • the option to upgrade to new versions is i.e. taking logs, and then the exponent: We also run regular public attendance courses offered at reduced prices in several locations including London (UK), exp(loggamma(201) - loggamma(1) - loggamma(201)) • the university can distribute the software to New York (US), Milan (Italy) and Singapore. students without incurring further charges Some of the courses are:

Head Office Your contact is: Other offices and agencies TIMBERLAKE CONSULTANTS LTD Brazil, Italy, Portugal, Spain and the USA Unit B3, Broomsleigh Business Park Worsley Bridge Road www.timberlake.co.uk London SE26 5BN U.K. www..net Tel: +44 (0)20 8697 3377 Fax: +44 (0)20 8697 3388 www.pcgive.com e-mail: [email protected] www.stamp-software.com website: http://www.timberlake.co.uk www.timberlake-consultancy.com