makePolicyMeanValue: Make a Mean Value Policy Function

View source: R/makePolicyMeanValue.R

makePolicyMeanValueR Documentation

Make a Mean Value Policy Function

Description

This function returns a mean value policy function with a given span to accelerate convergence when calculating general equilibrium. We can observe the number of periods included in the economic cycle of the time series, and then set the number of periods as the parameter (i.e. span) of this function. See policyMeanValue

Usage

makePolicyMeanValue(span = 200)

Arguments

span

a positive integer. When the time index is an integer multiple of span, the mean value policy sets the current prices and supplies to the averages of the previous span-1 periods.

Value

A mean value policy function.

See Also

policyMeanValue gemDualLinearProgramming.

Examples


## See the function gemDualLinearProgramming.
A <- matrix(c(
  0, 0, 0, 1,
  8, 6, 1, 0,
  4, 2, 1.5, 0,
  2, 1.5, 0.5, 0
), 4, 4, TRUE)
B <- matrix(c(
  60, 30, 20, 0,
  0, 0, 0, 0,
  0, 0, 0, 0,
  0, 0, 0, 0
), 4, 4, TRUE)
S0Exg <- {
  S0Exg <- matrix(NA, 4, 4)
  S0Exg[2:4, 4] <- c(48, 20, 8)
  S0Exg
}

ge <- sdm2(
  A = A, B = B, S0Exg = S0Exg,
  maxIteration = 1,
  numberOfPeriods = 1000,
  ts = TRUE
)
matplot(ge$ts.q, type = "l")

ge2 <- sdm2(
  A = A, B = B, S0Exg = S0Exg,
  maxIteration = 1,
  numberOfPeriods = 1000,
  ts = TRUE,
  policy = makePolicyMeanValue(150)
)
matplot(ge2$ts.q, type = "l")


GE documentation built on Nov. 8, 2023, 9:07 a.m.

Related to makePolicyMeanValue in GE...