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

Release v1.6.0 #304

Closed
wants to merge 275 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
275 commits
Select commit Hold shift + click to select a range
2638238
cast import factors as Matrix
bl-young Aug 29, 2023
2444783
update documentation
bl-young Aug 29, 2023
f323c0a
added rmd file to test several formulations of L_m
Aug 29, 2023
23648aa
move imports model build into separate function to preserve core mode…
bl-young Aug 30, 2023
f9fdffb
update M matrix used for validation in calculation in calculateAndVal…
Aug 30, 2023
71ed2f7
UPdate IMportFactorsTest.rmd with diag calculations for approach 2
Aug 30, 2023
0e2b8ed
align M_m with standard M, add rows for flows that don't exist in M_m
bl-young Aug 30, 2023
f38436f
added approach 4 for testing L_m
Aug 30, 2023
4ee262b
Merge branch 'linkstateiorImportF' of https://github.com/USEPA/useeio…
Aug 30, 2023
9483c4c
edits to fix read.table error for import factors csv file
Sep 6, 2023
2569192
remove outdated comment
Sep 6, 2023
7cfee09
Re-arrange calculateEEIOModel function into several subfunctions
Sep 6, 2023
5932d19
assign expanded M_m back to model objecy
Sep 6, 2023
5dc6563
remove old comments
Sep 7, 2023
1fad7dd
added calculateResultsWithExternalFactors function
Sep 7, 2023
df5522f
added model$M_d to models with import factors for validation purposes
Sep 7, 2023
efe9cb7
Cleaning up comments
Sep 7, 2023
d9c7737
calculate U_n_m earlier in the code for clarity
Sep 7, 2023
59b3bbb
cleaning up comments in calculationfunctions
Sep 7, 2023
cad065d
update documentation files
bl-young Sep 7, 2023
5195143
add model with import factors to testing
bl-young Sep 7, 2023
8e2b74f
added additional validation option for y_d and y_m in IMportFactorsTe…
Sep 7, 2023
426978b
Merge branch 'linkstateiorImportF' of https://github.com/USEPA/useeio…
Sep 7, 2023
38212d8
Include additional validations in ImportFactorsTests.rmd
Sep 11, 2023
a58a05f
add alternate validation accounting for supply chain of imports
bl-young Sep 12, 2023
8bee3db
move up calculation of Rho, Phi, and Tau to have access earlier
bl-young Sep 13, 2023
dc63fd2
Convert factors from basic to producer price
bl-young Sep 13, 2023
b2d4a0b
multiply factors by Tau as $ is in denominator
bl-young Sep 13, 2023
a153a14
update import multipliers file with updated weighting
bl-young Sep 15, 2023
efcf664
update multipliers, drop 0 values, some columns reordered
bl-young Sep 15, 2023
ba55116
specify year in import factors file, update to 2019 model year and GH…
bl-young Sep 19, 2023
3781a58
Add USEEIOv2.0-s-GHG_Std.yml model file to match the changes made to …
Sep 19, 2023
83dbb1b
Changed USEEIOv2.0-s-GHG_Std.yml to USEEIOv2.0-s-GHG-19
Sep 19, 2023
fd466e7
Merge pull request #264 from USEPA/262-domestic-result-calculation-us…
WesIngwersen Sep 21, 2023
78baa4e
apply same fix for #262 to new calc functions
WesIngwersen Sep 21, 2023
4a83721
delete scratch file now in private repo
bl-young Sep 21, 2023
ef6dd5b
Merge branch 'release-v1.4.0' into linkstateiorImportF
bl-young Sep 21, 2023
222fb8c
added comment to check for how importfinaldemand is calculated, might…
Oct 27, 2023
79f880e
move calculate and validateImportA from IOfunctions.R to ValidateMOde…
Oct 31, 2023
bfd845f
Added temporary comment in IOFunctions.R
Oct 31, 2023
696af76
Removed imports from the calculation of y_m in the prepareIMportedPro…
Oct 31, 2023
c9690bc
Removed imports from y_m_p returned by prepareIMportedProductionDeman…
Oct 31, 2023
0988586
Modified caculateAndValidateImportA so it could be called outside of …
Oct 31, 2023
efd0dd4
Modified
Oct 31, 2023
83efd3f
In buildModelwithImportFactors function,
Nov 10, 2023
e98ac12
add temporary ImportMatrix object to model object
Nov 11, 2023
407f08e
update GHG parquets, add state model spec
bl-young Nov 15, 2023
1af3d6d
cleanup
bl-young Nov 15, 2023
18e0638
initial updates for import factors for two-region models
bl-young Nov 15, 2023
c94214a
Added loadImportMatrix function to add the ImportMatrix to the model …
Nov 15, 2023
4d5a7fa
fix model name in action
bl-young Nov 16, 2023
ad90e65
fix label in action
bl-young Nov 16, 2023
634b1b3
cleanup and update documentation
bl-young Nov 16, 2023
2dfda81
pass import table instead of attaching to model
bl-young Nov 16, 2023
7d859a3
update definition of import final demand
Nov 16, 2023
dd6ac8f
update prepreIMportedProductionDemand function to match changes to mo…
Nov 16, 2023
c5ce5b3
remove commented code
Nov 16, 2023
612f925
add validateImportFactorsApproach function
Nov 16, 2023
38ed94b
remove calculateAndValidateImportA function
Nov 16, 2023
65e1a24
drop model$M from import factors model as it is not representative of…
bl-young Nov 17, 2023
5e80350
use `prepareImportedProductionDemand()` function in validation for co…
bl-young Nov 17, 2023
42862b9
create N for both model types
bl-young Nov 17, 2023
041d4cf
cleanup
bl-young Nov 17, 2023
14f11ff
drop getFinalDemandCodes, not a useeior function
bl-young Nov 17, 2023
147a606
validate model in action
bl-young Nov 17, 2023
740c0af
add logging message
bl-young Nov 17, 2023
a720261
update documentation
bl-young Nov 17, 2023
7dfdeaa
Add prepareImportConsumptionDemand function
Nov 17, 2023
f723333
add consumption demand vector option for import factors
Nov 17, 2023
541ff85
For models with external import factors,
Nov 17, 2023
f9243d3
In calculateResultsWithExternalFactors function, added warning regard…
Nov 17, 2023
2c72492
Change validateImportFactorsApproach function to use Consumption fina…
Nov 17, 2023
9010008
Add LCIA calculation to models with external import factors
Nov 17, 2023
c8ca169
Add validation of LCIA results for models with external import factors
Nov 17, 2023
ba3f7eb
start of code for adding import demand vectors during loadDemandVecto…
Nov 20, 2023
625e6d1
rename `prepareImportedProductionDemand()` -> `prepareImportProductio…
bl-young Nov 20, 2023
e85f7de
fix missing docs
bl-young Nov 20, 2023
442dbea
fix documentation
bl-young Nov 20, 2023
59ab764
new helper function to prepare demand vector for imports
bl-young Nov 20, 2023
d472dcd
Merge branch 'linkstateiorImportF' of https://github.com/USEPA/useeio…
Nov 20, 2023
9ccbfb2
Edit descriptive comments in buildModelwithImportFactors function
Nov 24, 2023
e6c8c55
Add comment to model$N_m calculation (line 140 in constructEEIOMatrices)
Nov 24, 2023
dd0a954
search through directory for all configpaths for external files, dupl…
bl-young Dec 2, 2023
5fdcb69
pass configpaths through to LoadExternalImportFactors to enable exter…
bl-young Dec 2, 2023
74118a1
drop extdata from importfactors spec
bl-young Dec 2, 2023
6bee512
return only domestic portion of result for import calculations with p…
bl-young Dec 4, 2023
d7474cb
allow import factors to be souced from data commons
bl-young Dec 20, 2023
5ea9ed2
update model name for 2region w/ import factors
bl-young Jan 4, 2024
7f07377
move calculation of `ImportFinalDemand` to DemandFunctions
bl-young Jan 4, 2024
29bc93a
pass location for two region models for demand vector
bl-young Jan 4, 2024
ff99b62
adjust stop error message for clarity
bl-young Jan 4, 2024
f7a5e73
pass location to demand vector calc
bl-young Jan 4, 2024
2a4bd55
turn on existing demand calcs for 2r models
bl-young Jan 4, 2024
d89737d
run validation for 2r models; pass location
bl-young Jan 4, 2024
2706f29
Change nomenclature in model from M_m to Q_t to align with nomenclatu…
Jan 4, 2024
0feb975
Update comment in validateImportFactorsApproch
Jan 5, 2024
57a6e68
add households to CbS based on final demand totals; cast those coeffi…
bl-young Jan 6, 2024
4a54d6b
add row to results matrix for households when `household_emissions = …
bl-young Jan 6, 2024
5be39df
assign household demand codes dynamically for result calc
bl-young Jan 8, 2024
d6cc8f2
pass location to calculateStandardResults to allow selecting househol…
bl-young Jan 8, 2024
83c9456
select region for two-region models
bl-young Jan 8, 2024
4f47133
reorder B_h to match demand cols
bl-young Jan 8, 2024
7fd9b0e
add households to color schema
bl-young Jan 8, 2024
df8b9d3
Merge branch 'release-v1.4.0' into household_efs
bl-young Jan 8, 2024
5197e0b
update documentation
bl-young Jan 8, 2024
37d0313
Merge branch 'release-v1.4.0' into linkstateiorImportF
bl-young Jan 8, 2024
6304486
add household emissions to calculation with import factors
bl-young Jan 8, 2024
7c2ed04
Merge branch 'linkstateiorImportF' into imports_2region
bl-young Jan 12, 2024
b6e0335
Remove model$N_m object from model. To calculate this properly I beli…
Jan 12, 2024
d4efeb4
Merge branch 'linkstateiorImportF' of https://github.com/USEPA/useeio…
Jan 12, 2024
d7e6d01
test demand vector for import consumption in 2r model
bl-young Jan 12, 2024
2465247
Add model objects specific to the coupled model approach to format sp…
Jan 12, 2024
7d03f35
added 2r GA model without import factors for testing purposes
Jan 12, 2024
910aaf5
removed ImportFinalDemand from format specs as this will be removed o…
Jan 12, 2024
7c9cd32
removed reference to model$FinalDemand so that prepare2RDemand can be…
Jan 12, 2024
c7fef1a
fix variable name to match return statement
Jan 12, 2024
a9ba2ea
temporary code for testing validation of 2R models with IF for produc…
Jan 13, 2024
7f8fd5b
add model objects M and N back to model specs
jvendries Jan 13, 2024
29e67d2
Merge pull request #271 from USEPA/imports_2region
bl-young Jan 15, 2024
874a828
Merge branch 'linkstateiorImportF' into household_efs
bl-young Jan 15, 2024
26be867
Merge pull request #270 from USEPA/household_efs
bl-young Jan 15, 2024
38dc174
limit region for householde emissions for 2r model; fix result name a…
bl-young Jan 15, 2024
807b879
Add stop conditions for calculating/validation 2R models for producti…
Jan 18, 2024
1f94022
Add perspective as a paramter to the calculateResultsWithExternalFact…
Jan 24, 2024
9c3776a
Added direct perspective calculation for IF models based on the follo…
Jan 24, 2024
bfa259c
add household emisssions to direct perspective calculation for IF models
Jan 24, 2024
ad947c4
Changed demand term in the implementation of direct perspective resul…
Jan 24, 2024
5ab2548
Adjust direct perspective calculation based on suggestion in this com…
Jan 27, 2024
f1b1362
use industries from model to avoid errors for disaggregated models
bl-young Feb 7, 2024
5eea7a4
increase tolerance for disaggregated state models
bl-young Feb 7, 2024
63ab800
add sample disaggregated 2r model spec
bl-young Feb 7, 2024
3f7ba02
update docs
bl-young Feb 7, 2024
1479582
add two region disaggregated model to testing
bl-young Feb 7, 2024
7a5ee53
update PrintValidationResults to print validation results for compare…
Feb 16, 2024
9e06bda
Add alternate direct perspective calculation as comments
Feb 16, 2024
eeef9df
turn back on colors for Used and Other
bl-young Feb 26, 2024
2b75069
update docs
bl-young Feb 26, 2024
9d8f094
fix error in unnamed lcia results for households
bl-young Feb 26, 2024
62147b6
fix typos in action
bl-young Feb 29, 2024
825546f
Merge branch 'linkstateiorImportF' into 2r_disagg
bl-young Feb 29, 2024
480278e
fix typo
bl-young Feb 29, 2024
9ddcf25
v0.3.0 stateio tables not yet available on data commons so action won…
bl-young Feb 29, 2024
eb6c433
Merge branch 'linkstateiorImportF' of https://github.com/USEPA/useeio…
Feb 29, 2024
00e9142
Call print2RValidationResults from printValidationResults rather than…
Feb 29, 2024
1703d2e
consolidate validation steps
bl-young Feb 29, 2024
4b8f119
move disaggregation specs from stateior to useeior
bl-young Feb 29, 2024
208c008
Merge pull request #277 from USEPA/2r_disagg
bl-young Feb 29, 2024
b1c36ed
rename import factors module
bl-young Feb 29, 2024
132fcff
move buildModelwithImportFactors()
bl-young Feb 29, 2024
1be6202
Merge branch 'linkstateiorImportF' of https://github.com/USEPA/useeio…
Mar 4, 2024
582e210
fix error in grabbing index leading to warning message
bl-young Mar 8, 2024
a3f2256
allow built in demands for import results
bl-young Mar 8, 2024
d7ebfc0
characterize CO2e flows resolves #281
bl-young Mar 12, 2024
c5e2752
adjust calculation of $B_h$ to be based on total consumption instead …
bl-young Mar 14, 2024
4f4ab3a
fix error in assigning household codes for different model types
bl-young Mar 14, 2024
a08c2b1
fix error in two region models for household emissions
bl-young Mar 14, 2024
3e0b8b3
add function to validateHouseholdEmissions
bl-young Mar 14, 2024
8baf735
avoid errors for models with no household emissions in any satellite …
bl-young Mar 14, 2024
5712510
fix error in bool
bl-young Mar 15, 2024
07fa0e1
Merge branch 'develop' into linkstateiorImportF
bl-young Apr 8, 2024
ebf7c34
move new summary models w/ import factors to tests; consolidate model…
bl-young Apr 8, 2024
19666e2
simplify reading of import factors
bl-young Apr 8, 2024
48da7f2
Supply tables only available with 2017 schema
bl-young Apr 8, 2024
e23856e
incorporate utility disaggregation into two region model testing
bl-young Apr 8, 2024
0ae8af0
Merge branch 'develop' into linkstateiorImportF
bl-young Apr 8, 2024
b51a684
revert 48da7f2b following #286
bl-young Apr 8, 2024
4dd238b
fix error for when `ExternalImportFactors` is FALSE
bl-young Apr 8, 2024
fe67753
move testing import multipliers file to within tests folder
bl-young Apr 8, 2024
bc7770e
:construction: summary disaggregation can still cause errors, set yea…
bl-young Apr 8, 2024
1cd0d77
use file in tests, align with fe67753
bl-young Apr 8, 2024
f9c761f
:construction: stateio disaggregation files not yet available, turn o…
bl-young Apr 8, 2024
0c4b402
add createDisaggFilesFromProxyData function to useeior
Apr 25, 2024
4457453
add model build tests for 2R model with "standard" utilities disaggre…
Apr 25, 2024
1cec7e0
add utilitydisaggbyproxy yml file
Apr 25, 2024
5a7109f
add GAEEIO yml files for 2R utility disagg (standard and by proxy)
Apr 25, 2024
56c09c9
add employment ratios csv file required for disaggbyproxy
Apr 25, 2024
205e7eb
remove temporary variaables
Apr 26, 2024
3552852
Add code to format disaggSpecs object for disaggregating 2R models th…
Apr 26, 2024
57e4330
consolidate EmissionYear and CurrencyYear in import factors, only use…
bl-young May 1, 2024
dd9da17
split out `loadExternalImportFactors` into more functions for easier …
bl-young May 2, 2024
c98a995
pull two-region disaggregation files to move to new branch
bl-young May 7, 2024
569e787
update documentation files
bl-young May 7, 2024
05cb080
update structure and rename the test import factors file
bl-young May 7, 2024
345dedc
fix documentation
bl-young May 7, 2024
3f18d04
fix error in handling of #281 which can cause other flows to be assig…
bl-young May 9, 2024
835f36e
remove unneeded comments
May 10, 2024
9f96eab
Add "not yet implemented" warning for 2R region models with utilities…
May 14, 2024
8766a25
changed warning to stop for 2R models with utilities disagg
May 15, 2024
a77a3f2
add missing print statement in IF validation
May 15, 2024
2e3eb24
add stop for createDisaggFilesFromProxyData function as this is for 2…
May 15, 2024
9a4cde0
remove margins tables for two region models #290
bl-young May 16, 2024
210b1cf
change model spec from 3.0 to 2.2
bl-young May 16, 2024
dde2d8f
can't construct Phi if no margins, #290
bl-young May 16, 2024
41bd541
include writing model to excel in some tests
bl-young May 16, 2024
d2e3c85
cleanup spacing and line length
bl-young May 16, 2024
eee9807
Merge pull request #288 from USEPA/linkstateiorImportF
bl-young May 16, 2024
3a255cd
skip writing flows for economic models, #291
bl-young May 17, 2024
9fdce17
skip some validations for economic only models; add economic models t…
bl-young May 17, 2024
98b848b
rename `buildEIOModel` to `buildIOModel` and export; incorporate adju…
bl-young May 17, 2024
9eeb772
Merge branch 'issue_291' into develop
bl-young May 17, 2024
9942859
consolidate common code for economic and price adjustment matrices to…
bl-young May 17, 2024
f6999b7
tighten tolerance for flow loss and change to warning
bl-young May 29, 2024
f2b63b5
create allocation factors based on NAICS and location, resolves #296
bl-young May 29, 2024
efe1235
update documentation
bl-young May 29, 2024
3b2f8a0
Merge pull request #297 from USEPA/issue_296
bl-young May 29, 2024
2b5ad5b
add household emissions value for 2nd region if applicable
bl-young Jun 6, 2024
429ebfb
move household emission calculations to a new function `CalculateHous…
bl-young Jun 6, 2024
d188633
Remove export residual from 2R consumption vector
Jun 13, 2024
57a3362
fix typo in comment
Jun 14, 2024
e740d88
fix error in assigning factors to CO2e flows #281
bl-young Jun 14, 2024
4961d7f
Merge branch 'master' into develop
bl-young Jun 14, 2024
94c5db2
Add 2R models with and without export residuals in consumption vector
Jun 14, 2024
50fa6e0
Add .rmd script testing impacts of commit d1886338
Jun 14, 2024
5e7102d
rename script to issue_298
Jun 17, 2024
654b8c6
delete issue 298 script and model objects (moved to USEEIO_team)
Jun 17, 2024
cb17b9c
removed unnecessary comments
Jun 17, 2024
544f091
Merge pull request #300 from USEPA/issue_298
WesIngwersen Jun 17, 2024
79d1db2
add agg_metasources parameter to enable access to TbS while maintaini…
bl-young Jun 19, 2024
f0395a3
fix typo
bl-young Jun 23, 2024
965b7c8
calculate import calculations as separate vectors; use direct perspec…
bl-young Jul 8, 2024
c575d97
update direct calculation of term 2 to diagonalize A_m * L_d * y_d pr…
bl-young Jul 9, 2024
b3c71bd
transpose all results
bl-young Jul 9, 2024
1af22c7
update test model to latest published GHG FBS
bl-young Jul 27, 2024
02fb069
Fix capitalization
bl-young Jul 30, 2024
8f85ada
Merge pull request #301 from USEPA/import_calcs
bl-young Aug 1, 2024
e1076d9
replace `Q_t` with `M_m`, #303
bl-young Aug 1, 2024
2181b12
add `M_m` and `N_m` for writing to Excel
bl-young Aug 1, 2024
556ec51
add USEEIOv2.3 model specs
bl-young Aug 1, 2024
f7cdf83
add `N_m` to model build
bl-young Aug 1, 2024
6e54eed
rearrange testing to fix error
bl-young Aug 1, 2024
2083c70
fix typo
bl-young Aug 1, 2024
89fd49e
update pointer for testing two-region import factors
bl-young Aug 1, 2024
798f003
new function `castImportFactors` based on `standardizeandcastSatellit…
bl-young Aug 1, 2024
c01833c
fix typo
bl-young Aug 1, 2024
21bd483
Merge branch 'master' into develop
bl-young Aug 2, 2024
d24d37c
:bookmark: bump to v1.6.0
bl-young Aug 2, 2024
f6bf6f9
Add L_m to model.md and tweak other *_m matrix descriptions
WesIngwersen Aug 2, 2024
7cd8023
add `A_m` for writing to excel
bl-young Aug 2, 2024
0ead446
Replace L_m with A_m in Model.md; add ImportMatrix
WesIngwersen Aug 2, 2024
bc57e30
Merge branch 'release_v1.6.0' of https://github.com/USEPA/useeior int…
WesIngwersen Aug 2, 2024
e3af31b
fix data year in model spec metadata for GHG data for new v2.3 models
WesIngwersen Aug 2, 2024
6fc92a8
do not export calculateStandardResults
WesIngwersen Aug 6, 2024
e192218
Do not export compare2RVectorTotals()
WesIngwersen Aug 6, 2024
a7ae434
Remove export of compareCommodityOutputXMarketShareandIndustryOutputw…
WesIngwersen Aug 6, 2024
e92d242
do not export aggregateResultMatrixbyRow()
WesIngwersen Aug 6, 2024
ee7f08d
do not export calculateHouseholdEmissions
WesIngwersen Aug 6, 2024
97a5e5e
Do not export calculateResultsWithExternalFactors()
WesIngwersen Aug 6, 2024
62850be
Update date for release, drop ML from authors
WesIngwersen Aug 6, 2024
876817a
update roxygen produced docs
WesIngwersen Aug 6, 2024
a8db500
Temporarily remove from public api these functions which will not wor…
WesIngwersen Aug 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added model$M_d to models with import factors for validation purposes
jvendries committed Sep 7, 2023
commit df5522fe3ba8da4148be6a575758a05e63408b23
3 changes: 2 additions & 1 deletion R/IOFunctions.R
Original file line number Diff line number Diff line change
@@ -284,6 +284,7 @@ buildModelwithImportFactors <- function(model) {
model$A_m <- model$V_n %*% model$U_d_m
}
model$M <- model$B %*% model$L
model$M_d <- model$B %*% model$L_d # For validation purposes
model$M_m <- loadExternalImportFactors(model)

# Fill in flows for M_m not found in Import Factors but that exist in model and align order
@@ -364,7 +365,7 @@ calculateAndValidateImportA <- function(model, y = NULL, y_d = NULL){
# f^(d+m) = model$B %*% model$L_d %*% y_d + model$M %*% A_m %*% model$L_d %*% y_d + model$M %*% y_m (eq 2)

# "Standard" result calculation is model$B %*% model$L %*% y = model$M %*% y
cat("\n Calculating results using import A (A_m).\n")
cat("\n Calculating results (M matrix) using import A (A_m).\n")
standard_M <- model$M
result_Standard <- standard_M %*% y
M_m <- standard_M #Q^t = M_m = imported M matrix, which for validation purposes is equivalent to the current standard_M