This repository provides R scripts for fitting the models described in the simulation section of the paper, Smooth and Shape-Constrained Quantile Distributed Lag Models [link to the paper]. The scripts cover different approaches to model fitting, taking into account the two error term distributions discussed in the paper.
- Main-v01.R: This script is used for fitting unimodal models.
- Main-v02.R: This script is used for fitting concave models.
Both scripts accept command-line arguments for specifying the model and the error distributions. The allowed values for these parameters correspond to the models and error distributions mentioned in the paper.
--model
or-m
: Specifies the model to run. Allowed values areA
,B
, orC
.--error
or-e
: Specifies the error term distribution. Allowed values arenormal
ort
.
To run either script, use the following command format:
Rscript script_name.R -m model -e error_distribution
Replace script_name.R
with Main-v01.R
or Main-v02.R
depending on the model type you want to fit. Replace model
with A
, B
, or C
, and error_distribution with normal
or t
.
Unimodal Model with Normal Error Distribution:
Rscript Main-v01.R -m A -e normal
Concave Model with t Error Distribution:
Rscript Main-v02.R -m C -e t
To repeat the simulations as described in the paper, you will need to submit 1-2250 jobs via SLURM. This will allow you to comprehensively repeat the simulations under various configurations.
You can use the Plots.ipynb
to generate the plots similar to those in the paper. However, you will need to adjust the directory names where your results are saved accordingly.