Skip to content

Add initial files from Aiden's OG-PHL-based work, renamed to OG-BRA#2

Open
markdebacker wants to merge 3 commits into
PSLmodels:mainfrom
markdebacker:initial_files
Open

Add initial files from Aiden's OG-PHL-based work, renamed to OG-BRA#2
markdebacker wants to merge 3 commits into
PSLmodels:mainfrom
markdebacker:initial_files

Conversation

@markdebacker

Copy link
Copy Markdown

No description provided.

@markdebacker

Copy link
Copy Markdown
Author

I added @Atanceplus BRA files to this PSL repository and made sure to change all the occurrences of PHL, phl, and phillipines to BRA, bra, and Brazil.

- './ogbra/**.py'
jobs:
build-and-deploy:
if: github.repository == 'EAPD-DRB/OG-BRA'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repo should be changed to 'PSLmodels/OG-BRA'

jobs:
deploy:
name: Publish to PyPI
if: github.repository == 'EAPD-DRB/OG-BRA'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repo should be changed to 'PSLmodels/OG-BRA'

(SecDemogFert)=
## Fertility rates

Our data for Brazil fertility rates by age come from United Nations fertility rate data for a country for some range of years (at least one year) and by age. The `country_id=608` is for the Brazil. These data come from the United Nations Data Portal API for UN population data (see https://population.un.org/dataportal/about/dataapi). The UN variable code for Population by 1-year age groups and sex is "47" and that for Fertility rates by age of mother (1-year) is "68".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Brazil, we should have country_id=076

totpers=100,
min_age=0,
max_age=99,
country_id="608",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change country_id to "076"

totpers=100,
min_age=0,
max_age=99,
country_id="608",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change country_id to "076"

mort_rates=None,
infmort_rates=None,
pop_dist=None,
country_id="608",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change country_id to "076"

(Chap_LfEarn)=
# Lifetime Earnings Profiles

Among households in `OG-BRA`, we model variations in the labor productivity over the lifecycle and between households of different skill groups. Together, these variations in productivity generate a distribution of earnings that is calibrated to match the level of inequality in the Brazil. This chapter describes the calibration of the lifecycle earnings profiles and the distribution of earnings in the model.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the Brazil" should be "Brazil"

# Exogenous Parameters


The JSON file [`ogbra_default_parameters.json`](https://github.com/EAPD-DRB/OG-BRA/blob/master/ogbra/ogbra_default_parameters.json) provides values for all the model parameters used as defaults for `OG-BRA`. Below, we provide a table highlighting some of the parameters describing the scale of the model (number of periods, aged, productivity types) and some parameters of the solution method (dampening parameter for TPI). The table below provides a list of the exogenous parameters and their baseline calibration values.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


## Economic Assumptions

As the default rate of labor augmenting technological change, $g_y$, we use a value of 3.6%. The average annual growth rate in GDP per capita in the Brazil between 2000 and 2019 is 3.6% per year.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the Brazil" should be "Brazil"

(SecUBIcalc)=
## Calculating UBI

We calculate the time series of UBI household transfers in model units $ubi_{j,s,t)}$ and the time series of total UBI expenditures in model units $UBI_t$ from five parameters described in the [`ogbra_default_parameters.json`](https://github.com/EAPD-DRB/OG-BRA/blob/master/ogbra/ogbra_default_parameters.json) file (`ubi_growthadj`, `ubi_nom_017`, `ubi_nom_1864`, `ubi_nom_65p`, and `ubi_nom_max`) interfaced with the `OG-BRA` demographic dynamics over lifetime income groups $j$ and ages $s$, and multiplied by household composition matrices from the `Calibrate` class of the `OG-BRA/ogbra/calibrate.py` module in the repository.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the GH org from EAPD-DRB to PSLmodels throughout this file.

```

If you have made it this far, you've successfully made a remote copy (a
fork) of the central `OG-BRA` repo. That remote repo is hosted on GitHub.com at [https://github.com/EAPD-DRB/OG-BRA](https://github.com/EAPD-DRB/OG-BRA). You have also created a local repo (a [clone](https://help.github.com/articles/github-glossary/#clone)) that lives on your machine and only you can see; you will make your changes to

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change GH org from EAPD-DRB to PSLmodels throughout

| Package | [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-31013/) [![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3116/) [![PyPI Latest Release](https://img.shields.io/pypi/v/ogbra.svg)](https://pypi.org/project/ogbra/) [![PyPI Downloads](https://img.shields.io/pypi/dm/ogbra.svg?label=PyPI%20downloads)](https://pypi.org/project/ogbra/) |
| Testing | ![example event parameter](https://github.com/EAPD-DRB/OG-BRA/actions/workflows/build_and_test.yml/badge.svg?branch=main) ![example event parameter](https://github.com/EAPD-DRB/OG-BRA/actions/workflows/deploy_docs.yml/badge.svg?branch=main) ![example event parameter](https://github.com/EAPD-DRB/OG-BRA/actions/workflows/check_format.yml/badge.svg?branch=main) [![Codecov](https://codecov.io/gh/EAPD-DRB/OG-BRA/branch/main/graph/badge.svg)](https://codecov.io/gh/EAPD-DRB/OG-BRA) |

[`OG-BRA`](https://github.com/EAPD-DRB/OG-BRA) is a Python package that provides code and data to calibrate an overlapping-generations (OG) model to the economy of the Brazil (BRA), the code of which is hosted on GitHub at https://github.com/EAPD-DRB/OG-BRA. `OG-BRA` uses as a dependency the [`OG-Core`](https://pslmodels.github.io/OG-Core/) package, which contains the core theory and logic of a general OG model. The `OG-BRA` calibration package and the `OG-Core` theory and logic make the model that allows for dynamic general equilibrium analysis of federal fiscal policy in the Republic of the Brazil. The model output focuses on changes in macroeconomic aggregates (GDP, investment, consumption), wages, interest rates, and the stream of tax revenues over time. This documentation of the `OG-BRA` package contains the following major sections, which are regularly updated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two instances of "the Brazil" to be changed to "Brazil"

(Sec_Disclaimer)=
## Disclaimer

The model is continuously under development. Users will be notified through [closed PR threads](https://github.com/EAPD-DRB/OG-BRA/pulls?q=is%3Apr+is%3Aclosed) and through the [release notes](https://github.com/EAPD-DRB/OG-BRA/releases) what changes have been implemented. The package will have released versions, which will be checked against existing code prior to release. Stay tuned for an upcoming release!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change EAPD-DRB to PSLmodels

(Sec_CitingOGBRA)=
## Citing OG-BRA

`OG-BRA` (Version #.#.#)[Source code], https://github.com/EAPD-DRB/OG-BRA

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change EAPD-DRB to PSLmodels

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's delete everything from the UNtutorial chapter and reference to it in other places such at toc.yml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change file name to OGBRA_references.md

Comment thread docs/book/_config.yml
# Book settings
title : OG-BRA
author : Marcelo LaFleur, Richard W. Evans, and Jason DeBacker
copyright : '2024'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

Comment thread docs/book/_config.yml
####################################################
# Information about where the book exists on the web
repository:
url: https://github.com/EAPD-DRB/OG-BRA

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change EAPD-DRB to PSLmodels

Comment thread docs/book/_toc.yml
- file: content/calibration/UBI
- file: content/calibration/matching_lwi
- file: content/calibration/exogenous_parameters
- caption: UN Tutorial

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete lines 22-25

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change file name to OGBRA_references.bib



CUR_DIR = os.path.dirname(os.path.realpath(__file__))
UN_COUNTRY_CODE = "608"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Country code should be changed to "076"

Comment thread docs/OG-PHL_logo.png

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just rename this to OG-BRA_logo.png, but open an issue to update the logo files.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just rename this to OG-BRA_logo_gitfig.png, but open an issue to update the logo files.

Comment thread docs/OG-PHL_logo_long.png

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above -- just rename and issue will mention updating this logo.

Comment thread ogbra/constants.py
}

CBO_UNITS = {
"Y": r"Billions of ₱",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can change from the Philippine peso to the Brazilian real. Replace "₱" with R$".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's replace PHL with BRA in file name, but open issue to note SAM file needs updating. Possible source: https://www.ifpri.org/country/brazil/#country-datasets

Comment thread ogbra/MANIFEST.in
@@ -0,0 +1,2 @@
include ogbra/ogbra_default_parameters.json
include ogbra/data/002_IFPRI_SAM_IDN_2018_SAM.csv

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace name of csv file with the name of the SAM file above (referenced in input_output.py).

Comment thread setup.py
long_description_content_type="text/markdown",
long_description=longdesc,
keywords="BRA Brazil calibration of large scale overlapping generations model of fiscal policy",
url="https://github.com/EAPD-DRB/OG-BRA/",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change EAPD-DRB to PSLmodels throughout this file.

@jdebacker jdebacker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markdebacker I've reviewed this and left comments for the changes I'd like to see before this PR is ready to merge.

We'll note that there is still more substantive work to do after this PR, but addressing the comments will help lay a good foundation for that later work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants