# README | Structural Estimation

## Version information

Release tag: `aer-1.0`


## Scripts in this directory

./run.R: runs the estimations


## Remarks

1. Estimation details and model specifications are described in Appendix B.3 of
   the paper. A comparison of the estimation results with the nonparametric
   index is depicted in Table A2 of the appendix.
2. The estimation script written in the R language (`https://www.r-project.org`)
   has dependencies on other packages. The exact versions preinstalled on the
   DST (Statistics Denmark) servers at the point in time of estimation are
   listed below. The software has been tested exclusively using these package
   versions. It may _not_ work properly with older or newer versions of the dependencies.[^1]

[^1]: If the respective package versions are not available on the machine
    intended to run the estimations, these packages can be installed by pulling
    the respective package version or source from CRAN-like/git repositories. To
    install, use the `install_version` function provided by the package
    `devtools` (the exact version can be passed as an argument), or pull the
    correct source tarball from the release repository either by referring
    `install_packages` directly to the remote archive or your local clone.
 
  
## Dependencies

1. `data.table 1.12.2`
2. `formatR 1.6`
3. `lambda.r 1.2.3`
4. `lambda.tools 1.0.9`

Tested with `R 3.5.2` (as installed on the DST machine during the point in time of estimation).


## Instructions

1. Copy the data to `./data` folder. Note that the data is required to have a specific form
   decribed in the `read` function of `./scripts/estim.R`.
2. Parameterize the character string `fdata` in `./run.R` such that it
points to the data CSV file.
3. Run `./run.R`.
4. Wait.
5. Collect the CSV files in `./output`. For each model, they contain the `pnr`
   (anonymized subject identifier assigned by DST) and the model parameter estimates for further processing.
