run

Run simulation of a EUROMOD tax-benefit system.

Description

example

S = run(Model,country_id,system_id,data,data_id) returns simulation results running from the Model class.

example

S = run(Country,system_id,data,data_id) returns simulation results running from the Country class.

example

S = run(System,data,data_id) returns simulation results running from the System class.

example

S = run(___,Name,Value) returns simulation results specifying additional optional input arguments.

Examples

collapse all

Running a simulation from the Model class requires 4 other input arguments: two-letters country code, system name, dataset and dataset name. Below is an example for system SE_2021 of Sweden:

mod = euromod("C:\EUROMOD_RELEASES_I6.0+");
data = readtable("SE_2021_b1.txt");
S=mod.run("SE","SE_2021",data,"SE_2021_b1");
S 
1×1 Simulation with properties:
            
             outputs: {[21671×240 table]}
            settings: [1×1 struct]
    output_filenames: "se_2021_std"
              errors: [0×1 string]

output 1 : [21671x240 table]
    idhh   idperson   idmother   idfather   idpartner   idorighh   idorigperson   dag   dgn   dec
    200     20001          0        0            0        200         20001       45    1     0
    300     30001          0        0        30002        300         30001       26    1     0
    300     30002          0        0        30001        300         30002       26    0     0
    500     50001          0        0        50002        500         50001       37    1     0
    500     50002          0        0        50001        500         50002       33    0     0
    500     50003      50002    50001            0        500         50003        4    1     1
    ...
        

Running a simulation from the Country class requires 3 other input arguments: system name, dataset and dataset name.

    mod = euromod("C:\EUROMOD_RELEASES_I6.0+");
    data = readtable("SE_2021_b1.txt");
    S=mod.("SE").run("SE_2021",data,"SE_2021_b1");
    S 
1×1 Simulation with properties:
                
                 outputs: {[21671×240 table]}
                settings: [1×1 struct]
        output_filenames: "se_2021_std"
                  errors: [0×1 string]   

Running a simulation from the System class requires 2 other input arguments: dataset and dataset name.

    mod = euromod("C:\EUROMOD_RELEASES_I6.0+");
    data = readtable("SE_2021_b1.txt");
    S=mod.("SE").("SE_2021").run(data,"SE_2021_b1");
    S 
1×1 Simulation with properties:
                
                 outputs: {[21671×240 table]}
                settings: [1×1 struct]
        output_filenames: "se_2021_std"
                  errors: [0×1 string] 

Specify optional simulation settings as Name-Value input arguments. Below is an example with the addons option:

S=mod.('SE').('SE_2021').run(data,"SE_2021_b1",addons=["MTR","MTR"]);
Simulation SE_2021_base_mtr, system se_2021_mtr, data SE_2021, country SE_2021_b1: finished.
S  
1×1 Simulation with properties:
         
         outputs: {[21671×246 table]  [21671×39 table]}
        settings: [1×1 struct]
output_filenames: ["se_2021_base_mtr"    "se_2021_mtr"]
          errors: [0×1 string]   

Input Arguments

collapse all

The Model class returned by euromod.

Data Types: class

A country from the Country class array.

Data Types: class

A system from the System class array.

Data Types: class

Two-letters country code as explained in the Eurostat Glossary:Country codes

Data Types: string scalar

The name of a tax-benefit system as configured in EUROMOD.

Data Types: string scalar

A dataset of type table that respects the EUROMOD names of the variables.

Data Types: table

The name of a dataset as configured in EUROMOD.

Data Types: string scalar

Nave-Value Input Arguments

collapse all

Name-Value string array with Addons to be integrated in the spine. Name is the name of the addon and Value is the name of the system in the Addon.

Example: addons=["MTR","MTR","LMA","LMA_AT"]

A cell array defining the constants to overwrite in the simulation. Define the constants as Name-Values string arguments, where the Name is a string array with the name and the order of the constant, and the Value is the new constant value. If the order is NaN pass an emtpy string. Default is [].

Example: constantsToOverwrite={["$tinna_rate2",""],"0.4"}

If true, the monetary variables will be converted to euro for the simulation. Default is false.

Example: euro=true

If true, the warning messages resulting from the simulations will be suppressed. Default is false.

Example: nowarnings=true

The path to the output directory. When the output path is provided, there will be an output file generated. Default is "".

Example: outputpath="C:\EUROMOD_RELEASE\Output"

If true, the the model will be on with only the public compoments. Default is false.

Example: public_compoments_only=true

Name-Value string array with extensions to be switched on or off. The Name is the short name of the extension and the Value is a logical. Default is [].

Example: switches=["MWA","false"]

If true then information on the output will be printed. Default is true.

Example: verbose=false

Output Arguments

collapse all

Simulation class with simulation results and configuration settings.

References

[1] Documentation EUROMOD - Tax-benefit microsimulation model for the European Union.

Extended Capabilities

Introduced in R2023a