# Econ 413R (Boot Camp) Introduction¶

## The Mission of the BYU-MCL¶

The BYU Macroeconomics and Computational Laboratory (BYU-MCL) was founded in March 2012 in the Department of Economics at Brigham Young University thanks to support from an anonymous donor, the BYU College of Family, Home and Social Sciences, and the BYU Department of Economics. The mission of the BYU-MCL is to train undergraduate students in advanced programming and computational methods that are useful for solving dynamic economic modeling problems in order for them to have the opportunity to make coauthor-level contributions to research projects. We use three main outcomes to measure the success of our program.

1. Research projects to which our students have made a coauthor-level contribution.
2. Student presentations of research at academic conferences.
3. Student placements after graduation in both graduate programs and private sector jobs.

In the first year of the BYU-MCL, our students have coauthored a large number of papers [1], have presented their research at great academic conferences [2], and have received placements to top graduate schools and private sector employers [3].

The BYU-MCL is a direct descendant of the IMPACT program (Interdisciplinary Mentoring Program in Analysis, Computation, and Theory) at BYU, which was started by Professor Jeffrey Humpherys in 2007 with funding from the National Science Foundation and has now become the Computational and Applied Mathematics major. As evidenced in its name, the IMPACT program was more interdisciplinary than the BYU-MCL, which now focuses exclusively on economic applications. The BYU-MCL accomplishes its mission by funding a group of undergraduate students to go through a rigorous “Boot Camp” training experience followed by a high-level of involvement in a mentored research project that hopefully results in a coauthored paper with the mentoring professor.

 [1] A list of papers can be found at the BYU-MCL Working Paper web page
 [2] A list of past and upcoming conference presentation is available on the BYU-MCL web page.
 [3] The academic placements of our students include the PhD programs at Stanford Finance, MIT Economics, Chicago Economics, NYU Stern Economics, and Carnegie Mellon Economics. The private sector placements of our students include Savvy Sherpa Consulting.

## Macroeconomic Philosophy¶

As multiple ideologies and factions exist in macroeconomics, [4] it is important to state macroeconomic philosophy of the BYU-MCL. We focus on an approach to answering economic questions that starts with modeling the decisions of individual agents—such as households, firms, governments, central banks—and includes a dimension of decision making over time.

The characteristic of our macroeconomic ideology of explicitly modeling the decisions of individual agents is often summarized as macroeconomics that is based on microeconomic foundations or “microfoundations”. These individual decisions then have to be added up in order to arrive at the macroeconomic variables of interest. In fact, the only difference between this type of macroeconomics and microeconomics is the adding up of the individual decisions. The main alternative to macroeconomics based on microfoundations is to simply assume relationships between macroeconomic variables, and analyze those macroeconomic relationships statistically. A focus on microfoundations was initially a hallmark of Neoclassical or RBC macroeconomics. However, the importance of microfoundations has now become standard in both New Keynesian and RBC macroeconomic modeling.

Another distinguishing characteristic of macroeconomics from microeconomics that holds in a majority of instances is a focus in macroeconomics on dynamic models. Dynamic models are models in which economic decisions today influence decisions in later periods. It is hard to imagine any economic decision that is truly static and does not have some dynamic component. However, sometimes a static model might be a satisfactory approximation for the true dynamic model. Although many microeconomic studies do focus on dynamic models this has traditionally been the exception rather than the rule. A focus on dynamic is another hallmark of macroeconomics.

The discussion above implies that the only explicit difference between macroeconomics and microeconomics is the type of question your are asking. If it is an economic question about aggregate variables, it is macroeconomics and requires the extra step (along with the accompanying mathematical and computational complexities) of adding up the microeconomic decisions. Otherwise it is microeconomics. In our opinion, the only material difference between macroeconomics and microeconomics is the economic question. The methods are essentially the same. Therefore, the distinction between macroeconomics and microeconomics is not that important. However, it is hard to overstate the degree of the theoretical and computational complexities that accompany the added macroeconomic step of aggregating individual decision making. The BYU-MCL is called the “Macroeconomics” laboratory because our preference is to work on questions that focus on these aggregate variables.

 [4] The two main “flavors” of macroeconomics today can be summarized as New Keynesian and Neoclassical or Real Business Cycle (RBC). The two ideologies are sometimes referred to as “salt water” and “fresh water” macroeconomics, respectively, because of the historical adherence to New Keynesian macroeconomics at the East Coast Universities (e.g., Harvard, MIT) and the historical adherence to the Neoclassical macroeconomics at the Midwestern Universities (e.g., Chicago, Minnesota). Chari, Kehoe, and McGrattan (2009) [ChariEtAl:2009] and Woodford (2009) [Woodford:2009] provide nice introductions into the differences between the two types of macroeconomics and how they are productively converging. It is important to recognize another faction that argues that the New Keynesian versus Neoclassical approach is incomplete, broken and misleading. In the past, these groups fell under the rubric of “heterodox macroeconomics”. However, more recently, these heterodox types of arguments have gained a larger audience.

## Computational Focus¶

The other term in the title of the BYU-MCL is “Computational”. The BYU-MCL’s focus on scientific computing comes directly from the added complexities from aggregating individual decision making in order to study dynamic macroeconomic questions based on microeconomic foundations. The first problem that arises with these models is that analytical or closed form solutions are not possible. This requires the researcher computes solutions numerically using the computer. However, the bigger problem that can easily arise is that the scope and size of the model can be such that numerical solutions become intractable. It is not difficult to create an economic model with enough dimensions of heterogeneity or enough moving parts to tax the limits of personal computers and even supercomputers.

For this reason, computational economics has become an important tool in macroeconomics. Our models are becoming ever more realistic with more dimensions of heterogeneity among agents and more simultaneous decisions being modeled. Macroeconomists are increasingly using supercomputers to solve their models with parallel processing.

## Great Books¶

The two Bibles of any good first-year PhD course in macroeconomics are Stokey and Lucas (1989) [StokeyLucas:1989] and Ljungqvist and Sargent (2012) [LjungqvistSargent:2012]. Stokey and Lucas (1989) [StokeyLucas:1989] is a highly technical theoretical treatise of formulating dynamic economics problems as recursive problems, and comes complete with fixed point theorems, proofs, and functional (in the calculus of variations sense) characterizations of solutions. Ljungqvist and Sargent (2012) [LjungqvistSargent:2012] is more accessible and focuses more on delivering tools and many many applications. An even lighter version of Ljungqvist and Sargent (2012) [LjungqvistSargent:2012] is Adda and Cooper (2003) [AddaCooper:2003], which has fewer applications but has the best description of how to implement value function iteration that I have seen in a textbook. McCandless (2008) [McCandless:2008] provides a nice survey of Neoclassical RBC macroeconomic models and how to solve them.

In terms of tools and methods, Heer and Maussner (2009) [HeerMaussner:2009] and Judd (1998) [Judd:1998] are fantastic. Heer and Maussner (2009) [HeerMaussner:2009] provide the most comprehensive reference available for current solution methods and comparisons across different types of dynamic general equilibrium economic models. I have used this book extensively in my current research. Judd (1998) [Judd:1998] is a more general and deeper mathematical reference of how to compute the different numerical concepts required by economic theory.

We will draw heavily upon these references in the Boot Camp curriculum and in the research projects that you do after Boot Camp.

## Programming Languages and Protocols¶

Scientific computing in economics really started with the Fortran programming language in the 1950s, and was primarily used for inverting large matrices in econometric estimation of linear systems or solutions to a linearized economic multi-equation model. Fortran‘s prominence in other fields of scientific computing led to large repositories of optimized Fortran code for specific complex operations. Because Fortran is a compiled, low-level programming language, it is very fast. But it takes many lines of code to execute a given operation. C and C++ are other low-level alternatives to Fortran that have extensive repositories of optimized libraries and have fast computation times but take more lines of code for a given operation.

A more broadly used computing platform in economics is Matlab, which is a software package specialized in computation using matrix operations. Matlab‘s programming language is a high-level technical computing language, but it was not designed as an object-oriented language, only superficially supports object-oriented programming, and is not a fully functional programming language. It is limited to a smaller set of mathematical matrix functionality. Matlab is not as fast as Fortran or C, but it is easier to write Matlab code (it takes fewer lines of code to perform the same operation).

An alternative to Matlab that has gained a lot of momentum in the last 10 years is Python. Python is a fully functional high-level multi-platform programming language that has been adopted by multiple national laboratories. It has some of the same virtues of Matlab of requiring few lines of code for a given operation, but Python also has a number of advantages over Matlab.

### Python over Matlab¶

Python has some significant advantages over Matlab.

1. As mentioned before, Python is a full object-oriented programming language, whereas Matlab is limited to mathematical operations on a restricted set of object types. As such, Python allows for a broader range of operations and fully supports functional, procedural, object-oriented, and imperative programming paradigms. As an example, one of our students wrote Python code for scraping and storing stock options financial data.
2. Python can be easily used as a wrapper for faster low-level code in C, C++, and Fortran. MIT Lincoln Laboratory, Lawrence Livermore National Laboratory, and Oak Ridge National Laboratory all have many programmers using Python as their wrapper for more complex low-level code routines. Using Python as a wrapper allows quick writing of the basic organizing code while farming out specific, time-consuming processes to faster low-level code.
3. Python is more easily parallelizable than Matlab. The Python library mpi4py allows for very flexible parallelization.
4. Python is free.

In Matlab‘s defense, it does have some advantages over Python.

1. Some of Matlab‘s built-in overhead can be valuable. For example, inverting a matrix in Matlab performs many tests on the matrix in order to determine the most efficient and accurate method of performing the inversion. In Python, the programmer must specify the method of inversion or simply choose among a number of inversion commands. Another example is the flexibility of Matlab‘s constrained minimizer function fmincon. It takes some extra know-how for the Python programmer to find suitable optimization routines using standard Python packages (e.g. scipy).
2. Some processes in Matlab are faster than Python. For example, for loops slow down both Python and Matlab. But they seem to slow Python down more, especially as the degree of nesting in the for loops increases.

### Coding best practices¶

We want to create Python programming snobs for a number of reasons. First, we want to create a library of Python scripts that BYU-MCL researchers can use that are efficient and easy to read and modify. This requires well written code. Another reason for writing nice code is that we want to contribute to the broader Python scientific computing community. This requires that we all speak the same language.

The Python community has established a number of coding standards. A list of Python Enhancement Proposals (PEPs) are maintained online. PEP 20 is snarkily entitled, “The Zen of Python” and is a short list of one-line axioms that Python code should follow. These axioms include:

1. Beautiful is better than ugly.
2. Explicit is better than implicit.
3. Simple is better than complex.
4. Complex is better than complicated.
5. Flat is better than nested.
6. Sparse is better than dense.

PEP 8 is the full “Style Guide for Python Code”. Although adherence to every point in the style guide might be overkill, we encourage BYU-MCL students to follow this guide. As a side note, the Sublime Text 2 text editor has a package called SublimeLinter that highlights parts of your Python code that do not conform to PEP 8.

Lastly, documentation of your code is very important, both for others being able to read your code and for you being able to remember what you were doing. We ask that you to follow the Guide to NumPy and SciPy Documentation. This will allow a tool like Sphinx to automatically generate online documentation for your Python script.

### git and Bitbucket.org¶

As we have already discussed, collaboration on computational research projects is an important part of the BYU-MCL. But coordination problems can arise when multiple individuals are working on the same code. git software is a powerful version control system that allows simultaneous work on the same files, advanced merging of simultaneous changes, and easy reversion to past versions of the file. git is the standard platform among programmers for collaborating on coding projects, and we have had success in using it for our collaborations in the BYU-MCL.

Files that are used through git must be placed in a “repository”. A git repository can be on your hard drive, on a flash drive, or on an online server. For most collaborations in the BYU-MCL we will put our git repositories on bitbucket.org. An alternative online location for git repositories is github.com. github is more widely used than bitbucket and is better for public (open source) git projects in that github is free to all public repository users. However, bitbucket is free for academic users of private repositories in contrast to github which charges for private repositories. For this reason, we will use bitbucket.

### LaTeX¶

Each student needs to learn how to create documents using LaTeX, which has become the standard for document generation in mathematics. LaTeX came into existence to improve the ability to word process documents that included extensive mathematical notation and equations. But the philosophy of LaTeX has broadened over its life. The strength of LaTeX is that it allows the user to focus on the content, while different formatting requirements can be added by settings that are chosen independent of the content. In addition, citations, references to figures, tables, and equation, and the display of mathematical objects is flexible and elegant.

For compiling LaTeX documents, we recommend using Sublime Text 2. But Mac users can use TeXShop, and Windows users can use MikTeX. A great way to get started using LaTeX is to get a good template of a document from a more experienced user.

## The Best Students¶

In the years we have been running this program—both with the BYU-MCL and its predecessor IMPACT—we have learned some lessons about what characteristics are common across our best students and how they interact with the program. Some of these characteristics are obvious, but some of them were a surprise to us.

### The program is consistently successful¶

We have found, to our surprise, that the rigorous curriculum and format of “Boot Camp” combined with a mentored research experience in which the students have a significant amount of ownership in their projects consistently produces good research as well as powerful undergraduate students who achieve the highest levels of academic honors.

In early 2012, we were getting ready to set up the BYU-MCL in the BYU Department of Economics and were transitioning it over from the IMPACT program which had been administered out of the BYU Department of Mathematics. We had two economics undergraduate students who had been in the IMPACT program in its last year 2011/2012. We felt like both of these students were outstanding researchers that had impressive theoretical and computational tool boxes and had proven themselves in terms of their research. One of them was accepted to the Economics PhD program at MIT and received the NSF Graduate Fellowship award. The other one was accepted to the Economics PhD program at Carnegie Mellon University.

I remember a conversation among David Spencer, Kerk Phillips, and me as we were getting ready to begin the first year of the BYU-MCL in which we expressed the thought that we should not expect to produce that caliber of students each year. However, the academic products and outcomes of the first cohort of BYU-MCL students was at least as good as that last group of economics students that came through the IMPACT program. The lesson that we think we are learning from our experience with this program is that it has the ability to consistently deliver tremendous outcomes for the students that are part of it.

### Hard work (not genius) is the necessary condition¶

The students selected into the BYU-MCL are not a random sample of the population. The average GPA is high, and the mathematics, economics, and computer science backgrounds of the students are to be envied. We are lucky to be able to work with such intelligent students. The probability of a student’s success is almost always an increasing function of intelligence. However, given some minimal threshhold, we have found that extremely high intelligence is neither a necessary nor sufficient condition for success.

Put differently, every year there is a distribution among our students of preparation and understanding of math, economics, and computer programming. But we have found that the best predictor of success is not a student’s initial preparation level. The best predictor of success has been how hard a student has been willing to work. This is certainly correlated with how much the student naturally enjoys the material, but it does not seem to be correlated with his initial ranking along dimensions associated with intelligence. One way to interpret this is that conceptual shortcomings can be overcome with effort and hours.

This principle is likely more broadly applicable than just to our BYU-MCL example. We know of no other way to internalize complex ideas and methods than to spend hours in both guided and independent practice. We will provide many opportunities for this practice. And the students who avail themselves of these opportunities tend to be among our most successful. We have had students who started out toward the bottom of the preparation/intelligence index who ended up being our best researchers. And it was always because of their willingness to work hard.

### Collaboration is an essential skill¶

Before joining the BYU-MCL, many students’ experience with group projects and collaboration is negative. It often involves enduring free riding from other group members or suffering penalties from other group members poor performance. One of the primary virtues of the Boot Camp experience is the way it necessitates positive collaboration among the students. A clear example of this is the number of times that the collaboration with fellow students is mentioned in the comments from last year’s students in Section Student Comments about Boot Camp about the program immediately following Boot Camp.

We have intentionally designed the Boot Camp curriculum to make collaboration nearly essential. We encourage you to work in groups, to solve the problems together, and to develop coding strategies together. The faculty and TAs are here to help you, but no one will be more valuable to you in completing assignments than your fellow students.

Learning to function effectively in a collaborative environment is a key skill in any research field, whether in the private sector, in government, in graduate school, or as an academic. We have been very pleased with the collaborative activities that this program has fostered and the effects of those activities on the research produced.

### Good things come to entrepreneurial students¶

Being entrepreneurial means taking advantage of any opportunities you can. Think up research questions on your own. Go deeper in your study of programming languages. When new projects come up with the MCL faculty, express interest in working on them. Help other students with roadblocks that they are encountering. You might come up with a paper together.

One student was eager to take the job of being the minivan driver to and from the airport for the speakers at a conference we organized. His involvement as a driver allowed him to have long periods of uninterrupted conversation with some of the best economists in their field. This driving job was one that did not have a long line of volunteers. Yet this student’s involvement as a driver led very directly to his being hired as a research assistant for an NYU Professor while this student was in the BYU-MCL. This student later ended up being accepted to the PhD program in economics at the NYU Stern School.

We will not make you be successful. We want you to take the tools that we give you to make yourself successful. We will simply try to give you opportunities.

Boot Camp ends up being the focal experience that BYU-MCL students look back on as characterizing what the program is about. Below are some comments from former students about their experience completing Boot Camp.

I really enjoyed the collaboration between students. The class was fast paced and required that we developed a strong trust between classmates in order to work together and assist in each other’s learning process. I also really enjoyed the openness of both the Professors and the TAs. I felt confident that when I had questions they would be more than willing to set aside a few minutes in order to help me understand the material. I loved the difficulty of the class.... Boot Camp is certainly the name that is appropriate for the class. Boot Camp was a totally new experience. I had never been required to push myself so hard to understand such large quantities of material. The environment in which such an intelligent group of students are able to gather together and understand a high level of material made it some of the most interesting weeks of my year – Chase Coleman, BYU-MCL 2012–2013

Boot camp was the most unique learning experience I have had at BYU. The structured, direct teaching style coupled with the rigorous course-work made for an awesome and highly productive two months. Being new to high-level economics and academic research in general, I feel that without the boot camp experience I wouldn’t be prepared for my position as a research assistant or applications to graduate school. I would highly recommend boot camp to any aspiring economics student, or anyone interested in learning advanced applied mathematics and computer science. – Spencer Lyon, BYU-MCL 2012–2013

The only thing I can say about boot camp is that the six weeks of mental abuse have had the highest returns out of any other class I have taken as an undergraduate. Looking back at conferences I have attended, journal articles I have read, and research I have done, I feel like the shades of ignorance have been removed and that I can finally understand and contribute to the academic and economic research world. – Timothy Hills, BYU-MCL 2012–2013

Boot camp was a very stressful but also a very enriching experience. I really enjoyed being able to push myself beyond what I thought was possible. The ability to work with other students and learn how to do collaborative research with other students was a priceless experience. Overall, I enjoyed the time that I was able to put into this exercise. – T.J. Canann, BYU-MCL 2012–2013

I believe one of the strong points of boot camp was the camaraderie. The group of students and instructors we had was absolutely wonderful. Of course, having the chance to be introduced to so many new topics was exhilarating. I most enjoyed implementing some of the various math and econ algorithms on the computer. I feel as if Boot Camp has been the single most enriching academic experience in the whole of my scholastic life. – Christian Baker, BYU-MCL 2012–2013

While boot camp was the hardest term I have taken, I really enjoyed gaining a stronger mathematics and economics foundation and learning how to effectively collaborate with others. I now feel much more prepared to conduct economics research. Furthermore, the professors were exceptionally helpful and encouraging in pushing us to be our best. I also throughly enjoyed working with my fellow students. Working through challenging homework sets, computer programs, and mathematical proofs in this group was an amazing experience because our work was truly collaborative: each student put forth their best efforts, which, when put together, exceeded anything we could have accomplished individually. – Sara Ehlert, BYU-MCL 2012–2013

I have never been in a better learning environment than Boot Camp. The professors work closely with you and help you master the material. The classwork pushed me to my limits and expanded my capacity to solve problems and think analytically. And it is not just busy work. Every assignment helped me become a better problem solver which is important no matter what you study. However, working with fellow students to solve difficult problems was the highlight of Boot Camp. I learned a lot from my classmates, made friends, and it was a lot of fun. – Ryan Brunt, BYU-MCL 2012–2013

Bootcamp was a tremendous learning opportunity. It moved quickly and covered a lot of material but I loved the exposure to so many models and problem solving methods—most of which I otherwise would not have seen in my undergraduate studies. I’m grateful to have had the opportunity to gain knowledge and ability that will help me make meaningful contributions to research as an undergrad and will open doors in my future. – Ryne Belliston, BYU-MCL 2012–2013

## Let’s Get Started¶

With these preliminaries out of the way, we are excited to get started with this new year in the BYU-MCL. Boot Camp will be difficult but rewarding. It will give you the foundation and skills to make a coauthor-level contribution to an economic research project that you choose. The degree to which you are able to be successful in the program will depend on your ability to work hard, collaborate effectively, and be entrepreneurial. We, the faculty of the BYU-MCL, will be available and accessible to you to help you be successful. This program is truly a mentoring collaboration between students and professors that we enjoy on many levels.

In his historical fiction novel, 1356: A Novel, Cornwell (2012, p. 355) [Cornwell:2012] describes Edward, the Prince of Wales, as motivating his commander in the Battle of Poitiers by exclaiming, “Go with God,... and fight like the devil.” Eric Eide, the Department Chairman of the BYU Department of Economics, suggested the following adaptation of that quote for the BYU-MCL. “Go with God, and compute like the devil.” Properly latinized, as any self-respecting motto should be, we say:

$\textit{Vade cum Deo et computare similis diabolo}$

## References¶

 [AddaCooper:2003] Adda, J., and R. Cooper (2003): Dynamic Economics: Quantitative Methods and Applications. MIT Press.
 [ChariEtAl:2009] Chari, V. V., P. J. Kehoe, and E. R. McGrattan (2009): New Keynesian Models: Not Yet Useful for Policy Analysis,” American Economic Journal: Macroeconomics, 1(1), 242{266.
 [Cornwell:2012] Cornwell, B. (2012): 1356: A Novel. New York: Harper.
 [HeerMaussner:2009] (1, 2) Heer, B., and A. Maussner (2009): Dynamic General Equilibrium Modeling: Computational Methods and Applications. Springer, second edn.
 [Judd:1998] (1, 2) Judd, K. L. (1998): Numerical Methods in Economics. MIT Press.
 [LjungqvistSargent:2012] (1, 2, 3) Ljungqvist, L., and T. J. Sargent (2012): Recursive Macroeconomic Theory. MIT Press, third edn.
 [McCandless:2008] McCandless, G. (2008): The ABCs of RBCs: An Introduction to Dynamic Macroeconomic Models. Harvard University Press.
 [StokeyLucas:1989] (1, 2) Stokey, N. L., and R. E. Lucas, Jr. (1989): Recursive Methods in Economic Dynamics. Harvard University Press.
 [Woodford:2009] Woodford, M. (2009): Convergence in Macroeconomics: Elements of the New Synthesis,” American Economic Journal: Macroeconomics, 1(1), 267{279.

Economics 413R

#### Next topic

Overlapping Generations Models