Julia the Tesla of Programing Languages the Sort Version

Total Page:16

File Type:pdf, Size:1020Kb

Julia the Tesla of Programing Languages the Sort Version Julia The Tesla of Programing Languages The Sort Version "Flexible as Python Easy as Matlab Fast as Fortran Deep as Lisp" using Dates tonext(today()) do d dayofweek(d) == Fri && day(d) == 13 && month(d) == Feb end 2026-02-13 2 Two Language Problem Matlab Julia R Python Scala Interactive Java Rust, C Fortan Speed 3 Python is Slow But ... Pandas, NumPy and SciPy are really fast Because the computations are done in C Which can be faster than Julia code 4 Notable Uses Federal Reserve Bank Model of US Economy 10 times faster than MATLAB model Celeste Peak performance of 1.54 petaFLOPS using 1.3 million threads Only Julia, C, C++ and Fortran have achieved petaFLOPS computations Climate Modeling Alliance Caltech, MIT, Naval Postgraduate School, JPL coalition Using Julia to implement next generation global climate model 5 Why Julia Designed by and for people doing computational programming using current technology Interactive Fast Simple syntax Can call C/Fortran/Java/R/Python/Matlab code Libraries Statistics ML Web Graphics, etc Lisp-like macros Open Source - Free Paid support available 6 Will Look like Python Dynamic Typing a = 5 a = "cat" function foo(x) function bar(x::Int64)::Int64 y = 2 y::Int64 = 2 return x + y x + y end end foo(3) bar(3) foo(2.3) bar(2.3) Error MethodError: no method matching bar(::Float64) Closest candidates are: bar(!Matched::Int64) 7 Julia Superpower #1 Julia Jit compiler generates efficient code without type type annotations There are situations to avoid function foo(x) y = 2 return x + y end 8 function inc(x) Σ(x, y) = x + y return x + 1 Use LaTeX for symbol Type \ select from suggestions end Σ(1,5) function inc(x) δ = 0.003 x + 1 end inc(x) = x + 1 f(x, y) = 2(x + 3) - 3y 9 Superpower #2 Multiple Dynamic Dispatch f(x) = "general" f("cat") # "general" f(x::Number) = "general number" f(12) # "int" f(x::Int64) = "int" f(12.3) # "Large float" f(x::Float32) = "Small float" f(2//3) # "general number" (2//3 rational) f(x::Float64) = "Large float" 1//3 + 1//7 == 10//21 methods(f) # 6 methods for generic function "f": [1] f(x::Float64) in Main at /Users/whitney/Courses/696/Spring20/JuliaExamples/intro.jl:86 [2] f(x::Float32) in Main at /Users/whitney/Courses/696/Spring20/JuliaExamples/intro.jl:85 [3] f(x::Int64) in Main at /Users/whitney/Courses/696/Spring20/JuliaExamples/intro.jl:84 [4] f(x::Number) in Main at /Users/whitney/Courses/696/Spring20/JuliaExamples/intro.jl:83 [5] f(x) in Main at /Users/whitney/Courses/696/Spring20/JuliaExamples/intro.jl:82 [6] f(x, y) in Main at /Users/whitney/Courses/696/Spring20/JuliaExamples/intro.jl:76 10 Showing Multiple Dispatch g(x::Int64,y::Float64) = "int first" g(x::Float64,y::Int64) = "int last" a = 4 b = 3.2 g(a,b) # "int first" a = 1.2 b = 6 g(a,b) #"int last" 11 Broadcast function foo(x) bar(x) = x + (iseven(x) ? 2 : -2) if iseven(x) x + 2 else bar.(1:10) x - 2 end end 10-element Array{Int64,1}: -1 4 foo(2) # 4 1 6 foo(3) #1 3 8 foo.([1 2 3 4]) # [1 4 1 6] 5 10 7 12 12 Some History 1984 Matlab 1991 Python 2000 R - 1.0 2014 Julia 0.3 2018 Julia 1.0 2019 Dec 30 Julia 1.3.1 13 Julia Calling Python Code using Pkg Pkg.add("Conda") Pkg.add("PyCall") #installing - done once using Conda using PyCall math = pyimport("math") #Using Python math module math.sin(math.pi / 4) Conda.add("matplotlib") plt = pyimport("matplotlib.pyplot") # Using Python matplotlib x = range(0; stop=2*pi, length=1000) y = sin.(3*x + 4*cos.(2*x)); plt.plot(x, y, color="red", linewidth=2.0, linestyle="--") plt.show() 14 Julia Calling Python Code Conda.add("matplotlib") plt = pyimport("matplotlib.pyplot") # Using Python matplotlib x = range(0; stop=2*pi, length=1000) y = sin.(3*x + 4*cos.(2*x)); plt.plot(x, y, color="red", linewidth=2.0, linestyle="--") plt.show() 15 Julia and R Pkg.add("RCall") ENV["R_HOME"]="*" Pkg.build("RCall") # Done once y = 1 R"""f <- function(x, y) x + y using RCall ret <- f(1, $y) """ r_result = R"rnorm(10)" julia_result = rcopy(r_result) RObject{VecSxp} One Sample t-test julia_data = randn(10) r_result = R"t.test($julia_data)" data: `#JL`$julia_data t = -0.34784, df = 9, p-value = 0.736 alternative hypothesis: true mean is not equal to 0 R"optim(0, $(x -> x-cos(x)), method='BFGS')" 95 percent confidence interval: -0.9621269 0.7056758 sample estimates: mean of x -0.1282256 16 Julia and R julia> using RCall Using REPL julia> foo = 1 Toggle between Julia and R 1 Type $ to activate R R> x <- $foo R> x [1] 1 R> y = $(rand(10)) R> sum(y) [1] 3.273645 R> backspace to leave R julia> 17 Data Science JuliaML – Machine Learning (Gitter) JuliaStats – Statistics JuliaImages – Image Processing JuliaText – Natural Language Processing (NLP) JuliaDatabases – Various database drivers for Julia JuliaData – Data manipulation, storage, and I/O in Julia Scientific Domains BioJulia – Biology (Gitter) EcoJulia – Ecology JuliaAstro – Astronomy (Gitter) JuliaDSP – Digital signal processing JuliaQuant – Finance JuliaPhysics – Physics JuliaDynamics - Dynamical systems, nonlinear dynamics and chaos. JuliaGeo – Earth science, geospatial data processing JuliaMolSim – Molecular Simulation in Materials Science and Chemistry JuliaReach - Reachability Computations for Dynamical Systems (Gitter) 18 Stats Packages StatsBase StatsModels DataFrames Distributions MultivariateStats HypothesisTests ML Distances KernelDensity Clustering Generalized linear models Nonnegative matrix factorization TimeSeries BayesNets 19 Julia Observer https://juliaobserver.com Find Julia packages 20 Should You Learn Julia? Researcher Just use existing libraries? Satisfied with current language/system? Student What are you interested in? 21 Getting Started Using Julia https://julialang.org 22 Installing Julia & IDE Easiest Way Julia Pro - free https://juliacomputing.com/products/juliapro More Involved Download Julia https://julialang.org/downloads/ Install Juno (Atom) https://junolab.org 23 Demo 24 Julia vs Python Python Everywhere Easy to use Libraries for everything Slow 3D finite difference time domain simulation of electromagnetic wave propagation EE graduate student - little programing experience in Python or Julia Naive Naive Optimized C Julia Python Julia Ave 0.426 22.6 145.2 0.620 Ratio to C 1.00 52.9 341.1 1.5 25 First Run Compiles Code function sumer(n) localsum = 0 for k in 1:n localsum = k + localsum end localsum end @time sumer(1_000_000) 0.002106 seconds (769 allocations: 44.500 KB) @time sumer(1_000_000) 0.000003 seconds (5 allocations: 176 bytes) 26 Use Functions - Top level treated differently const N = 1_000_000 sum = 0 Time Memory @time for k = 1:N 0.05 sec 30.5 MB sum = sum + k end function sumer(n) localsum = 0 for k in 1:n localsum = k + localsum Time Memory end 0.000003 sec 176 bytes localsum end @time sumer(N) 27 Avoid changing the type of a variable function sumerbad(n) @time sumerbad(N) localsum = 0 # Int for k in 1:0.5:n÷2 Time Memory localsum = k + localsum # now float 0.058 sec 30.5 MB end localsum end function sumergood(n) @time sumergood(N) localsum = 0.0 # float for k in 1:0.5:n÷2 Time Memory localsum = k + localsum # float 0.004 sec 176 bytes end localsum end 28 Type Stability Return type of a function should only depend on the type of its arguments Compiler can generate efficient code for type stable functions pos(x) = x < 0 ? 0 : x pos(2.3) returns a float pos(-2.3) returns an integer pos(x) = x < x ? zero(x) : x pos(2.3) returns a float pos(-2.3) returns a float Type stable 25% faster 29 Julia Parallel Processing Low level constructs High level constructs Runs on Multicore processors Clusters Cluster management Experimental Julia to C/C++ compilers from Intel Labs Run Julia code 20 to 100 times faster than Spark 30 Low Level Parallel Constructs addprocs(2) remote = @spawn rand(2,2) fetch(remote) addprocs(10) Each worker will sum 10_000 @parallel (+) for k = 1:100_000 random numbers rand(1) end Master will sum up the 10 results Assuming you have 10 processors 31 High Level Parallel using DistributedArrays onmaster = rand(100,100) distributed = distribute(onmaster) #distribute onmaster to the workers sum(distributed) # compute sum locally on workers # combine the result on master heads = map(x -> x > 0.5, distributed) # apply map on workers # return result on master 32.
Recommended publications
  • Sagemath and Sagemathcloud
    Viviane Pons Ma^ıtrede conf´erence,Universit´eParis-Sud Orsay [email protected] { @PyViv SageMath and SageMathCloud Introduction SageMath SageMath is a free open source mathematics software I Created in 2005 by William Stein. I http://www.sagemath.org/ I Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab. Viviane Pons (U-PSud) SageMath and SageMathCloud October 19, 2016 2 / 7 SageMath Source and language I the main language of Sage is python (but there are many other source languages: cython, C, C++, fortran) I the source is distributed under the GPL licence. Viviane Pons (U-PSud) SageMath and SageMathCloud October 19, 2016 3 / 7 SageMath Sage and libraries One of the original purpose of Sage was to put together the many existent open source mathematics software programs: Atlas, GAP, GMP, Linbox, Maxima, MPFR, PARI/GP, NetworkX, NTL, Numpy/Scipy, Singular, Symmetrica,... Sage is all-inclusive: it installs all those libraries and gives you a common python-based interface to work on them. On top of it is the python / cython Sage library it-self. Viviane Pons (U-PSud) SageMath and SageMathCloud October 19, 2016 4 / 7 SageMath Sage and libraries I You can use a library explicitly: sage: n = gap(20062006) sage: type(n) <c l a s s 'sage. interfaces .gap.GapElement'> sage: n.Factors() [ 2, 17, 59, 73, 137 ] I But also, many of Sage computation are done through those libraries without necessarily telling you: sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]]) sage : G . g a p () Group( [ (3,4), (1,2,3)(4,5) ] ) Viviane Pons (U-PSud) SageMath and SageMathCloud October 19, 2016 5 / 7 SageMath Development model Development model I Sage is developed by researchers for researchers: the original philosophy is to develop what you need for your research and share it with the community.
    [Show full text]
  • 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]
  • 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]
  • MANNING Greenwich (74° W
    Object Oriented Perl Object Oriented Perl DAMIAN CONWAY MANNING Greenwich (74° w. long.) For electronic browsing and ordering of this and other Manning books, visit http://www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact: Special Sales Department Manning Publications Co. 32 Lafayette Place Fax: (203) 661-9018 Greenwich, CT 06830 email: [email protected] ©2000 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Library of Congress Cataloging-in-Publication Data Conway, Damian, 1964- Object oriented Perl / Damian Conway. p. cm. includes bibliographical references. ISBN 1-884777-79-1 (alk. paper) 1. Object-oriented programming (Computer science) 2. Perl (Computer program language) I. Title. QA76.64.C639 1999 005.13'3--dc21 99-27793 CIP Manning Publications Co. Copyeditor: Adrianne Harun 32 Lafayette
    [Show full text]
  • Introduction to Ggplot2
    Introduction to ggplot2 Dawn Koffman Office of Population Research Princeton University January 2014 1 Part 1: Concepts and Terminology 2 R Package: ggplot2 Used to produce statistical graphics, author = Hadley Wickham "attempt to take the good things about base and lattice graphics and improve on them with a strong, underlying model " based on The Grammar of Graphics by Leland Wilkinson, 2005 "... describes the meaning of what we do when we construct statistical graphics ... More than a taxonomy ... Computational system based on the underlying mathematics of representing statistical functions of data." - does not limit developer to a set of pre-specified graphics adds some concepts to grammar which allow it to work well with R 3 qplot() ggplot2 provides two ways to produce plot objects: qplot() # quick plot – not covered in this workshop uses some concepts of The Grammar of Graphics, but doesn’t provide full capability and designed to be very similar to plot() and simple to use may make it easy to produce basic graphs but may delay understanding philosophy of ggplot2 ggplot() # grammar of graphics plot – focus of this workshop provides fuller implementation of The Grammar of Graphics may have steeper learning curve but allows much more flexibility when building graphs 4 Grammar Defines Components of Graphics data: in ggplot2, data must be stored as an R data frame coordinate system: describes 2-D space that data is projected onto - for example, Cartesian coordinates, polar coordinates, map projections, ... geoms: describe type of geometric objects that represent data - for example, points, lines, polygons, ... aesthetics: describe visual characteristics that represent data - for example, position, size, color, shape, transparency, fill scales: for each aesthetic, describe how visual characteristic is converted to display values - for example, log scales, color scales, size scales, shape scales, ..
    [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]
  • Comp 411 Principles of Programming Languages Lecture 19 Semantics of OO Languages
    Comp 411 Principles of Programming Languages Lecture 19 Semantics of OO Languages Corky Cartwright Mar 10-19, 2021 Overview I • In OO languages, OO data values (except for designated non-OO types) are special records [structures] (finite mappings from names to values). In OO parlance, the components of record are called members. • Some members of an object may be functions called methods. Methods take this (the object in question) as an implicit parameter. Some OO languages like Java also support static methods that do not depend on this; these methods have no implicit parameters. In efficient OO language implementations, method members are shared since they are the same for all instances of a class, but this sharing is an optimization in statically typed OO languages since the collection of methods in a class is immutable during program evaluation (computation). • A method (instance method in Java) can only be invoked on an object (the receiver, an implicit parameter). Additional parameters are optional, depending on whether the method expects them. This invocation process is called dynamic dispatch because the executed code is literally extracted from the object: the code invoked at a call site depends on the value of the receiver, which can change with each execution of the call. • A language with objects is OO if it supports dynamic dispatch (discussed in more detail in Overview II & III) and inheritance, an explicit taxonomy for classifying objects based on their members and class names where superclass/parent methods are inherited unless overridden. • In single inheritance, this taxonomy forms a tree; • In multiple inheritance, it forms a rooted DAG (directed acyclic graph) where the root class is the universal class (Object in Java).
    [Show full text]
  • Dynamic Dispatch
    CS 3110 Lecture 24: Dynamic Dispatch Prof. Clarkson Spring 2015 Today’s music: "Te Core" by Eric Clapton Review Current topic: functional vs. object-oriented programming Today: • Continue encoding objects in OCaml • Te core of OOP – dynamic dispatch – sigma calculus Review: key features of OOP 1. Encapsulation 2. Subtyping 3. Inheritance 4. Dynamic dispatch Review: Counters class Counter {! protected int x = 0;! public int get() { return x; }! public void inc() { x++; }! }! Review: Objects • Type of object is record of functions !type counter = {! !get : unit -> int;! !inc : unit -> unit;! !} • Let-binding hides internal state (with closure) !let x = ref 0 in {! !get = (fun () -> !x);! !inc = (fun () -> x := !x+1);! !}! Review: Classes • Representation type for internal state: !type counter_rep = {! !!x : int ref;! !}! • Class is a function from representation type to object: !let counter_class (r:counter_rep) = {! !!get = (fun () -> !(r.x));! !!inc = (fun () -> (r.x := !(r.x) + 1));! !}! • Constructor uses class function to make a new object: !let new_counter () =! !!let r = {x = ref 0} in! ! !counter_class r !! Review: Inheritance • Subclass creates an object of the superclass with the same internal state as its own – Bind resulting parent object to super • Subclass creates a new object with same internal state • Subclass copies (inherits) any implementations it wants from superclass 4. DYNAMIC DISPATCH This class SetCounter {! protected int x = 0;! public int get() { return x; }! public void set(int i) { x = i; }! public void inc()
    [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]
  • Automated Likelihood Based Inference for Stochastic Volatility Models H
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Institutional Knowledge at Singapore Management University Singapore Management University Institutional Knowledge at Singapore Management University Research Collection School Of Economics School of Economics 11-2009 Automated Likelihood Based Inference for Stochastic Volatility Models H. Skaug Jun YU Singapore Management University, [email protected] Follow this and additional works at: https://ink.library.smu.edu.sg/soe_research Part of the Econometrics Commons Citation Skaug, H. and YU, Jun. Automated Likelihood Based Inference for Stochastic Volatility Models. (2009). 1-28. Research Collection School Of Economics. Available at: https://ink.library.smu.edu.sg/soe_research/1151 This Working Paper is brought to you for free and open access by the School of Economics at Institutional Knowledge at Singapore Management University. It has been accepted for inclusion in Research Collection School Of Economics by an authorized administrator of Institutional Knowledge at Singapore Management University. For more information, please email [email protected]. Automated Likelihood Based Inference for Stochastic Volatility Models Hans J. SKAUG , Jun YU November 2009 Paper No. 15-2009 ANY OPINIONS EXPRESSED ARE THOSE OF THE AUTHOR(S) AND NOT NECESSARILY THOSE OF THE SCHOOL OF ECONOMICS, SMU Automated Likelihood Based Inference for Stochastic Volatility Models¤ Hans J. Skaug,y Jun Yuz October 7, 2008 Abstract: In this paper the Laplace approximation is used to perform classical and Bayesian analyses of univariate and multivariate stochastic volatility (SV) models. We show that imple- mentation of the Laplace approximation is greatly simpli¯ed by the use of a numerical technique known as automatic di®erentiation (AD).
    [Show full text]