Programming (Econometrics)

Similar documents
Programming (ERIM) Lecture 1: Introduction to programming paradigms and typing systems. Tommi Tervonen

Concepts in Programming Languages

Anders Møller Michael Schwartzbach Erik Ernst Hans Hüttel

CSc 372 Comparative Programming Languages

CSC 326H1F, Fall Programming Languages. What languages do you know? Instructor: Ali Juma. A survey of counted loops: FORTRAN

Programming Languages 2nd edition Tucker and Noonan"

Introduction to Computer Science I

COMP251: Algorithms and Data Structures. Jérôme Waldispühl School of Computer Science McGill University

Concepts of Programming Languages

INSTITUTE OF AERONAUTICAL ENGINEERING

CS 565: Programming Languages. Spring 2008 Tu, Th: 16:30-17:45 Room LWSN 1106

Topic I. Introduction and motivation References: Chapter 1 of Concepts in programming languages by J. C. Mitchell. CUP, 2003.

COSE212: Programming Languages. Lecture 0 Course Overview

Programming Languages, Summary CSC419; Odelia Schwartz

Lecture 1: Introduction. 23. August, 2010

What Is Computer Science? The Scientific Study of Computation. Expressing or Describing

Lecture content. Course goals. Course Introduction. TDDA69 Data and Program Structure Introduction

8/27/17. CS-3304 Introduction. What will you learn? Semester Outline. Websites INTRODUCTION TO PROGRAMMING LANGUAGES

CS558 Programming Languages

CS383 PROGRAMMING LANGUAGES. Kenny Q. Zhu Dept. of Computer Science Shanghai Jiao Tong University

Introduction. A. Bellaachia Page: 1

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

SYLLABUS Type of evaluation

CSC209. Software Tools and Systems Programming.

Course Syllabus. Programming Language Paradigms. Spring - DIS Copenhagen. Semester & Location: Elective Course - 3 credits.

G Programming Languages Spring 2010 Lecture 6. Robert Grimm, New York University

Announcements. 1. Forms to return today after class:

COMP 201: Principles of Programming

Course: Honors AP Computer Science Instructor: Mr. Jason A. Townsend

Welcome to Introduction to Computer Science I

Introduction to Programming System Design CSCI 455x (4 Units)

Organization of Programming Languages (CSE452) Why are there so many programming languages? What makes a language successful?

Computers and programming languages introduction

Hi! My name is Sorin. Programming Languages. Why study PL? (discussion) Why study PL? Course Goals. CSE 130 : Fall 2013

Programming Languages

CS 240 Fall Mike Lam, Professor. Just-for-fun survey:

CSC209. Software Tools and Systems Programming.

Earlier edition Dragon book has been revised. Course Outline Contact Room 124, tel , rvvliet(at)liacs(dot)nl

LECTURE 1. Overview and History

Com S 541. Programming Languages I

CSCI 3136 Principles of Programming Languages

Welcome. Orientation to online CPS102 Computer Science 2 (Java 2)

Welcome to CS 115 (Winter 2019)

Programming Languages FILS Andrei Vasilateanu

Functional Programming Lecture 1: Introduction

CS 6371: Advanced Programming Languages

Hi! My name is Sorin. Programming Languages. Why study PL? (discussion) Why study PL? Course Goals. CSE : Fall 2017

St. MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

Principles of computer programming. Profesor : doc. dr Marko Tanasković Assistent : doc. dr Marko Tanasković

Introduction to Data Structures

Seminar in Programming Languages

CS 415 Midterm Exam Spring 2002

Compiler Construction

Lecture 6 Introduction to Objects and Classes

CS 200, Section 1, Programming I, Fall 2017 College of Arts & Sciences Syllabus

Outline. Computer Science 331. Course Information. Assessment. Contact Information Assessment. Introduction to CPSC 331

Hi! My name is Sorin. Programming Languages. Why study PL? (discussion) Why study PL? Course Goals. CSE 130 : Fall 2014

INTRODUCTION PRINCIPLES OF PROGRAMMING LANGUAGES. Norbert Zeh Winter Dalhousie University 1/10

CSc 520. Course Outline (Subject to change) Course Outline (Subject to change)... Principles of Programming Languages. Christian Collberg

High Performance Computing in C and C++

CS 3110 Lecture 1 Course Overview

Computer Science 210: Data Structures

CSC2100-Data Structures

CS558 Programming Languages

overview overview who practicalities introduction data structures and algorithms lecture 1 sorting insertion sort pseudo code merge sort

Algorithms and Datastructures Runtime analysis Minsort / Heapsort, Induction

CS 3304 Comparative Languages. Lecture 1: Introduction

LN-TT Tommi Tervonen Econometric Institute Erasmus University Rotterdam. August 2013

You must pass the final exam to pass the course.

Programming Languages

Instructor: Anna Miller

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018

15-411/ Compiler Design

BOSTON UNIVERSITY Metropolitan College MET CS342 Data Structures with Java Dr. V.Shtern (Fall 2011) Course Syllabus

CS 206 Introduction to Computer Science II

Course Design Document: IS202 Data Management. Version 4.5

General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design

CSE 504: Compiler Design

What is programming? Elements of Programming Languages. From machine code to programming languages. What is a programming language?

COSC 2P90 Programming Languages & Object-Orientation

Compiler Construction

Part III Appendices 165

! Broaden your language horizons! Different programming languages! Different language features and tradeoffs. ! Study how languages are implemented

CS 314 Principles of Programming Languages

Introduction to the course and basic programming concepts

Comp 333: Concepts of Programming Languages Fall 2016

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

PRO1-I2O23 - Programming I


CISC 3130 Data Structures Fall 2018

Welcome to CS 135 (Winter 2018)

COMP 410 Lecture 1. Kyle Dewey

Beijing Jiaotong University CS-23: C++ Programming Summer, 2019 Course Syllabus

Introduction (1) COMP 520: Compiler Design (4 credits) Alexander Krolik MWF 13:30-14:30, MD 279

Functional Programming Lecture 13: FP in the Real World

Lecture 1: Course Introduction

ECE 2400 / ENGRD 2140 Computer Systems Programming Course Overview

Tales from the Workshops

About this exam review

G COURSE PLAN ASSISTANT PROFESSOR Regulation: R13 FACULTY DETAILS: Department::

Transcription:

Programming (Econometrics) Lecture 1: Introduction Tommi Tervonen Econometric Institute, Erasmus University Rotterdam

Course learning objectives After this course, you should be able to: Program econometrical models in Matlab Understand core concepts of imperative programming Explain what happens when your Matlab code is executed Understand what is an efficient algorithm Code efficient algorithms in imperative programming languages

Course organization 7 lectures Theoretical contents Provide background for the exercises 6 exercise sessions 6 exercises done in pairs - only 3 to submit Come to exercises to ask questions and get help with your code No mandatory attendance

Study load 4 ECTS = 112h 7 lectures = 14h 6 exercise sessions = 12h Exam = 3h Independent programming 83h 14h/w

Grading Exercises: 50% (16.6% each of the 3 that you choose to submit) Done in pairs (can also be done individually) Exercises will be published in BB after Monday s lecture Strict deadline on the following week s Sunday @ 23.59 (last exercise has an earlier deadline) Submission via BB: only the source file(s) in the root of a zip. Include a comment in the beginning with your name(s) and student number(s) Written exam: 50% Open questions

Making the exercises boolean done=f a l s e ; boolean u n d e r s t o o d=f a l s e ; while (! u n d e r s t o o d ) { u n d e r s t o o d = readln ( ) && r e a d E x e r c i s e ( ) ; } while (! done ) { done = code ( ) ; i f (! done ) { gethelp ( ) ; } }

Help! I can t code! 1 Read exercise & LN 2 Go to exercise sessions and get help 3 Code @ home 4 Get frustrated 5 Go to exercise sessions and get help 6 Code @ home 7 Get frustrated 8 Get help from BlackBoard forums 9 Code @ home 10 Get frustrated 11 Send Tommi email with topic [FEB22012X] Help!

Plagiarism Do not submit anything you haven t written yourself Do not submit anything that is not your idea We will not give you answers in the tutorials, but merely help you to find the answer But I could ve solved this problem myself, it was just faster to google the solution

Course staff Tommi Tervonen Lectures + exercises H11-26 Carlijn Liqui Lung Exercises on the fourth week - Also: you! Participate in course discussion forums in BB to get and provide help with the exercises

Required knowledge Introduction to Programming: Variables and methods Program flow Decisions and branching Control structures Bitwise operators Arithmetic operators Scoping

Course contents L1 Introduction Practicalities Programming paradigms Scripting languages Introduction to types L2 Computing Numerical representation Introduction to complexity theory Insertion sort L3 Memory organization Matrix representation Matrix multiplication

Course contents L4 Program correctness Side effects Pre- and post-conditions Loop invariants L5 Linear data structures Arrays, stacks and queues Linked lists L6 Nonlinear data structures Trees Heap Heapsort L7 Sorting & searching Mergesort Quick sort Binary search

Literature LN-TT-22012-3, available @ http://smaa.fi/tommi/courses/prog2/ and in print version from the student association, loosely based on a very selected set of material from: Knuth: The Art of Computer Programming (vols 1-3) Cormen, Leicerson, Rivest: Introduction to Algorithms Goulb, van Loan: Matrix Computations Wikipedia Matlab book can be useful to own All course material is posted in http://smaa.fi/tommi/courses/prog2/, and links to exercises also in BB

Software The exercise sessions will be guided with Matlab You can do most of the exercises with R, Python, or even Octave (though visualization in Octave sucks) Other courses require fluency in Matlab

Q?

The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague. E.W. Dijkstra

Programming paradigms Programming paradigms refer to the philosophy behind designing programming languages When you know to program with 1 language of a paradigm, others of the same paradigm are easy to learn (mostly just syntax)

Programming paradigms 1 Procedural / imperative paradigm (C, Pascal, Matlab, R, Fortran, Algol, Python) 2 Object-oriented paradigm (Java, Smalltalk, C++ partially) 3 Declarative paradigm, including Functional programming (ML, Lisp, Haskell, Erlang, Scala, Scheme) Logic programming (Prolog)

OO vs Procedural Object-oriented Design classes that communicate Classes with fields Suitable for large programs Access control in language Procedural Design global methods Data structures For small programs Programmer has full access Both are part of imperative paradigm: control flow consists of statements that change the state of the program x = 2; Imperative paradigm makes program correctness hard to prove, as x = 2 x 2

Compilation of languages Before source code can be executed, it needs to be compiled into an executable format The compilation can be made 1 Completely in advance to a binary executable (fast) 2 Partially in advance to bytecode to be executed in a virtual machine (Java, quite fast and portable) 3 Run-time (slow but allows easy modify & execute cycles)

Fully compiled languages (e.g. C)

Bytecode compiled languages (e.g. Java)

Runtime compiled languages (e.g. Matlab)

Scripting languages In scripting languages the instructions are compiled run-time into execution statements Slow, as less optimization can be made In languages of statistical / scientific computation, you have to understand what happens under the hood to make efficient and correct code

Introduction to types Typing systems form the core of programming languages - they allow construction of abstractions Differences in electric currency bits numbers characters objects

Strong and weak typing Strong typing: each variable has a type associated with it i n t x = 2 ; // ok x = 3 ; // ok x = s ; // e r r o r Weak typing : a single variable can be assigned varying types of values y = 3 ; % ok no type d e c l a r a t i o n r e q u i r e d y = t ; % ok

Typing in Matlab Matlab is a weakly typed language, and the following are valid expressions: x = 1 ; y = 1 ; z = x + y ; Now z =?

Next Get your copy of LN from student association Check the first exercise in the course page Make sure you understand the exercise Familiarize yourself with Matlab... and get coding!