Learn R Programming

GE (version 0.1.1)

gemRobinson_3_2: A Robinson Crusoe Economy

Description

Compute the general equilibrium of a Robinson Crusoe economy.

Usage

gemRobinson_3_2(dstl, endowment)

Arguments

dstl

the demand structure tree list.

endowment

the endowment 3-vector. The endowment of the product can be NA or a positive number. The endowments of labor and land should be positive numbers.

Value

A general equilibrium.

Details

A general equilibrium model with 3 commodities (i.e. product, labor, and land) and 2 agents (i.e. a firm and a consumer). The numeraire is labor.

References

http://essentialmicroeconomics.com/ChapterY5/SlideChapter5-1.pdf

http://homepage.ntu.edu.tw/~josephw/MicroTheory_Lecture_11a_RobinsonCrusoeEconomy.pdf

Examples

Run this code
# 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