# NOT RUN {
## Another way to compute this equilibrium, i.e. treating money as tax receipt.
r <- 0.25
ge <- sdm(
A = function(state) {
alpha <- rbind(1, 1, 1)
Beta <- matrix(c(
0.5, 0.5, 0.5,
0.5, 0.5, 0.5
), 2, 3, TRUE)
tmp.A <- CD_A(alpha, Beta, state$p[1:2])
tmp <- apply(tmp.A, 2, function(x) sum(x * state$p[1:2]))
rbind(tmp.A, r * tmp / state$p[3])
},
B = diag(3),
S0Exg = {
tmp <- matrix(NA, 3, 3)
tmp[2, 2] <- 100
tmp[3, 3] <- 100
tmp
}
)
ge$p / ge$p[3] * r
p <- ge$p
p[3] <- p[3] / r
p / p[3]
# }
Run the code above in your browser using DataLab