Scientific Computing
- I propose to use R/RStudio enhanced with Rcpp/Eigen for scientific computing in applied microeconomics. There are three reasons for this choice.
- First,
tidyverse, especially dplyr, seems to be currently the most efficient and elegant way for cleaning and transforming data.
- Python's
pandas is not at this level of elegance.
- Second, RStudio is a well-designed IDE.
- I strongly recommend to develop a project as an R package, in which functions are built and loaded as if we use methods in installed packages. RStudio project is nicely integrated with this package development system.
- Python + Jupyter, Python + vscode or Python + PyCharm may be an alternative. Unless there is a strong need for machine learning modules only available in Python, R/RStudio still dominates Python for applied microeconomics projects.
- Third,
Rcpp offers an easy and elegant approach to integrate C/C++ functions.
- This will be only relevant for those who conduct a heavy computational task.
Rcpp automatically generates a wrapper function to call a C/C++ function from R. With Rcpp, we are never bothered by the way to call C/C++ functions and the way to pass objects between R and C/C++ applications.
- As I explain in the subseq5uent section, if we follow some best practices, functions written in C/C++ can be used almost in the same way as R functions.
- Moreover, R objects can be directly passed to C/C++ as Eigen objects. Thus, if functions to be translated are written with vectors and matrices, they can be literally translated into C/C++ functions using Eigen methods.
- I tried several libraries in Python of similar functionalities. But I did not find any of them worked as easy as
Rcpp did.
- Julia may be an alternative to speed up scientific computation. I am exploring this option. However, at this point, I do not choose Julia, because it does not have rich enough methods for data cleaning and transformation or statistical analysis.
Version Control
- I propose three version control configurations depending on the nature of the project.
- git/GitHub only > Configuration 1
- This is for a light project in which the codes can run in a few minutes from the data cleaning to the end of the analysis.
- Use git to version-control codes and use GitHub to host its remote repository.
- Collaborators share the codes through the GitHub remote repository.
- Raw data is hard copied among collaborators.
- The output of the codes are not shared across collaborators, but are generated locally by running the shared codes.
- git/GitHub + AWS s3 > Configuration 2
- This is a scalable configuration that works for a project of any size.
- Use git to version-control codes and use GitHub to host its remote repository.
- Collaborators share the codes through the GitHub remote repository.
- Directly read and write data in AWS s3 bucket.
- Collaborators share the data through the AWS s3 bucket.