## Previous: 1. The JAS-mine implementationAs JAS-mine supports a clear distinction between modelling classes and data structures, parameters are loaded and stored in a specific class, Parameters.java. The class makes use of the ExcelAssistant.loadCoefficientMap() method to read the parameters from MS Excel files: this requires to specify a .xls file, a sheet name, the number of key columns and the number of value columns (it is also possible to load the parameters from a table in the input database). Parameters are then stored in MultiKeyCoefficientMap objects, which are basically standard Java maps with multiple keys (Box 1).
`}` Box 1. The Parameters.loadParameters() method.
There are two types of parameters in demo07: probabilities and regression coefficients. ## 2.1 ProbabilitiesBirth ( pBirth) and death (pDeathM and pDeathF) probabilities have one key (age), while the value columns refer to different simulation years: birth and death probabilities are therefore age- and year-specific. Divorce probabilities ( pDivorce) have two keys (the lower and upper bounds defining age groups), while value columns refer again to different simulation years: divorce probabilities are therefore age group- and year-specific. Marriage ( pMarriage) and employment (pInWork) probabilities have three keys (the lower and upper bounds defining age groups and gender). Value columns in pMarriage refer to different civil states: marriage probabilities are therefore age group-, gender- and civil state-specific. Value columns in pInWork refer to different simulation years: employment probabilities are therefore age group-, gender- and year-specific. Table 3 shows how the p_birth.xls file looks like.
Table 3. Extract from the p_birth.xls file## 2.2 Regression CoefficientsRegression coefficients can have one key ( coeffMarriageFit and coeffDivorce) which is the regressor variable name, and a corresponding value with the estimated coefficient. They might have additional keys, as in coeffInWork, if the coefficients are differentiated by some other variables (gender and employment state, in this example). Table 4 shows what the corresponding reg_inwork.xls file looks like. Note that the name of the regressor variable must appear in the first column, as the regression classes expect it to be the first key in the MultiKeyCoefficientMap instance. The name of the headings for the additional key columns must match the name of a field in the relevant class, in this case, the Person class.
Table 4 Extract from the reg_inwork.xls file
The appropriate regression models are then defined based on the regression coefficients. Previous: 1. The JAS-mine implementation Next: 3. The PersonModel class |

Demo models > Demo07 >