Computation brush up 2015

This course gives some basic knowledge of software packages for economics. The goal is to provide students with the skills to read, understand and produce simple scripts. By the end of the course students should be able to import (or simulate) data and perform appropriate manipulations to obtain convenient outputs. All relevant material to solve problems and exercises will be presented in class. Syllabus: ComputaionBrushUp2015Syllabus

Class 1: Desktop basics: workspace, command windows, command history, current folder. Generating variables: vectors, matrix, addressing information in matrix, basic matrix manipulation.

Slides: GSE - Class I.pdf.

Class Material: Class I download.

Homework: HW1.pdf,HW1solution.

Class 2: More matrix operations: trace, determinant, diagonal, inverse, rank, Cholesky, sort. Bulit-in functions: input, output and help function. How to use functions: example with eigenvalues, eigenvectors and orthonormal matrices. Loading and saving data. Other variables: strings and cell arrays.

Slides: GSE - Class II.pdf.

Class Material: Class II download,CW3solution.m

Homework: HW2.pdf,HW2solution.

Class 3: Random variables, density function. Random number generator: random draws, distributions. Descriptive statistic: mean, median, std,var, cov, corcoeff. Estimator properties: unbiasedness, consistency.

Slides: GSE - Class III.pdf.

Class Material: Class III download,CW4solution.m,CW5solution.m,CW6solution.m.

Homework: HW3.pdf,HW3solution.

Class 4: Flow control. Known number of iterations: loops "for". Conditional statements "if": syntax and examples. Unknown number of iterations: "while" loops. Nesting different statements.

Slides: GSE - Class IV.pdf.

Class Material: Class IV download, CW7solution.m,CW8solution.m.

Homework: HW4.pdf,HW4solution.

Class 5: 2D graphs: plot, scatter, histogram, pie, area. Graphical details: axis, legend, labels, title. Multiple plots: subplots. 3D graphs, multivariate distributions.

Slides: GSE - Class V.pdf.

Class Material: Class V download,CW8solution.m,CW9solution.m.

Homework: HW5.pdf,HW5solution.

Class 6: Writing functions in Matlab: syntax, single output, multiple outputs, advanced tricks and tips. Multidimensional arrays (MDAs): generating tensors, operations, reshaping and rotating MDAs.

Slides: GSE - Class VI.pdf.

Class Material: Class VI download.

Homework: HW6.pdf.

Final Exercise: Final Exercise.pdf,Finalsolution.m.

STATA RESOURCES:

Helpful tutorials and resources on the use of Stata:

  • UCLA Stata has a good Starter Kit.

    • (UCLA Academic Technology Services, USA)

  • UNC Stata introduction for Stata 13 users.

    • (Carolina Population Center, University of North Carolina at Chapel Hill, USA)

  • Princeton Stata contains a extensive user guide.

    • (Princeton Data and Statistical Services, USA)

  • Stata tutorial a brief tutorial.

    • (Germán Rodríguez, Princeton University, USA)