# NOT RUN {
#### a general equilibrium model with 2 basic commodities (i.e. labor and land) and 1 agent
dst.Robinson <- node_new("util",
type = "CD", alpha = 1, beta = c(0.5, 0.5),
"prod", "lab"
)
node_set(dst.Robinson, "prod",
type = "CD", alpha = 8, beta = c(0.5, 0.5),
"lab", "land"
)
node_plot(dst.Robinson)
ge <- sdm2(
A = list(dst.Robinson),
names.commodity = c("lab", "land"),
names.agent = c("Robinson"),
B = matrix(0, 2, 1),
S0Exg = matrix(c(
12,
1
), 2, 1, TRUE),
numeraire = "lab"
)
ge
## the same economy as above
dst.Robinson <- node_new("util",
type = "CD", alpha = 1, beta = c(0.5, 0.5),
"prod", "lab"
)
dst.firm <- node_new("output",
type = "CD", alpha = 8, beta = c(0.5, 0.5),
"lab", "land"
)
dstl <- list(dst.firm, dst.Robinson)
ge <- gemRobinson_3_2(dstl, endowment = c(NA, 12, 1))
ge
## another example
dst.firm$alpha <- 1
ge <- gemRobinson_3_2(dstl, endowment = c(3, 144, 1))
ge
#### a Robinson Crusoe economy with labor and two types of land
dst.Robinson <- node_new("util",
type = "CD", alpha = 1, beta = c(0.5, 0.5),
"prod1", "prod2"
)
node_set(dst.Robinson, "prod1",
type = "CD", alpha = 1, beta = c(0.2, 0.8),
"lab", "land1"
)
node_set(dst.Robinson, "prod2",
type = "CD", alpha = 1, beta = c(0.8, 0.2),
"lab", "land2"
)
node_plot(dst.Robinson)
dstl <- list(dst.Robinson)
ge <- sdm2(dstl,
names.commodity = c("lab", "land1", "land2"),
names.agent = c("Robinson"),
B = matrix(0, 3, 1),
S0Exg = matrix(c(
100,
100,
100
), 3, 1, TRUE),
numeraire = "lab"
)
ge
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab