# \donttest{
f <- function(z0 = c(20, 1)) {
ge <- sdm2(
A = function(state) {
a.firm <- CD_A(alpha = 5, Beta = c(0.5, 0.5), p = state$p)
a.consumer <- c(1, 0)
cbind(a.firm, a.consumer)
},
B = matrix(c(
1, 0,
0, 0
), 2, 2, TRUE),
S0Exg = matrix(c(
NA, NA,
NA, 1
), 2, 2, TRUE),
names.commodity = c("prod", "lab"),
names.agent = c("firm", "consumer"),
numeraire = "lab",
z0 = z0,
ts = TRUE,
policy = list(
function(state) {
state$S[2, 2] <- structural_function(state$last.z[2], c(6.5, 7), 1, 2)
state
},
policyMarketClearingPrice
),
numberOfPeriods = 20,
maxIteration = 1
)
matplot(ge$ts.z, type = "o", pch = 20)
print(ge$z)
print(ge$S)
}
f()
f(c(10,1))
# }
Run the code above in your browser using DataLab