Description Usage Arguments Details Value Author(s) References Examples
Computes the Leontief (input) inverse. leontief.inv
has inputs to invert a subset of all regions if desired. If not using an InputOutput
object from as.inputoutput
, the functionality is limited. See example for more details.
Note: if you have a non InputOutput
object and you wish to use only a subset of all regions, you must supply the intermediate transaction matrix (Z
) and total production matrix (X
). Otherwise use L <- Z %*% diag(c(1/X))
Caution: Inverting large matrices will take a long time. R does a computation roughly every 8e-10 second. The number of computations per matrix inversion is n^3 where n is the dimension of the square matrix. For n = 5000 it should take 100 seconds. I trust you know how cubic functions grow.
1 | leontief.inv(Z = NULL, X, A, RS_label, regions)
|
Z |
Either an object class of |
X |
vector. Total production vector. Not required if Z is an object with |
A |
Matrix. Technical Matrix of Input Coefficients. If provided and the data is large, the computations will be noticeably sped up. |
RS_label |
Matrix. A nx2 column matrix of labels for regions and sectors. The first column must be regions and the second column must be sectors. This is used to match with the intermediate transaction matrix. |
regions |
Character or Integer. Specific regions to be used. Can either be a character that exactly matches the name of the region in |
The Leontief inverse is derived from the input-output table A=[a_ij] where
a_ij=z_ij/X_j
where z_ij is the input from i required in the production of j. X_j is the corresponding input in each column. The Leontief inverse is then computed as
(I-A)^{-1}
Observe we result with the following system
X = Lf
Therefore, element l_{ij} is interpreted as the ratio of final demand for sector j contributing to the total production in sector i.
Returns a matrix with the Leontief Inverse.
Ignacio Sarmiento-Barbieri, John J. P. Wade
Nazara, Suahasil & Guo, Dong & Hewings, Geoffrey J.D., & Dridi, Chokri, 2003. PyIO. Input-Output Analysis with Python. REAL Discussion Paper 03-t-23. University of Illinois at Urbana-Champaign. (http://www.real.illinois.edu/d-paper/03/03-t-23.pdf)
1 2 3 4 5 6 7 8 9 10 | # Using an "InputOutput" object
data(toy.IO)
class(toy.IO)
L1 <- leontief.inv(toy.IO, region = "Narnia")
# Otherwise
Z <- toy.IO$Z
X <- toy.IO$X
L2 <- leontief.inv(Z, X)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.