@@ -33,6 +33,7 @@ constructEEIOMatrices <- function(model, configpaths = NULL) {
33
33
# Generate B matrix
34
34
logging :: loginfo(" Building B matrix (direct emissions and resource use per dollar)..." )
35
35
model $ B <- createBfromFlowDataandOutput(model )
36
+ model $ B_dqi <- createB_dqi(model )
36
37
B_h <- standardizeandcastSatelliteTable(model $ CbS , model , final_demand = TRUE )
37
38
if (! is.null(B_h )) {
38
39
model $ B_h <- as.matrix(B_h )
@@ -48,6 +49,7 @@ constructEEIOMatrices <- function(model, configpaths = NULL) {
48
49
# Add direct impact matrix
49
50
logging :: loginfo(" Calculating D matrix (direct environmental impacts per dollar)..." )
50
51
model $ D <- model $ C %*% model $ B
52
+ model $ D_dqi <- (model $ C %*% (model $ B * model $ B_dqi )) / model $ D
51
53
}
52
54
53
55
model <- buildPriceMatrices(model )
@@ -61,6 +63,7 @@ constructEEIOMatrices <- function(model, configpaths = NULL) {
61
63
# Calculate total emissions/resource use per dollar (M)
62
64
logging :: loginfo(" Calculating M matrix (total emissions and resource use per dollar)..." )
63
65
model $ M <- model $ B %*% model $ L
66
+ model $ M_dqi <- ((model $ B * model $ B_dqi ) %*% model $ L ) / model $ M
64
67
65
68
colnames(model $ M ) <- colnames(model $ M )
66
69
# Calculate M_d, the domestic emissions per dollar using domestic Leontief
@@ -73,6 +76,7 @@ constructEEIOMatrices <- function(model, configpaths = NULL) {
73
76
if (! is.null(model $ M )) {
74
77
logging :: loginfo(" Calculating N matrix (total environmental impacts per dollar)..." )
75
78
model $ N <- model $ C %*% model $ M
79
+ model $ N_dqi <- ((model $ D * model $ D_dqi ) %*% model $ L ) / model $ N
76
80
}
77
81
if (! is.null(model $ M_m )) {
78
82
logging :: loginfo(" Calculating N_m matrix (total environmental impacts per dollar from imported activity)..." )
0 commit comments