# \donttest{
stickiness <- 0.1 # 0.5
ge <- sdm2(
A = function(state) {
a.firm <- CD_A(alpha = 2, Beta = c(0.5, 0.5), state$p)
if (1.25 * state$p[2] < state$p[1]) {
a.consumer <- c(0, 1)
} else {
a.consumer <- c(1, 0)
}
a.consumer <- state$last.A[, 2] * stickiness + a.consumer * (1 - stickiness)
cbind(a.firm, a.consumer)
},
B = matrix(c(
1, 0,
0, 0
), 2, 2, TRUE),
S0Exg = matrix(c(
NA, NA,
NA, 100
), 2, 2, TRUE),
names.commodity = c("prod", "lab"),
names.agent = c("firm", "laborer"),
numeraire = "prod",
z0 = c(80, 100),
maxIteration = 1,
numberOfPeriods = 100,
ts = TRUE
)
matplot(ge$ts.z, type = "o", pch = 20)
# }
Run the code above in your browser using DataLab