calc_io_mats | R Documentation |
This function bundles several others and calculates matrices that describe the structure of an energy conversion chain.
calc_io_mats(
.sutdata = NULL,
direction = c("upstream", "demand", "Leontief", "downstream", "supply", "Ghosh"),
method = c("solve", "QR", "SVD"),
tol = .Machine$double.eps,
method_q_calculation = c("sum_U_Y_rows", "sum_R_V_cols"),
R = "R",
U = "U",
U_feed = "U_feed",
V = "V",
Y = "Y",
S_units = "S_units",
y = "y",
q = "q",
f = "f",
g = "g",
h = "h",
r = "r",
W = "W",
K = "K",
Z = "Z",
C = "C",
D = "D",
A = "A",
L_ixp = "L_ixp",
L_pxp = "L_pxp",
O = "O",
Z_feed = "Z_feed",
K_feed = "K_feed",
A_feed = "A_feed",
L_ixp_feed = "L_ixp_feed",
L_pxp_feed = "L_pxp_feed",
Z_s = "Z_s",
C_s = "C_s",
D_s = "D_s",
D_feed_s = "D_feed_s",
B = "B",
G_ixp = "G_ixp",
G_pxp = "G_pxp",
O_s = "O_s"
)
.sutdata |
A data frame of supply-use table matrices with matrices arranged in columns. |
direction |
A string that identifies the directionality of the IO matrices. See details. Default is "upstream". |
method |
One of "solve", "QR", or "SVD". Default is "solve". See details. |
tol |
The tolerance for detecting linear dependencies during matrix inversion.
Default is |
method_q_calculation |
Specifies the method with which the q vector should be calculated. See details. |
R |
The resources (R) matrix or name of the column in |
U |
The use (U) matrix or name of the column in |
U_feed |
The feed portion of the use matrix (U_feed) or name of the column in |
V |
The make (V) matrix or name of the column in |
Y |
The final demand (Y) matrix or name of the column in |
S_units |
The unit summation matrix (S_units) or name of the column in |
y |
The name for the y vector on output. Default is "y".
y is calculated by |
q |
The name for the q vector on output. Default is "q".
q is calculated by |
f |
The name for the f vector on output. Default is "f".
f is calculated by |
g |
The name for the g vector on output. Default is "g".
g is calculated by |
h |
The name for the h vector on output. Default is "h".
h is calculated by |
r |
The name for the r vector on output. Default is "r".
r is calculated by |
W |
The name for the W matrix on output. Default is "W".
W is calculated by |
K |
The name for the K matrix on output. Default is "K".
K is calculated by |
Z |
The name fort the Z matrix on output. Default is "Z".
Z is calculated by |
C |
The name for the C matrix on output. Default is "C".
C is calculated by |
D |
The name for the D matrix on output. Default is "D".
D is calculated by |
A |
The name for the A matrix on output. Default is "A".
A is calculated by |
L_ixp |
The name for the L_ixp matrix on output. Default is "L_ixp".
L_ixp is calculated by |
L_pxp |
The name for the L_pxp_feed matrix on output. Default is "L_pxp_feed".
L_pxp is calculated by |
O |
name for the O matrix on output. Default is "O".
O is calculated by |
Z_feed |
The name for the Z_feed matrix on output. Default is "Z_feed".
Z_feed is calculated by |
K_feed |
The name for the K_feed matrix on output. Default is "K_feed".
K_feed is calculated by |
A_feed |
The name for the A_feed matrix on output. Default is "A_feed".
A_feed is calculated by |
L_ixp_feed |
The name for the L_ixp_feed matrix on output. Default is "L_ixp_feed".
L_ixp_feed is calculated by |
L_pxp_feed |
The name for the L_pxp_feed matrix on output. Default is "L_pxp_feed".
L_pxp_feed is calculated by |
Z_s |
The name for the Z_s matrix on output. Default is "Z_s".
Z_s is calculated by |
C_s |
The name for the C_s matrix on output. Default is "C_s".
C_s is calculated by |
D_s |
The name for the D_s matrix on output. Default is "D_s".
D_s is calculated by |
D_feed_s |
The name for the D_feed_s matrix on output. Default is "D_feed_s".
D_s is calculated by |
B |
The name for the B matrix on output. Default is "B".
B is calculated by |
G_ixp |
The name for the G_ixp matrix on output. Default is "G_ixp".
G_ixp is calculated by |
G_pxp |
The name for the G_pxp matrix on output. Default is "G_pxp".
|
O_s |
The name for the O_s matrix on output. Default is "O_s".
O is calculated by |
Some calculations involve a matrix inversion step.
The method
argument specifies which method should be used for
calculating the inverse.
See matsbyname::invert_byname()
.
method_q_calculation
specifies the method with which the q vector should be calculated.
Default is "sum_U_Y_rows", corresponding to a demand-sided view of q.
Alternatively, an analyst can choose to use the "sum_R_V_cols" method,
corresponding to a supply-sided view of q.
In the case of a balanced ECC, the method does not matter.
Input-output matrices can be calculated for either
an upstream swim (demand-sided as Leontief) or
a downstream swim (supply-sided as Ghosh).
The direction
argument defines the direction.
Different IO matrices are calculated based on direction.
The default is "upstream", meaning that an upstream swim is desired.
Note that "upstream", "demand", and "Leontief" are synonyms.
"downstream", "supply", and "Ghosh" are synonyms.
A list or data frame containing input-output matrices.
library(dplyr)
library(tidyr)
UKEnergy2000mats %>%
spread(key = matrix.name, value = matrix) %>%
select(Country, Year, EnergyType, LastStage, U, U_feed, V, Y, r_EIOU, S_units) %>%
calc_io_mats()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.