Given a stickiness value and a time window vector, this function returns a policy function that sets the current prices equal to the weighted mean of the market-clearing prices and the current prices during this time window. When the stickiness value is 0, the prices will be set to the market-clearing prices. When the stickiness value is 1, the current prices will keep unchanged.
makePolicyStickyPrice(stickiness = 0.5, time.win = c(1, Inf), tolCond = 1e-06)
A policy function, which is often used as an argument of the function sdm2.
a stickiness value between 0 and 1.
the time window vector, i.e. a 2-vector specifying the start time and end time of policy implementation.
the tolerance condition for computing the market-clearing price vector.
sdm2
# \donttest{
InitialEndowments <- {
tmp <- matrix(0, 3, 2)
tmp[1, 1] <- 0.01
tmp[2, 2] <- tmp[3, 2] <- 1
tmp
}
ge <- gemCanonicalDynamicMacroeconomic_3_2(
priceAdjustmentFunction = function(p, q) p,
policy.supply = makePolicySupply(InitialEndowments),
policy.price = makePolicyStickyPrice(stickiness = 0.5),
ts = TRUE,
maxIteration = 1,
numberOfPeriods = 50
)
par(mfrow = c(1, 2))
matplot(ge$ts.z, type = "o", pch = 20)
matplot(ge$ts.p, type = "o", pch = 20)
# }
Run the code above in your browser using DataLab