| osr | R Documentation |
Optimises the coefficients of a user-specified policy rule to minimise an unconditional quadratic welfare loss, subject to the model's rational expectations equilibrium.
osr(
model,
params,
shock_sd,
osr_params,
welfare_weights,
lower = NULL,
upper = NULL,
method = "L-BFGS-B",
control = list(),
penalty = 1e+10
)
model |
A |
params |
Named numeric vector of model parameter values. Must
contain entries for every free parameter and structural parameter
that |
shock_sd |
Named numeric vector of shock standard deviations. |
osr_params |
Named numeric vector. Names are the parameters to
optimise (must be in |
welfare_weights |
A named list with elements
Each weight may be supplied either as a square matrix (rows/columns in state/control order) or as a named numeric vector (interpreted as the diagonal of the corresponding matrix). |
lower, upper |
Numeric vectors of lower/upper bounds for the
parameters being optimised. Default |
method |
Optimisation method passed to |
control |
List of control options passed to |
penalty |
Numeric. Penalty value returned when the candidate
parameter vector yields a non-existent or unstable equilibrium.
Default |
ramsey_policy()ramsey_policy() computes the fully flexible commitment-optimal
policy: it is the lower bound on welfare loss subject only to the
model's equilibrium conditions. osr() restricts the policy to a
parametric family (e.g. a Taylor rule r_t = \phi_\pi \pi_t + \phi_y x_t)
and optimises within that family. The gap between Ramsey and OSR loss
is the welfare cost of restricting to simple rules.
An object of class "dsge_osr" containing:
optimalNamed numeric vector of optimal parameter values.
lossAchieved welfare loss at the optimum.
loss_at_startLoss at the starting values, for comparison.
convergedLogical (TRUE if optim returned
convergence == 0).
n_iterIteration counts reported by optim.
paramsFull parameter vector at the optimum.
weightsThe welfare weight matrices used (with rows/cols named).
solutionThe dsge_solution object at the
optimum.
messageOptional diagnostic message from optim.
ramsey_policy, welfare_loss
nk <- dsge_model(
obs(p ~ beta * lead(p) + kappa * x),
unobs(x ~ lead(x) - (r - lead(p) - g)),
obs(r ~ psi * p + u),
state(u ~ rhou * u),
state(g ~ rhog * g),
fixed = list(beta = 0.99),
start = list(kappa = 0.1, psi = 1.5, rhou = 0.7, rhog = 0.9)
)
res <- osr(nk,
params = c(kappa = 0.1, psi = 1.5, rhou = 0.7, rhog = 0.9),
shock_sd = c(e.u = 1.0, e.g = 0.5),
osr_params = c(psi = 1.5),
welfare_weights = list(Q_xx = c(u = 0, g = 0),
Q_yy = c(p = 1, x = 0.5, r = 0.1)),
lower = 1.01, upper = 5.0)
print(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.