Skip to content

Commit

Permalink
updated index of all metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
masterismail committed Jul 15, 2024
1 parent 1e764c7 commit 6525f1b
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 0 deletions.
53 changes: 53 additions & 0 deletions docs/EconomicImpact/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# EconomicImpact Class

## Overview

The `EconomicImpact` class is designed to evaluate the economic impact of a given reform on a specified country. It provides methods to calculate various economic metrics, such as inequality and income distribution, before and after the reform.

## Class Initialization

### `EconomicImpact(reform, country)`

Initializes the `EconomicImpact` class with a specified reform and country.

**Parameters:**
- `reform` (dict): A dictionary defining the economic reform. The structure of the dictionary should match the expected format for the `Reform` class.
- `country` (str): The country for which the reform's impact is to be evaluated. Supported values are `"uk"` and `"us"`.

**Example:**
```python
from policyengine import EconomicImpact

impact = EconomicImpact(
reform={"gov.hmrc.income_tax.rates.uk[0].rate": {"2024-01-01": 0.25}},
country="uk"
)
```


## Example Usage

```python
from policyengine import EconomicImpact

# Initialize the EconomicImpact class
impact = EconomicImpact(
reform={"gov.hmrc.income_tax.rates.uk[0].rate": {"2024-01-01": 0.25}},
country="uk"
)

# Calculate the Gini coefficient
result_gini = impact.calculate("inequality/gini")
print(result_gini)
# Output: {'baseline': 0.4288962129322326, 'reform': 0.42720356179075414, 'change': -0.001692651141478485}

# Calculate the top 1% income share
result_top_1 = impact.calculate("inequality/top_1_pct_share")
print(result_top_1)
# Output: {'baseline': 0.09121853588608866, 'reform': 0.09301056461517446, 'change': 0.0017920287290857928}

# Calculate the top 10% income share
result_top_10 = impact.calculate("inequality/top_10_pct_share")
print(result_top_10)
# Output: {'baseline': 0.3101681771998754, 'reform': 0.31214840219992496, 'change': 0.0019802250000495736}
```
32 changes: 32 additions & 0 deletions docs/Poverty/deep/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Deep poverty

## Overview

Deep poverty metrics focus on measuring severe economic hardship, typically defined as living below 50% of the poverty line. These metrics provide critical information about the most economically vulnerable segments of the population.

## Available Metrics

Our deep poverty analysis includes the following categories:

1. **Deep Poverty by Age Group**
- Child Deep Poverty
- Adult Deep Poverty
- Senior Deep Poverty
- Overall Deep Poverty

2. **Deep Poverty by Gender**
- Male Deep Poverty
- Female Deep Poverty
- Overall Deep Poverty

## Significance

Deep poverty metrics are crucial for:
- Identifying the most economically vulnerable populations
- Assessing the severity of poverty beyond standard poverty measures
- Evaluating the impact of policies on extreme poverty
- Guiding targeted interventions for those in severe economic distress

## Usage

These metrics can be accessed using the `EconomicImpact` class. For detailed information on each metric, please refer to the respective documentation pages.
1 change: 1 addition & 0 deletions docs/Poverty/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Poverty impact
31 changes: 31 additions & 0 deletions docs/contributing/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# How to contribute

Any and all contributions are welcome to this project. You can help by:

* Filing issues. Tell us about bugs you've found, or features you'd like to see.
* Fixing issues. File a pull request to fix an issue you or someone else has filed.

If you file an issue or a pull request, one of the maintainers (primarily [@nikhilwoodruff](https://github.com/nikhilwoodruff)) will respond to it within at least a week. If you don't hear back, feel free to ping us on the issue or pull request.

## Changelog Entries

Before you send out a pull request, make sure to add a description of your changes to [changelog_entry.yaml](../../changelog_entry.yaml).
For example,
```yaml
- bump: patch
changes:
fixed:
- Fixed a bug causing Windows tests to fail.
```
You can find more examples in [changelog.yaml](../../changelog.yaml). Note that you do not need to add the date field.
That field is automatically populated by `make changelog`. Also, note that **you should not run `make changelog`
yourself**, as [our GitHub workflows](../../.github/workflows) will do this for you as part of the build process.

## Pull requests

Each pull request should:
* Close an issue. If there isn't an issue that the pull request completely addresses, please file one.
* Have a description that makes sense to a layperson. If you're fixing a bug, describe what the bug is and how you fixed it. If you're adding a feature, describe what the feature is and why you added it.
* Have tests. If you're fixing a bug, write a test that fails without your fix and passes with it. If you're adding a feature, write tests that cover the feature. Sometimes this isn't necessary (for example, documentation changes), but if in doubt, err on the side of including tests.
* Pass all GitHub actions. If you're not sure why a GitHub action is failing, feel free to ask for help in the issue or pull request.

12 changes: 12 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Introduction

The PolicyEngine Python package serves as a unified framework for conducting comprehensive policy simulations and analyses across different countries. Building on the foundation of [OpenFisca-Core](https://github.com/openfisca/openfisca-core), PolicyEngine provides a consistent API that supports diverse functionalities such as microsimulations, individual household analyses, and cross-country comparisons.

PolicyEngine Core enables users to:

* Simulate and analyze various tax-benefit policies with tailored models for each country.
* Use two main simulation classes—Microsimulation for broad-scale microdata simulations and IndividualSim for detailed single household calculations.
* Generate interactive and visually appealing charts using Plotly, facilitating budgetary breakdowns, income decile analyses, poverty breakdowns by demographic groups, and impacts on income inequality.
* Reproduce visualizations from the PolicyEngine web interface programmatically, allowing for in-depth analysis and customization.

The package aims to streamline policy evaluation by offering a user-friendly API, comprehensive documentation, and tools for generating insightful visual representations of simulation results.

0 comments on commit 6525f1b

Please sign in to comment.