VisionEval / VisionEval-Dev

Development version of VisionEval framework
https://visioneval.github.io/
Apache License 2.0
6 stars 32 forks source link

Set random seed in model estimation code which uses stochastic processes #88

Open gregorbj opened 4 years ago

gregorbj commented 4 years ago

Some of the modules use stochastic processes in the estimation of models. For example the CalculateHouseholdDvmt module estimates a binary logit model of the probability that a household has any vehicle travel on a given day and a linear model of the amount of travel on a given day. The linear model predicts an average of a distribution and then a value is drawn from the distribution. The binary logit and linear models (drawing from distribution) are run 1000 times for each household in the model estimation dataset to simulate 1000 days of travel. Average DVMT for each household is then calculated from the simulated values. A linear model of average DVMT is then estimated using those results. No random seed is set in the process so every time the script is run (i.e. whenever the package is installed) the model will be slightly different. Random seeds should be set in every model estimation script that uses stochastic processes in model estimation. This will assure replicability.

jrawbits commented 2 years ago

And we need some way to let the user set those seeds at build time. I'd suggest adding a field in build/config/VE-Components.yml called "Seed" and letting the user set it there (and perhaps having a derfault in the VE-config.yml). When building the modules, the Seed would be set in the system environment and used by the estimation code. Obviously, we need to visit all the estimations as Brian suggests to ensure that random seeds (where used) are being explicitly set from such a parameter.

jrawbits commented 1 year ago

The Seed-setting is now available in VE 3.0 (VEModel), but we need to ensure the parameter is accessed when each of the indicated modules run.