Package CGE': R Topics Documented
Package CGE': R Topics Documented
BugReports https://github.com/LiWuR/CGE/issues
RoxygenNote 7.1.0
NeedsCompilation no
Repository CRAN
Date/Publication 2020-05-24 05:00:11 UTC
R topics documented:
CD_A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
CD_mA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
CES_A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
CES_mA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
ChinaCGE2012 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
dg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Example.MWG.15.B.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Example.MWG.15.B.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Example.MWG.Exercise.15.B.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Example.MWG.Exercise.15.B.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1
2 R topics documented:
Example.Section.3.1.2.corn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Example.Varian.Exercise.18.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Example.Varian.P352 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Example2.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Example2.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Example3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Example3.10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Example3.12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Example3.14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Example3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Example3.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Example3.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Example3.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Example4.10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Example4.11.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Example4.11.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Example4.12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Example4.13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Example4.15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Example4.16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Example4.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Example4.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Example4.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Example5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Example5.10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Example5.11.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Example5.11.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Example5.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Example5.3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Example5.3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Example5.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Example5.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Example5.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Example6.10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Example6.11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Example6.13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Example6.2.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Example6.2.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Example6.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Example6.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Example6.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Example6.6.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Example6.6.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Example6.6.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Example6.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Example6.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Example7.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Example7.10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
CD_A 3
Example7.10.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Example7.11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Example7.12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Example7.13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Example7.14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Example7.15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Example7.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Example7.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Example7.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Example7.5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Example7.5.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Example7.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Example7.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Example7.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Example7.9X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Example8.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Example8.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Example8.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Example8.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Example8.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Example9.10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Example9.10.policy.deficit.fiscal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Example9.10.policy.deflation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Example9.10.policy.interest.rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Example9.10.policy.money.supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Example9.10.policy.quantitative.easing . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Example9.10.policy.tax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Example9.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Example9.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Example9.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Example9.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Example9.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
F_Z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
iep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Leontief_mA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
PF_eig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
sdm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Index 76
Description
This function computes the Cobb-Douglas demand structure matrix.
4 CD_mA
Usage
CD_A(alpha, Beta, p)
Arguments
alpha a nonnegative numeric m-vector or m-by-1 matrix.
Beta a nonnegative numeric n-by-m matrix whose each column sum equals 1.
p a nonnegative numeric n-vector or n-by-1 matrix.
Value
A demand coefficient n-by-m matrix is computed which indicates the demands of agents (firms or
consumers) for obtaining unit product or utility with Cobb-Douglas production functions or utility
functions under the price vector p.
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Examples
CD_A(1, c(0.5, 0.5), c(1, 2))
#####
alpha <- c(5, 3, 1)
Beta <- matrix(c(
0.6, 0.4, 0.2,
0.1, 0.4, 0.7,
0.3, 0.2, 0.1
), 3, 3, TRUE)
p <- 1:3
CD_A(alpha, Beta, p)
Description
This function computes a Cobb-Douglas monetary demand structure matrix in a monetary economy.
Usage
CD_mA(alpha, Beta, p)
CES_A 5
Arguments
alpha a nonnegative numeric m-vector or m-by-1 matrix.
Beta nonnegative numeric n-by-m matrix whose each column sum equals 1.
p a nonnegative numeric n-vector or n-by-1 matrix.
Details
Some elements of Beta corresponding to money equal -1.
Value
A n-by-m matrix is computed which indicates the (monetary) demand structure of agents (firms or
consumers) with Cobb-Douglas production functions or utility functions under the price vector p.
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Examples
alpha <- c(1, 1, 1)
Beta <- matrix(c(
0.5, 0.5, 0.5,
0.5, 0.5, 0.5,
-1, -1, -1
), 3, 3, TRUE)
p <- c(1, 2, 0.1)
CD_mA(alpha, Beta, p)
Description
This function computes the CES demand coefficient matrix.
Usage
CES_A(sigma, alpha, Beta, p, Theta = NULL)
6 CES_A
Arguments
sigma a numeric m-vector or m-by-1 matrix.
alpha a nonnegative numeric m-vector or m-by-1 matrix.
Beta a nonnegative numeric n-by-m matrix.
p a nonnegative numeric n-vector or n-by-1 matrix.
Theta null or a positive numeric n-by-m matrix.
Value
A demand coefficient n-by-m matrix is computed which indicates the demands of agents (firms or
consumers) for obtaining unit product or utility with CES production functions or utility functions
(e.g. alpha*(beta1*x1^sigma+beta2*x2^sigma)^(1/sigma) or alpha*(beta1*(x1/theta1)^sigma+beta2*(x2/theta2)^sigma)^(1/
under the price vector p.
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Examples
CES_A(-1, 2, c(0.2, 0.1), c(1, 2))
#####
sigma <- c(-1, -1, -1)
alpha <- c(1, 1, 1)
Beta <- matrix(c(
0, 1, 1,
1, 0, 0,
1, 0, 0
), 3, 3, TRUE)
p <- 1:3
CES_A(sigma, alpha, Beta, p)
#####
sigma <- -1e-10
alpha <- 1
Beta <- c(0.8, 0.2)
Theta <- c(2, 1)
p <- c(1, 1)
CES_A(sigma, alpha, Beta, p, Theta)
CD_A(alpha * prod(Theta^(-Beta)), Beta, p)
Description
This function computes a CES monetary demand coefficient matrix in a monetary economy.
Usage
Arguments
Details
Value
A n-by-m matrix is computed which indicates the (monetary) demand structure of agents (firms or
consumers) with CES production functions or utility functions under the price vector p.
Author(s)
LI Wu <[email protected]>
References
Examples
alpha <- matrix(1, 6, 1)
Beta <- matrix(c(
0, 1, 1, 0, 1, 1,
0.5, 0, 0, 0, 0, 0,
-1, -1, -1, 0, 0, 0,
0.5, 0, 0, 0.5, 0, 0,
0, 0, 0, 0.5, 0, 0,
0, 0, 0, -1, -1, -1
), 6, 6, TRUE)
p <- c(1, 2, 0.1, 4, 5, 0.1)
CES_mA(rep(-1, 6), alpha, Beta, p)
ChinaCGE2012 A CGE Model of China based on the Input-Output Table of 2012 (Unit:
Ten Thousand RMB)
Description
This data set gives parameters of a CGE model of China based on the input-output table of 2012.
Usage
ChinaCGE2012
Format
A list containing the following components:
A(state) function a function which returns a demand structure 41-by-38 matrix under a given price 41-vector.
B numeric a supply structure 41-by-38 matrix.
S0Exg numeric an exogenous supply 41-by-38 matrix.
z0 numeric an initial exchange levels (i.e. activity levels, production levels or utility levels) 38-vector.
subject.names character names of 41 subjects (or commodities).
sector.names character names of 38 sectors.
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Examples
dg 9
#####
cge <- function(GRExg = 0) {
sdm(
A = ChinaCGE2012$A,
B = ChinaCGE2012$B,
S0Exg = ChinaCGE2012$S0Exg,
GRExg = GRExg,
z0 = ChinaCGE2012$z0,
priceAdjustmentVelocity = 0.03
)
}
#####
ge0 <- cge()
names(ge0$p) <- ChinaCGE2012$subject.names
ge0$p
#####
ge6 <- cge(GRExg = 0.06)
names(ge6$p) <- ChinaCGE2012$subject.names
ge6$p
Description
This function works in the way analogous to the diag function of Matlab.
Usage
dg(x)
Arguments
x a number, vector or square matrix.
Value
If x is a number, dg returns itself. If x is a vector, a one-row matrix or a one-column matrix, dg
returns a matrix with x as the main diagnol. Otherwise dg returns diag(x).
10 Example.MWG.15.B.1
Author(s)
LI Wu <[email protected]>
Examples
diag(matrix(2, 3))
dg(matrix(2, 3))
Description
This is Example 15.B.1 in MWG (1995, P519), which is a pure exchange Cobb-Douglas 2-by-2
economy.
Usage
Example.MWG.15.B.1(
a = 0.1,
S0Exg = matrix(c(
1, 2,
2, 1
), 2, 2, TRUE)
)
Arguments
Author(s)
LI Wu <[email protected]>
References
Examples
Example.MWG.15.B.1()
#####
Example.MWG.15.B.1(a = 0.2)
#####
S <- matrix(c(
18, 72,
40, 20
), 2, 2, TRUE)
ge <- Example.MWG.15.B.1(a = 0.2, S0Exg = S)
ge$p / ge$p[1]
Description
This is Example 15.B.2 in MWG (1995, P521), which is a pure exchange 2-by-2 economy with
quasilinear utility functions.
Usage
Example.MWG.15.B.2(p0 = c(1, 0.3))
Arguments
p0 an initial price 2-vector, which will be passed to the function sdm.
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Mas-Colell, Andreu and Whinston, Michael Dennis and Green, Jerry R. (1995, ISBN: 0195073401)
Microeconomic Theory. Oxford University Press (New York).
Examples
ge <- Example.MWG.15.B.2()
ge$p
#####
12 Example.MWG.Exercise.15.B.6
#####
ge <- Example.MWG.15.B.2(p0 = c(1, 1))
ge$p
Example.MWG.Exercise.15.B.6
Exercise 15.B.6 in MWG (1995)
Description
This is Exercise 15.B.6 in MWG (1995, P541), which is a pure exchange CES 2-by-2 economy.
Usage
Example.MWG.Exercise.15.B.6(p0 = c(1, 2))
Arguments
p0 an initial price 2-vector, which will be passed to the function sdm.
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Mas-Colell, Andreu and Whinston, Michael Dennis and Green, Jerry R. (1995, ISBN: 0195073401)
Microeconomic Theory. Oxford University Press (New York).
Examples
ge <- Example.MWG.Exercise.15.B.6()
ge$p / ge$p[2] # (3/4)^3
#####
ge <- Example.MWG.Exercise.15.B.6(p0 = c(2, 1))
ge$p / ge$p[2] # (4/3)^3
#####
ge <- Example.MWG.Exercise.15.B.6(p0 = c(1, 1))
ge$p
Example.MWG.Exercise.15.B.9 13
Example.MWG.Exercise.15.B.9
Exercise 15.B.9 in MWG (1995)
Description
This is Exercise 15.B.9 in MWG (1995, P541), which is a pure exchange 2-by-2 economy.
Usage
Example.MWG.Exercise.15.B.9(
S0Exg = matrix(c(
30, 0,
0, 20
), 2, 2, TRUE)
)
Arguments
S0Exg an exogenous supply matrix, which will be passed to the function sdm.
Author(s)
LI Wu <[email protected]>
References
Examples
Example.MWG.Exercise.15.B.9()
#####
S <- matrix(c(
5, 0,
0, 20
), 2, 2, TRUE)
Example.MWG.Exercise.15.B.9(S0Exg = S)
14 Example.Varian.Exercise.18.2
Example.Section.3.1.2.corn
Example in Section.3.1.2 of Li (2019)
Description
This is the example in Section.3.1.2 of Li (2019), which is a Leontief-type two-sector corn economy.
Usage
Example.Section.3.1.2.corn()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Example.Varian.Exercise.18.2
Exercise 18.2 in Varian (1992)
Description
This is Exercise 18.2 in Varian (1992, P357), which is a Cobb-Douglas 3-by-4 economy.
Usage
Example.Varian.Exercise.18.2()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Varian, Hal R. (1992, ISBN: 0393957357) Microeconomic Analysis. W. W. Norton & Company.
Examples
ge <- Example.Varian.Exercise.18.2()
ge$A %*% diag(ge$z) #input matrix
Example.Varian.P352 15
Description
This is the example on page 352 in Varian (1992) (see also Example 15.C.2. in MWG, 1995, P542),
which is a decreasing-returns-to-scale Cobb-Douglas 3-by-2 economy and can be transformed into
a constant-returns-to-scale 3-by-3 (or 3-by-2) economy.
Usage
Example.Varian.P352(agent.number = 3)
Arguments
agent.number agent.number can be set to 3 or 2.
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Mas-Colell, Andreu and Whinston, Michael Dennis and Green, Jerry R. (1995, ISBN: 0195073401)
Microeconomic Theory. Oxford University Press (New York).
Varian, Hal R. (1992, ISBN: 0393957357) Microeconomic Analysis. W. W. Norton & Company.
Examples
Example.Varian.P352()
#####
Example.Varian.P352(agent.number = 2)
Description
This is Example 2.2 in Li (2019), which is a Cobb-Douglas pure production economy.
Usage
Example2.2()
16 Example3.1
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Description
This is Example 2.3 in Li (2019), which is a von Neumann economy.
Usage
Example2.3()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Description
This is Example 3.1 in Li (2019),which is a two-sector corn economy with a non-homothetic utility
function.
Usage
Example3.1()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Example3.10 17
Description
This is Example 3.10 in Li (2019),which is a Leontief corn economy with three primary factors.
Usage
Example3.10()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example3.12()
Author(s)
LI Wu <[email protected]>
References
Description
This is Example 3.14 in Li (2019),which illustrates the relationship between a regular economy and
a pure exchange economy.
Usage
Example3.14()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Description
This is Example 3.2 in Li (2019),which is a Cobb-Douglas two-sector corn economy.
Usage
Example3.2()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Example3.4 19
Description
This is Example 3.2 in Li (2019),which is a Lontief three-sector economy with one primary factor.
Usage
Example3.4()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Description
This is Example 3.8 in Li (2019),which is a Cobb-Douglas three-sector economy with one primary
factor.
Usage
Example3.8()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
20 Example4.10
Description
This is Example 3.9 in Li (2019),which is a Cobb-Douglas three-sector economy with two primary
factors.
Usage
Example3.9()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Description
This is Example 4.10 in Li (2019),which illustrates the tax.
Usage
Example4.10()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Example4.11.1 21
Description
This is the first part of Example 4.11 in Li (2019),which illustrates the tax.
Usage
Example4.11.1()
Author(s)
LI Wu <[email protected]>
References
Description
This is the second part of Example 4.11 in Li (2019),which illustrates the tax.
Usage
Example4.11.2()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example4.12()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example4.13()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example4.15()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example4.16()
Author(s)
LI Wu <[email protected]>
References
Description
This is Example 4.2 in Li (2019), which illustrates the non-sufficient supply of the primary factor.
Usage
Example4.2()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example4.8()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example4.9()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example5.1()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example5.10()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example5.11.1()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example5.11.2()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example5.2()
Author(s)
LI Wu <[email protected]>
References
Description
This is the first part of Example 5.3 in Li (2019),which illustrates fixed assets.
Usage
Example5.3.1()
Author(s)
LI Wu <[email protected]>
References
Description
This is the second part of Example 5.3 in Li (2019),which illustrates fixed assets.
Usage
Example5.3.2()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example5.4()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example5.5()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example5.6()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example6.10()
Author(s)
LI Wu <[email protected]>
References
Description
This is Example 6.11 in Li (2019),which illustrates a two-country economy.
Usage
Example6.11()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Description
This is Example 6.13 in Li (2019),which illustrates a two-country economy.
Usage
Example6.13()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Examples
ge <- Example6.13()
matplot(ge$ts.p, type = "l")
matplot(ge$ts.z, type = "l")
32 Example6.2.2
Description
This is the first part of Example 6.2 in Li (2019),which illustrates a two-country economy.
Usage
Example6.2.1()
Author(s)
LI Wu <[email protected]>
References
Description
This is the second part of Example 6.2 in Li (2019),which illustrates a two-country economy.
Usage
Example6.2.2()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example6.3()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example6.4()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example6.5()
Author(s)
LI Wu <[email protected]>
References
Description
This is the first part of Example 6.6 in Li (2019),which illustrates a two-country economy.
Usage
Example6.6.1()
Author(s)
LI Wu <[email protected]>
References
Description
This is the second part of Example 6.6 in Li (2019),which illustrates the first country of a two-
country economy.
Usage
Example6.6.2()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Description
This is the third part of Example 6.6 in Li (2019),which illustrates the second country of a two-
country economy.
Usage
Example6.6.3()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
36 Example6.9
Description
Usage
Example6.7()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example6.9()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example7.1()
Author(s)
LI Wu <[email protected]>
References
Description
This is Example 7.10 in Li (2019), which illustrates fiat money and representative money.
Usage
Example7.10()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019) General Equilibrium and Structural Dynamics: Perspectives of New Structural Eco-
nomics. Beijing: Economic Science Press. (In Chinese)
38 Example7.11
Description
This is an extra part of Example 7.10 in Li (2019), which illustrates fiat money and representative
money.
Usage
Example7.10.2()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Description
This is Example 7.11 in Li (2019), which illustrates bond.
Usage
Example7.11()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Example7.12 39
Description
This is Example 7.12 in Li (2019), which illustrates the foreign exchange rate and international
credit.
Usage
Example7.12()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Description
This is Example 7.13 in Li (2019), which illustrates indirect financing based on commercial banks.
Usage
Example7.13()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
40 Example7.15
Description
Usage
Example7.14()
Author(s)
LI Wu <[email protected]>
References
Description
This is Example 7.15 in Li (2019), which illustrates shadow prices and international trade.
Usage
Example7.15()
Author(s)
LI Wu <[email protected]>
References
Description
This is Example 7.2 in Li (2019),which illustrates a monetary Cobb-Douglas zero-growth corn
economy.
Usage
Example7.2()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Examples
## Another way to compute this equilibrium, i.e. treating money as tax receipt.
r <- 0.25
ge <- sdm(
A = function(state) {
alpha <- rbind(1, 1, 1)
Beta <- matrix(c(
0.5, 0.5, 0.5,
0.5, 0.5, 0.5
), 2, 3, TRUE)
tmp.A <- CD_A(alpha, Beta, state$p[1:2])
tmp <- apply(tmp.A, 2, function(x) sum(x * state$p[1:2]))
ge$p / ge$p[3] * r
p <- ge$p
p[3] <- p[3] / r
42 Example7.4
p / p[3]
Description
This is Example 7.3 in Li (2019),which illustrates a monetary Leontief corn economy.
Usage
Example7.3()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Description
This is Example 7.4 in Li (2019),which illustrates a monetary Cobb-Douglas positive-growth corn
economy.
Usage
Example7.4()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Example7.5.1 43
Description
This is the first part of Example 7.5 in Li (2019),which illustrates a monetary Cobb-Douglas corn
economy including dividend.
Usage
Example7.5.1()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Description
This is the second part of Example 7.5 in Li (2019), which illustrates a monetary Cobb-Douglas
corn economy including dividend.
Usage
Example7.5.2()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019) General Equilibrium and Structural Dynamics: Perspectives of New Structural Eco-
nomics. Beijing: Economic Science Press. (In Chinese)
44 Example7.7
Description
Usage
Example7.6()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example7.7()
Author(s)
LI Wu <[email protected]>
References
Description
Usage
Example7.8()
Author(s)
LI Wu <[email protected]>
References
Description
This is Example 7.9 in Li (2019), which illustrates commodity money and representative money.
Usage
Example7.9X()
Author(s)
LI Wu <[email protected]>
References
Description
This is Example 8.1 in Li (2019), which expounds the equilibrium coffee problem.
Usage
Example8.1()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Description
This is Example 8.2 in Li (2019), which expounds a Cobb-Douglas market-clearing exchange pro-
cess.
Usage
Example8.2()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Example8.7 47
Description
This is Example 8.7 in Li (2019), which discusses price changes in the coffee economy.
Usage
Example8.7()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Examples
ge <- Example8.7()
matplot(ge$ts.p, type = "l")
matplot(ge$ts.z, type = "l")
Description
This is Example 8.8 in Li (2019), which illustrates a dynamic exchange model with one type of
money.
Usage
Example8.8()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
48 Example9.10
Examples
ge <- Example8.8()
matplot(ge$ts.p, type = "l")
matplot(ge$ts.z, type = "l")
Description
This is Example 8.9 in Li (2019), which illustrates a dynamic exchange model with multiple types
of money.
Usage
Example8.9()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Examples
ge <- Example8.9()
matplot(ge$ts.p, type = "l")
matplot(ge$ts.z, type = "l")
Description
This is Example 9.10-14 in Li (2019), which illustrates economic cycles in a monetary economy
and economic policies ironing economic cycles.
Usage
Example9.10(
policy = NULL,
pExg = rbind(NA, NA, 0.25),
p0 = rbind(0.625, 0.375, 0.25),
priceAdjustmentVelocity = 0.3,
ts = TRUE
)
Example9.10 49
Arguments
Those arguments will be passed to the function sdm. See sdm.
a policy function
policy
pExg an n-vector indicating the exogenous prices (if any).
p0 an initial price n-vector.
priceAdjustmentVelocity
the price adjustment velocity.
ts if TRUE, the time series of the last iteration are returned.
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
See Also
sdm; Example9.10.policy.interest.rate; Example9.10.policy.money.supply; Example9.10.policy.deflation;
Example9.10.policy.quantitative.easing; Example9.10.policy.tax; Example9.10.policy.deficit.fiscal
Examples
##### no policy
ge <- Example9.10()
matplot(ge$ts.p, type = "l")
matplot(ge$ts.z, type = "l")
Example9.10.policy.deficit.fiscal
Deficit Fiscal Policy for Example 9.10 in Li (2019)
Description
This is the deficit fiscal policy for the economy of Example 9.10 in Li (2019), which is discussed in
Example 9.14.
Usage
Example9.10.policy.deficit.fiscal(time, state, state.history)
Arguments
time the current time.
state a list indicating the current economic state including prices, exchange levels (i.e.
activity levels, production levels or utility levels) and supplies.
state.history the history of economic states.
Example9.10.policy.deflation 51
Value
Example9.10.policy.deficit.fiscal returns a list indicating the modified current economic state in-
cluding prices, exchange levels (i.e. activity levels, production levels or utility levels), supplies and
current policy data.
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
See Also
Example9.10; Example9.10.policy.interest.rate; Example9.10.policy.money.supply; Example9.10.policy.defl
Example9.10.policy.quantitative.easing; Example9.10.policy.tax
Example9.10.policy.deflation
Deflation Policy for Example9.10 in Li (2019)
Description
This is the deflation policy for the economy of Example 9.10 in Li (2019), which is discussed in
Example 9.12.
Usage
Example9.10.policy.deflation(time, state, state.history)
Arguments
time the current time.
state a list indicating the current economic state including prices, exchange levels (i.e.
activity levels, production levels or utility levels) and supplies.
state.history the history of economic states.
Value
Example9.10.policy.deflation returns a list indicating the modified current economic state including
prices, exchange levels (i.e. activity levels, production levels or utility levels) and supplies.
Author(s)
LI Wu <[email protected]>
52 Example9.10.policy.interest.rate
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
See Also
Example9.10; Example9.10.policy.interest.rate; Example9.10.policy.money.supply; Example9.10.policy.quan
Example9.10.policy.tax; Example9.10.policy.deficit.fiscal
Example9.10.policy.interest.rate
Interest Rate Policy for Example9.10 in Li (2019)
Description
This is the interest rate policy for the economy of Example 9.10 in Li (2019), which is discussed in
Example 9.11.
Usage
Example9.10.policy.interest.rate(time, state, state.history)
Arguments
time the current time.
state a list indicating the current economic state including prices, exchange levels (i.e.
activity levels, production levels or utility levels) and supplies.
state.history the history of economic states.
Value
Example9.10.policy.interest.rate returns a list indicating the modified current economic state in-
cluding prices, exchange levels (i.e. activity levels, production levels or utility levels) and supplies.
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
See Also
Example9.10; Example9.10.policy.money.supply; Example9.10.policy.deflation; Example9.10.policy.quantit
Example9.10.policy.tax; Example9.10.policy.deficit.fiscal
Example9.10.policy.money.supply 53
Example9.10.policy.money.supply
Money Supply Policy for Example9.10 in Li (2019)
Description
This is the money supply policy for the economy of Example 9.10 in Li (2019), which is discussed
in Example 9.12.
Usage
Arguments
Value
Example9.10.policy.money.supply returns a list indicating the modified current economic state in-
cluding prices, exchange levels (i.e. activity levels, production levels or utility levels) and supplies.
Author(s)
LI Wu <[email protected]>
References
See Also
Example9.10.policy.quantitative.easing
Quantitative Easing Policy for Example 9.10 in Li (2019)
Description
This is the deflation policy for the economy of Example 9.10 in Li (2019), which is discussed in
Example 9.12.
Usage
Arguments
Value
Author(s)
LI Wu <[email protected]>
References
See Also
Example9.10.policy.tax
Tax Policy for Example9.10 in Li (2019)
Description
This is the tax policy for the economy of Example 9.10 in Li (2019), which is discussed in Example
9.13.
Usage
Arguments
Value
Example9.10.policy.tax returns a list indicating the modified current economic state including prices,
exchange levels (i.e. activity levels, production levels or utility levels), supplies and current policy
data.
Author(s)
LI Wu <[email protected]>
References
See Also
Description
This is Example 9.3 in Li (2019), which illustrates economic cycles in a pure production economy.
Usage
Example9.3()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Examples
ge<-Example9.3()
matplot(ge$ts.p, type="l")
matplot(ge$ts.z, type="l")
Description
This is Example 9.4 in Li (2019), which illustrates economic cycles in a corn economy.
Usage
Example9.4()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Example9.5 57
Examples
ge<-Example9.4()
matplot(ge$ts.p, type="l")
matplot(ge$ts.z, type="l")
Description
This is Example 9.5 in Li (2019), which illustrates the price-control equilibrium.
Usage
Example9.5()
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Examples
ge<-Example9.5()
matplot(ge$ts.p, type="l")
matplot(ge$ts.z, type="l")
Description
This is Example 9.6 in Li (2019), which illustrates the technological progress and capital accumu-
lation in the corn economy.
Usage
Example9.6()
Author(s)
LI Wu <[email protected]>
58 Example9.7
References
Examples
ge<-Example9.6()
matplot(ge$ts.p, type="l")
matplot(ge$ts.z, type="l")
Description
This is Example 9.7 in Li (2019), which illustrates fixed assets and economic cycles.
Usage
Example9.7()
Author(s)
LI Wu <[email protected]>
References
Examples
ge<-Example9.7()
matplot(ge$ts.p, type="l")
matplot(ge$ts.z, type="l")
F_Z 59
Description
Given a price vector, a demand coefficient matrix and a supply matrix, this function computes the
(disequilibrium) exchange results of an exchange process. There are n commodities and m agents
in the exchange process.
Usage
F_Z(A, p, S)
Arguments
A a n-by-m demand coefficient matrix.
p a price n-vector.
S a n-by-m supply matrix.
Value
F_Z returns a list containing the following components:
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Examples
A <- matrix(c(
0.05, 0.05, 0.1,
0.1, 0, 0.1,
0, 0.15, 0.05
), 3, 3, TRUE)
S <- diag(3)
result$q
# the purchase matrix
A %*% diag(result$z)
Description
This function computes the instantaneous equilibrium path (alias market clearing path).
Usage
iep(A.iep = NULL, A = NULL, B.iep = NULL, B = NULL,
SExg.iep, InitialEndowments, nPeriods.iep, ...)
Arguments
A.iep A.iep(state.iep) is a function which returns a demand coefficient matrix or a
function A(state). state.iep is a list consisting of time (the iep time), p (the price
vector at the iep time), z (output and utility vector at the iep time).
A a demand coefficient matrix or a function A(state) which returns a demand co-
efficient matrix. If A.iep is not NULL, A will be ignored.
B.iep B.iep(state.iep) is a function which returns a supply coefficient matrix or a func-
tion B(state) at the iep time.
B a supply coefficient matrix or a function B(state) which returns a supply coeffi-
cient matrix. If B.iep is not NULL, B will be ignored.
SExg.iep an exogenous supply matrix or a function SExg.iep(state.iep) which returns an
exogenous supply matrix at the iep time.
InitialEndowments
a matrix indicating the initial endowments.
nPeriods.iep number of periods of the instantaneous equilibrium path.
... parameters of the function sdm.
Details
This function computes the instantaneous equilibrium path (alias market clearing path) of a dynamic
economy with the structural dynamic model (the sdm function).
iep 61
Value
a list of general equilibria.
Author(s)
LI Wu <[email protected]>
References
Acemoglu, D. (2009, ISBN: 9780691132921) Introduction to Modern Economic Growth. Princeton
University Press.
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
LI Wu (2010) A Structural Growth Model and its Applications to Sraffa’s System. http://www.iioa.org/conferences/18th/paper
Torres, Jose L. (2016, ISBN: 9781622730452). Introduction to Dynamic Macroeconomic General
Equilibrium Models (Second Edition). Vernon Press.
See Also
sdm; Example7.2
Examples
A <- function(state) {
a1 <- CD_A(
1, rbind(0.35, 0.65, 0),
c(state$p[1] * (1 + return.rate), state$p[2:3])
)
a2 <- c(1, 0, 0)
a1[3] <- state$p[1] * a1[1] * return.rate / state$p[3]
cbind(a1, a2)
}
B <- matrix(c(
1, 0,
0, 1,
0, 1
), 3, 2, TRUE)
SExg.iep <- {
tmp <- matrix(NA, 3, 2)
tmp[2, 2] <- tmp[3, 2] <- 1
tmp
}
62 iep
InitialEndowments <- {
tmp <- matrix(0, 3, 2)
tmp[1, 1] <- 0.01
tmp[2, 2] <- tmp[3, 2] <- 1
tmp
}
return(A)
}
return(A)
}
B <- diag(3)
InitialEndowments <- {
tmp <- matrix(0, 3, 3)
tmp[1, 1] <- 0.01
tmp[2, 2] <- 0.02
tmp[3, 3] <- 1
tmp
}
B <- matrix(c(
1, 1, 0,
0, 0, 1
), 2, 3, TRUE)
SExg.iep <- {
tmp <- matrix(NA, 2, 3)
tmp[2, 3] <- 1
tmp
}
InitialEndowments <- {
tmp <- matrix(0, 2, 3)
tmp[1, 1] <- tmp[1, 2] <- 0.01
tmp[2, 3] <- 1
tmp
}
## an iep of the example (see Table 2.1 and 2.2) of the canonical dynamic
## macroeconomic general equilibrium model in Torres (2016).
discount.factor <- 0.97
return.rate <- 1 / discount.factor - 1
depreciation.rate <- 0.06
A <- function(state) {
a1 <- CD_A(1, rbind(0, 0.65, 0.35, 0), state$p)
a2 <- CD_A(1, rbind(0.4, 1 - 0.4, 0, 0), state$p)
a3 <- c(1, 0, 0, state$p[1] * return.rate / state$p[4])
cbind(a1, a2, a3)
}
B <- matrix(c(
1, 0, 1 - depreciation.rate,
0, 1, 0,
0, 0, 1,
0, 1, 0
), 4, 3, TRUE)
SExg.iep <- {
tmp <- matrix(NA, 4, 3)
tmp[2, 2] <- tmp[4, 2] <- 1
tmp
}
iep 65
InitialEndowments <- {
tmp <- matrix(0, 4, 3)
tmp[1, 1] <- 0.01
tmp[2, 2] <- tmp[4, 2] <- 1
tmp[3, 3] <- 0.01
tmp
}
A <- function(state) {
a1 <- CD_A(
1, rbind(0.35, 0.65, 0),
c(state$p[1] * (return.rate + depreciation.rate), state$p[2:3])
)
a2 <- CD_A(1, rbind(0.4, 1 - 0.4, 0), state$p)
a1[3] <- state$p[1] * a1[1] * return.rate / state$p[3]
cbind(a1, a2)
}
B <- function(state) {
tmp <- matrix(c(
1, 0,
0, 1,
0, 1
), 3, 2, TRUE)
SExg.iep <- {
tmp <- matrix(NA, 3, 2)
tmp[2, 2] <- tmp[3, 2] <- 1
tmp
}
InitialEndowments <- {
tmp <- matrix(0, 3, 2)
tmp[1, 1] <- 0.01
tmp[2, 2] <- tmp[3, 2] <- 1
66 iep
tmp
}
## TFP shock in the economy above (see Torres, 2016, section 2.8).
nPeriods.iep <- 200
set.seed(1)
alpha.shock <- rep(1, 100)
alpha.shock[101] <- exp(0.01)
for (t in 102:nPeriods.iep) {
alpha.shock[t] <- exp(0.95 * log(alpha.shock[t - 1]))
}
return(A)
}
a1 <- CD_A(
alpha.shock[state.iep$time],
rbind(0.35, 0.65, 0),
c(state$p[1] * (return.rate + depreciation.rate), state$p[2:3])
iep 67
return(B)
}
SExg.iep <- {
tmp <- matrix(NA, 3, 2)
tmp[2, 2] <- tmp[3, 2] <- 1
tmp
}
InitialEndowments <- {
tmp <- matrix(0, 3, 2)
tmp[1, 1] <- tmp[2, 2] <- tmp[3, 2] <- 1
tmp
}
B <- diag(3)
SExg.iep <- {
tmp <- matrix(NA, 3, 3)
tmp[2, 2] <- 100
68 iep
InitialEndowments <- {
tmp <- matrix(0, 3, 3)
tmp[1, 1] <- 10
tmp[2, 2] <- tmp[3, 3] <- 100
tmp
}
return(cbind(
CD_A(alpha, c(0.5, 0.5), state$p),
c(1, 0)
))
}
return(A)
}
B <- matrix(c(
Leontief_mA 69
1, 0,
0, 1
), 2, 2, TRUE)
return(result)
}
InitialEndowments <- {
tmp <- matrix(0, 2, 2)
tmp[1, 1] <- 1
tmp[2, 2] <- 1
tmp
}
Description
This function computes a Leontief monetary demand coefficient matrix in a monetary economy.
Usage
Leontief_mA(A.pre, p)
70 PF_eig
Arguments
A.pre a numeric n-by-m matrix.
p a nonnegative numeric n-vector or n-by-1 matrix.
Details
Some elements of A corresponding to money equal -1.
Value
A n-by-m matrix is computed which indicates the (monetary) demand structure of agents (firms or
consumers) with Leontief production functions or utility functions under the price vector p.
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
Examples
A.pre <- matrix(c(
0.5, 1, 1,
0.1, 0, 0,
-1, -1, -1
), 3, 3, TRUE)
p <- c(1, 2, 0.1)
Leontief_mA(A.pre, p)
Description
This function computes the P-F (i.e. Perron-Frobenius) eigenvalue and eigenvector of an indecom-
posable nonnegative square matrix.
Usage
PF_eig(M)
Arguments
M an indecomposable nonnegative square matrix.
sdm 71
Value
PF_eig returns a list containing the following components:
Author(s)
LI Wu <[email protected]>
References
Horn, R. A., Johnson, C. R. (2012, ISBN: 0521548233) Matrix Analysis. Cambridge University
Press.
Examples
M<-matrix(c(0.5,1,
1, 0),2,2,TRUE)
PF_eig(M)
Description
This function computes the general equilibrium and simulates the economic dynamics. The key
part of this function is an exchange function (see F_Z), which is expounded in Li (2010, 2019).
Usage
sdm(
A,
B = diag(nrow(A)),
n = nrow(B),
m = ncol(B),
S0Exg = matrix(NA, n, m),
p0 = matrix(1, nrow = n, ncol = 1),
z0 = matrix(100, nrow = m, ncol = 1),
GRExg = NA,
moneyOwnerIndex = NULL,
moneyIndex = NULL,
pExg = NULL,
tolCond = 1e-5,
maxIteration = 200,
numberOfPeriods = 300,
depreciationCoef = 0.8,
72 sdm
thresholdForPriceAdjustment = 0.99,
priceAdjustmentMethod = "variable",
priceAdjustmentVelocity = 0.15,
trace = TRUE,
ts = FALSE,
policy = NULL,
exchangeFunction = F_Z
)
Arguments
A a demand coefficient n-by-m matrix (alias demand structure matrix) or a func-
tion A(state) which returns an n-by-m matrix.
B a supply coefficient n-by-m matrix (alias supply structure matrix) or a function
which returns an n-by-m matrix. If (i,j)-th element of S0Exg is not NA, the value
of the (i,j)-th element of B will be useless and ignored.
n the number of commodities.
m the number of economic agents (or sectors).
S0Exg an initial exogenous supply n-by-m matrix. This matrix may contain NA, but
not zero.
p0 an initial price n-vector.
z0 an m-vector consisting of the initial exchange levels (i.e. activity levels, produc-
tion levels or utility levels).
GRExg an exogenous growth rate of the exogenous supplies in S0Exg. If GRExg is NA
and some commodities have exogenous supply, then GRExg will be set to 0.
moneyOwnerIndex
a vector consisting of the indices of agents supplying money.
moneyIndex a vector consisting of the commodity indices of all types of money.
pExg an n-vector indicating the exogenous prices (if any).
tolCond the tolerance condition.
maxIteration the maximum iteration count. If the main purpose of running this function is
to do simulation instead of calculating equilibrium, then maxIteration should be
set to 1.
numberOfPeriods
the period number in each iteration.
depreciationCoef
the depreciation coefficient (i.e. 1 minus the depreciation rate) of the unsold
products.
thresholdForPriceAdjustment
the threshold for the fixed percentage price adjustment method.
priceAdjustmentMethod
the price adjustment method. Normally it should be set to "variable". If it is set
to "fixed", a fixed percentage price adjustment method will be used.
priceAdjustmentVelocity
the price adjustment velocity.
sdm 73
Details
The parameters A may be a function A(state) wherein state is a list consisting of p (the price vector),
z (the output and utility vector), w (the wealth vector), t (the time) and e (the foreign exchange rate
vector if any). state indicates the states at time t.
The parameters B also may be a function B(state) wherein state is a list consisting of p (the price
vector), z (the output and utility vector) and t (the time).
Value
sdm returns a list containing the following components:
tolerance the tolerance of the results.
p equilibrium prices.
z equilibrium exchange levels (i.e. activity levels, output levels or utility levels).
S the equilibrium supply matrix at the initial period.
e equilibrium foreign exchange rates in a multi-money economy.
growthRate the endogenous equilibrium growth rate in a pure production economy.
A the equilibrium demand coefficient matrix.
B If B is a function, the equilibrium supply coefficient matrix is returned.
ts.p the time series of prices in the last iteration.
ts.z the time series of exchange levels (i.e. activity levels, production levels or utility
levels) in the last iteration.
ts.S the time series of supply matrix in the last iteration.
ts.q the time series of sales rates in the last iteration.
ts.e the time series of foreign exchange rates in the last iteration.
policy.data the policy data.
Author(s)
LI Wu <[email protected]>
References
LI Wu (2019, ISBN: 9787521804225) General Equilibrium and Structural Dynamics: Perspectives
of New Structural Economics. Beijing: Economic Science Press. (In Chinese)
LI Wu (2010) A Structural Growth Model and its Applications to Sraffa’s System. http://www.iioa.org/conferences/18th/paper
Torres, Jose L. (2016, ISBN: 9781622730452) Introduction to Dynamic Macroeconomic General
Equilibrium Models (Second Edition). Vernon Press.
Varian, Hal R. (1992, ISBN: 0393957357) Microeconomic Analysis. W. W. Norton & Company.
74 sdm
See Also
iep; Example2.2; Example2.3; Example.Section.3.1.2.corn; Example3.1; Example3.2; Example3.4;
Example3.8; Example3.9; Example3.10; Example3.12; Example3.14; Example4.2; Example4.8;
Example4.9; Example4.10; Example4.11.1; Example4.11.2; Example4.12; Example4.13; Example4.15;
Example4.16; Example5.1; Example5.2; Example5.3.2; Example5.4; Example5.5; Example5.6;
Example5.10; Example5.11.1; Example5.11.2; Example6.2.1; Example6.2.2; Example6.3;
Example6.4; Example6.5; Example6.6.1; Example6.6.2; Example6.6.3; Example6.7; Example6.9;
Example6.10; Example6.11; Example7.1; Example7.2; Example7.3; Example7.4; Example7.5.1;
Example7.5.2; Example7.6; Example7.7; Example7.8; Example7.9X; Example7.10; Example7.10.2;
Example7.11; Example7.12; Example7.13; Example7.14; Example7.15; Example8.1; Example8.2;
Example8.7; Example8.8; Example8.9; Example9.3; Example9.4; Example9.5; Example9.6;
Example9.7; Example9.10;
Examples
## the example on page 352 in Varian (1992)
ge <- sdm(
A = function(state) {
a <- 0.5
ge$p/ge$p[1]
## the example (see Table 2.1 and 2.2) of the canonical dynamic
## macroeconomic general equilibrium model in Torres (2016).
discount.factor <- 0.97
return.rate <- 1 / discount.factor - 1
depreciation.rate <- 0.06
ge <- sdm(
n = 4, m = 3,
A = function(state) {
a1 <- CD_A(1, rbind(0, 0.65, 0.35, 0), state$p)
a2 <- CD_A(1, rbind(0.4, 1 - 0.4, 0, 0), state$p)
a3 <- c(1, 0, 0, state$p[1] * return.rate / state$p[4])
sdm 75
76
INDEX 77
Example8.8, 47, 74
Example8.9, 48, 74
Example9.10, 48, 51–55, 74
Example9.10.policy.deficit.fiscal, 49,
50, 52–55
Example9.10.policy.deflation, 49, 51, 51,
52–55
Example9.10.policy.interest.rate, 49,
51, 52, 52, 53–55
Example9.10.policy.money.supply, 49, 51,
52, 53, 54, 55
Example9.10.policy.quantitative.easing,
49, 51–53, 54, 55
Example9.10.policy.tax, 49, 51–54, 55
Example9.3, 56, 74
Example9.4, 56, 74
Example9.5, 57, 74
Example9.6, 57, 74
Example9.7, 58, 74
F_Z, 59, 71
iep, 60, 74
Leontief_mA, 69
Leontief_mA (Leontief_mA), 69
PF_eig, 70