Skip to content

Commit

Permalink
move up calculation of Rho, Phi, and Tau to have access earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-young committed Sep 13, 2023
1 parent a58a05f commit 8bee3db
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions R/BuildModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@ constructEEIOMatrices <- function(model) {
model$D <- model$C %*% model$B
}

# Calculate year over model IO year price ratio
logging::loginfo("Calculating Rho matrix (price year ratio)...")
model$Rho <- calculateModelIOYearbyYearPriceRatio(model)

# Calculate producer over purchaser price ratio.
logging::loginfo("Calculating Phi matrix (producer over purchaser price ratio)...")
model$Phi <- calculateProducerbyPurchaserPriceRatio(model)

# Calculate basic over producer price ratio.
logging::loginfo("Calculating Tau matrix (basic over producer price ratio)...")
model$Tau <- calculateBasicbyProducerPriceRatio(model)

if(!is.null(model$specs$ExternalImportFactors)) {
# Alternate model build for implementing Import Factors
model <- buildModelwithImportFactors(model)
Expand All @@ -123,18 +135,6 @@ constructEEIOMatrices <- function(model) {
model$N_d <- model$C %*% model$M_d
}
}

# Calculate year over model IO year price ratio
logging::loginfo("Calculating Rho matrix (price year ratio)...")
model$Rho <- calculateModelIOYearbyYearPriceRatio(model)

# Calculate producer over purchaser price ratio.
logging::loginfo("Calculating Phi matrix (producer over purchaser price ratio)...")
model$Phi <- calculateProducerbyPurchaserPriceRatio(model)

# Calculate basic over producer price ratio.
logging::loginfo("Calculating Tau matrix (basic over producer price ratio)...")
model$Tau <- calculateBasicbyProducerPriceRatio(model)

#Clean up model elements not written out or used in further functions to reduce clutter
mat_to_remove <- c("MakeTransactions", "UseTransactions", "DomesticUseTransactions",
Expand Down

0 comments on commit 8bee3db

Please sign in to comment.