Description Usage Arguments Details Value Author(s) References See Also Examples
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).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 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,
thresholdForPriceAdjustment = 0.99,
priceAdjustmentMethod = "variable",
priceAdjustmentVelocity = 0.15,
trace = TRUE,
ts = FALSE,
policy = NULL,
exchangeFunction = F_Z
)
|
A |
a demand coefficient n-by-m matrix (alias demand structure matrix) or a function 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, production 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. |
trace |
if TRUE, information is printed during the running of sdm. |
ts |
if TRUE, the time series of the last iteration are returned. |
policy |
a policy function. |
exchangeFunction |
the exchange function. |
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).
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. |
LI Wu <liwu@staff.shu.edu.cn>
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/papers/files/104_20100729011_AStructuralGrowthModelanditsApplicationstoSraffasSstem.pdf
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.
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
;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | ## the example on page 352 in Varian (1992)
ge <- sdm(
A = function(state) {
a <- 0.5
alpha <- rep(1, 3)
Beta <- matrix(c(0, a, a,
0.5, 0, 0,
0.5, 1 - a, 1 - a), 3, 3, TRUE)
#the demand coefficient matrix.
CD_A(alpha, Beta, state$p)
},
B = diag(3),
S0Exg = matrix(c(NA, NA, NA,
NA, 1, NA,
NA, NA, 1), 3, 3, TRUE),
GRExg = 0,
tolCond = 1e-10
)
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])
cbind(a1, a2, a3)
},
B = matrix(c(
1, 0, 1 - depreciation.rate,
0, 1, 0,
0, 0, 1,
0, 1, 0
), 4, 3, TRUE),
S0Exg = {
tmp <- matrix(NA, 4, 3)
tmp[2, 2] <- 1
tmp[4, 2] <- 1
tmp
},
priceAdjustmentVelocity = 0.03,
maxIteration = 1,
numberOfPeriods = 5000,
ts = TRUE
)
ge$A %*% diag(ge$z) # the demand matrix
ge$p / ge$p[1]
plot(ge$ts.z[, 1], type = "l")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.