Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currency Conversion and Inflation Adjustment #180

Closed
wants to merge 76 commits into from

Conversation

liniiiiii
Copy link
Collaborator

Upload the table for currency conversion and inflation adjusted to 2024. Ready to review!

@liniiiiii liniiiiii requested a review from i-be-snek October 24, 2024 11:36
@i-be-snek i-be-snek linked an issue Oct 31, 2024 that may be closed by this pull request
6 tasks
@liniiiiii
Copy link
Collaborator Author

Formula to convert currencies
Non USD --> USD, using the table Database/data/Currency_conversion_yearly_averages.xlsx
each sheet contains the yearly mean conversion rate of Non USD/USD
for example, EUR-USD
in the table, the rate of 2024 is 0.92, 10 euro in 2024 is 10/0.92 (10.87) USD
formula

Y =X/rate
where Y is the USD, X is the original currency, and rate is the yearly mean conversion rate

Formula for inflation adjustment , using this table Database/data/inflation_Index_2024.csv
Example
$100 (2023 USD) in (2024 USD)
Y=100 (100/96.9) =103.2 USD
formula

 Y = X * (100/ X_index)
where Y is the 2024 price, and X is the price in original year, X_index is inflation index in the original year

Formula for USD to EUR (after data gap in USD, and keep it in another db file)
the 2024 USD convert to EUR 2024 using the 2024 yearly mean rate, 0.919601 directly,

Y=X*0.919601
where Y is 2024 EUR and X is 2024 USD

@i-be-snek , could you help to implement this in the database version, for the EUR, we can leave it a bit later, we will use the USD version for visualization, thanks! Any questions pls comment! 👍

@i-be-snek
Copy link
Collaborator

@liniiiiii

I realize now that the data gap cannot be done after the inflation adjustment and currency conversion because l2/l3 records often have the year missing, and with no year, there is no way to convert the currency and adjust for inflation in USD.

So to achieve the goal of this PR, at least the year gap must be filled first.

My understanding is that we want to release 3 databases: raw, inflation adjusted, and data-gap filled (in short). filling are done together. Another reason is that we cannot fill the data gap for monetary categories (like Damage) without first adjusting for inflation.

So I think it may be better that inflation adjustment and the data gap are handled in a single step and we release 2 databases instead. What do you think? The code for this is almost in place, so I would just need to confirm with you here that it's okay to do it in one go.

@liniiiiii
Copy link
Collaborator Author

@liniiiiii

I realize now that the data gap cannot be done after the inflation adjustment and currency conversion because l2/l3 records often have the year missing, and with no year, there is no way to convert the currency and adjust for inflation in USD.

So to achieve the goal of this PR, at least the year gap must be filled first.

My understanding is that we want to release 3 databases: raw, inflation adjusted, and data-gap filled (in short). filling are done together. Another reason is that we cannot fill the data gap for monetary categories (like Damage) without first adjusting for inflation.

So I think it may be better that inflation adjustment and the data gap are handled in a single step and we release 2 databases instead. What do you think? The code for this is almost in place, so I would just need to confirm with you here that it's okay to do it in one go.

@i-be-snek , sorry for my late response, let's split them step by step, so the data gap should cover the damage columns as well, I think we can release the processed database with currency conversion, inflation adjusted, and data gap. Now we have the year gap fixed in the pr #174 (comment), could we use the output from this pr, and process with currency conversion and inflation adjusted, and then, an extra step is to fix the data gap of the damage columns. So we can only release two versions of databases, the raw one, and the processed one, thanks!

@i-be-snek
Copy link
Collaborator

@liniiiiii It wasn't late at all :D I had messaged in the weekend in hopes you would see it today (Monday).

So, what we are now going to do is perform inflation adjustment and currency conversion as part of the data-gap filling, and then in the end we release two databases: one raw, and one 'post-processed', and the post-processed will have all currencies converted to USD and adjusted to 2024 plus all data gaps filled. Is that correct?

@liniiiiii
Copy link
Collaborator Author

@liniiiiii It wasn't late at all :D I had messaged in the weekend in hopes you would see it today (Monday).

So, what we are now going to do is perform inflation adjustment and currency conversion as part of the data-gap filling, and then in the end we release two databases: one raw, and one 'post-processed', and the post-processed will have all currencies converted to USD and adjusted to 2024 plus all data gaps filled. Is that correct?

Yes! Absolutely, that's what we will release!

@i-be-snek
Copy link
Collaborator

Closing to open #191

@i-be-snek i-be-snek closed this Nov 25, 2024
@i-be-snek i-be-snek deleted the currency_inflation branch January 17, 2025 13:34
@i-be-snek i-be-snek restored the currency_inflation branch January 17, 2025 13:34
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.

process full run database (to do branch)
2 participants