ReformSimulation
A class used to build and simulate reform data.
This class inherits from EmpiricalSimulator and provides methods to build and simulate reform data. It includes methods to build simulation data, simulate reforms, and iterate over multiple reform simulations.
Attributes:
Name | Type | Description |
---|---|---|
log_filename |
PathLike
|
The path to the log file for the simulation. Default is a path in the logs directory. |
Source code in bozio_wasmer_simulations/simulation/empirical/base.py
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 |
|
build
build(scenarios: dict, year: int, taux_bascule_vm: Optional[Union[float, None]] = None, data: Optional[Union[DataFrame, None]] = None, path: Optional[Union[PathLike, None]] = None) -> DataFrame
Builds the reform simulation data.
Calls build_data_simulation and iterate_reform_simulations to build the simulation data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scenarios |
dict
|
The scenarios to simulate. Each scenario is a dictionary of reform parameters. |
required |
year |
int
|
The year for the simulation. |
required |
taux_bascule_vm |
float
|
The rate of the value-added tax (VM) switch. If provided, new variables are calculated for the VM switch. |
None
|
data |
DataFrame
|
The data to use for building the simulation data. If None, the data is read from the path. |
None
|
path |
PathLike
|
The path to the data file. Used if data is None. |
None
|
Returns:
Type | Description |
---|---|
DataFrame
|
The simulation data. |
Source code in bozio_wasmer_simulations/simulation/empirical/base.py
build_data_simulation
build_data_simulation(data: Optional[Union[DataFrame, None]] = None, path: Optional[Union[PathLike, None]] = None) -> None
Builds the simulation data.
If data is provided, it uses _build_data_simulation_from_dataframe to build the simulation data. If not, it reads the data from the provided path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
The data to use for building the simulation data. If None, the data is read from the path. |
None
|
path |
PathLike
|
The path to the data file. Used if data is None. |
None
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in bozio_wasmer_simulations/simulation/empirical/base.py
iterate_reform_simulations
iterate_reform_simulations(scenarios: dict, year: int, taux_bascule_vm: Optional[Union[float, None]] = None) -> None
Iterates over multiple reform simulations.
Simulates each reform in the provided scenarios. The results are added to the simulation data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scenarios |
dict
|
The scenarios to simulate. Each scenario is a dictionary of reform parameters. |
required |
year |
int
|
The year for the simulation. |
required |
taux_bascule_vm |
float
|
The rate of the value-added tax (VM) switch. If provided, new variables are calculated for the VM switch. |
None
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in bozio_wasmer_simulations/simulation/empirical/base.py
iterate_simulation
iterate_simulation(data: DataFrame, tax_benefit_system: TaxBenefitSystem, year: int, list_var_simul: List[str], list_var_exclude: Optional[List[str]] = [], inplace: Optional[bool] = True) -> DataFrame
Iterates a simulation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
The data to simulate. |
required |
tax_benefit_system |
FranceTaxBenefitSystem
|
The tax benefit system. |
required |
year |
int
|
The year of the simulation. |
required |
list_var_simul |
List[str]
|
The list of variables to simulate. |
required |
list_var_exclude |
Optional[List[str]]
|
The list of variables to exclude. Defaults to []. |
[]
|
inplace |
Optional[bool]
|
Whether to perform the simulation in place. Defaults to True. |
True
|
Returns:
Type | Description |
---|---|
DataFrame
|
The simulated data. |
Source code in bozio_wasmer_simulations/simulation/empirical/base.py
simulate_reform
simulate_reform(name: str, reform_params: dict, year: int, taux_bascule_vm: Optional[Union[float, None]] = None) -> None
Simulates a reform.
Applies the reform to the simulation data and calculates new variables. The new variables are added to the simulation data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the reform. |
required |
reform_params |
dict
|
The parameters of the reform. |
required |
year |
int
|
The year for the simulation. |
required |
taux_bascule_vm |
float
|
The rate of the "versement mobilité" (VM) switch. If provided, new variables are calculated for the VM switch. |
None
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in bozio_wasmer_simulations/simulation/empirical/base.py
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 |
|
simulate_smic_proratise
simulate_smic_proratise(data: DataFrame, year: int, list_var_exclude: Optional[List[str]] = [], inplace: Optional[bool] = True) -> DataFrame
Simulates the prorated minimum wage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
The data to simulate. |
required |
year |
int
|
The year of the simulation. |
required |
list_var_exclude |
Optional[List[str]]
|
The list of variables to exclude. Defaults to []. |
[]
|
inplace |
Optional[bool]
|
Whether to perform the simulation in place. Defaults to True. |
True
|
Returns:
Type | Description |
---|---|
DataFrame
|
The simulated data. |