From e66e69b646898618db5a4a08b5d282c95296e97f Mon Sep 17 00:00:00 2001 From: Julie Chen Date: Thu, 30 Jan 2025 17:14:07 -0500 Subject: [PATCH] Fixing bug in Ghosh B --- R/CalculationFunctions.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/CalculationFunctions.R b/R/CalculationFunctions.R index d14137f9..f82dd45c 100644 --- a/R/CalculationFunctions.R +++ b/R/CalculationFunctions.R @@ -691,9 +691,9 @@ calculateGhoshB <- function(model,use_domestic_requirements=FALSE) { x <- model$x # total industry output A <- model$A if(model$specs$CommodityorIndustryType == "Commodity") { - B <- solve(diag(x)) %*% A %*% diag(x) - } else if(model$specs$CommodityorIndustryType == "Industry") { B <- solve(diag(q)) %*% A %*% diag(q) + } else if(model$specs$CommodityorIndustryType == "Industry") { + B <- solve(diag(x)) %*% A %*% diag(x) } row.names(B) <- model$Commodities$Code_Loc