Coming from MATLAB/IRIS and Dynare¶
In the app: Help → Help contents, Coming from MATLAB/IRIS and Dynare.
pymetrix reads IRIS and Dynare model files and works with them the way those toolboxes do: steady state, solution, simulation, the Kalman filter and smoother, estimation and posterior simulation, forecasts and decompositions. MATLAB is not needed. Find anything (Ctrl+K) knows the familiar names: type sstate, stoch_simul or estimated_params and it offers the pymetrix command.
The objects¶
- IRIS
modelobject:read_irisreads a .model file into a template, with its measurement equations and shock sizes (thestd_parameters); a Dynare .mod file read byread_modgives a model that works the same way. Parameters set in code in IRIS are given withparams=. sstateandsolve:nk.steady_state()andsol = nk.solve();sol.rules()shows the decision rules.simulatewith a Plan: a Scenario on the solution, with shock paths and targets held by free shocks (IRIS's exogenize and endogenize).filter: the Kalman filter and smoother, on the solution or through the estimated model.estimate: maximum likelihood or the posterior mode, then Metropolis-Hastings or sequential Monte Carlo for the posterior.- Databank: a Dataset, one frequency, series as columns; dates are written
"2020Q1", not qq(2020,1). Series(tseries): a column of a Dataset, a pandas Series indexed by period.- Reports: the report outline (View → Report) and Report in code, saved as Word, HTML, Excel or Markdown.
Commands and menus¶
In the Python column, nk is a model read from an IRIS file (or a template), sol its solution, est the estimated model, mod a model read from a Dynare file and data a Dataset. The Dynare rows give Dynare's command, block or option.
| Familiar | In the app | In Python |
|---|---|---|
IRIS model: read a model file |
Model → Import → IRIS file… | nk = read_iris("nk.model") |
IRIS sstate, chksstate: the steady state |
Model → Check model… | nk.steady_state() |
IRIS solve: the first-order solution |
Model → Solution → Rational expectations… | sol = nk.solve() |
IRIS srf: shock responses |
Model → Solution → Rational expectations… | sol.irf(20) |
IRIS fevd: variance decomposition |
(code only) | sol.fevd(20) |
IRIS simulate, plan, exogenize, endogenize: simulate, with a plan |
Model → Solution → Solve model… | sol.solve(data, ("2025Q1", "2026Q4"), scenario=Scenario(shift={"ey": 1.0})) |
IRIS filter: Kalman filter and smoother |
Model → Analysis → Kalman filter… | sol.filter(data, nk.measurement, nk.shock_sd) |
IRIS estimate: estimate parameters |
Model → Estimation → Estimate model… | est = nk.estimate(data, estimate=["kappa", "rho"]) |
IRIS arwm: posterior simulation |
Model → Estimation → Metropolis-Hastings… | est.mcmc(draws=10000) |
IRIS jforecast: forecast |
Model → Analysis → Forecast from estimated model… | est.forecast(("2025Q1", "2026Q4")) |
IRIS contributions: shock decomposition |
Model → Analysis → Shock decomposition… | est.decompose() |
IRIS acf: theoretical moments |
(code only) | est.moments() |
IRIS sspace: state-space matrices |
Model → Analysis → State-space form… | sol.system |
IRIS dbload, databank: read a databank |
File → Load data… | data = Dataset.read("data.csv", time="date", freq="Q") |
IRIS dbsave: save a databank |
(code only) | data.write("data.csv") |
IRIS Series, tseries: a time series |
Data → Spreadsheet editor… | data["y"] |
IRIS hpf: Hodrick-Prescott filter |
Data → Transform → Filter (trend and cycle)… | data.filter("y", HP()) |
IRIS x13: X-13ARIMA-SEATS seasonal adjustment (the pymetrix-seasonal plugin) |
Data → Transform → Seasonal adjustment… | data.seasonal_adjust("c", pymetrix_seasonal.X13()) |
IRIS rephrase, reporting: reports |
View → Report | Report("Forecast round").add(est).save("round.html") |
Dynare mod, dynare: read a .mod file |
Model → Import → Dynare file… | mod = read_mod("nk.mod") |
Dynare steady, check: steady state, Blanchard-Kahn |
Model → Check model… | mod.steady_state() |
Dynare stoch_simul: first-order solution and responses |
Model → Solution → Rational expectations… | mod.solve().irf(20) |
Dynare order=2: second-order solution |
Model → Solution → Second-order solution… | mod.solve(order=2) |
Dynare order=3: third-order solution |
Model → Solution → Second-order solution… | mod.solve(order=3) |
Dynare estimated_params, estimation, varobs: estimate the model |
Model → Estimation → Estimate model… | est = mod.estimate() |
Dynare mh_replic: Metropolis-Hastings |
Model → Estimation → Metropolis-Hastings… | est.mcmc(draws=20000) |
Dynare smc, hssmc: sequential Monte Carlo |
Model → Estimation → Sequential Monte Carlo… | est.smc() |
Dynare dsge_var: DSGE-VAR |
Model → Estimation → Estimate DSGE-VAR… | mod.dsge_var() |
Dynare calib_smoother: Kalman smoother |
Model → Analysis → Kalman filter… | mod.solve().filter(data, ["y", "pi", "i"], mod.shock_sd) |
Dynare forecast: forecast |
Model → Analysis → Forecast from estimated model… | est.forecast(("2025Q1", "2026Q4")) |
Dynare shock_decomposition: shock decomposition |
Model → Analysis → Shock decomposition… | est.decompose() |
Dynare identification: identification |
Model → Analysis → Identification… | est.identification() |
Dynare dynare_sensitivity: prior stability mapping |
Model → Analysis → Stability mapping… | stability_mapping(mod, draws=2000, seed=1) |
Dynare osr: optimal simple rule |
Model → Policy → Optimal simple rule… | osr(mod, ["phi_pi", "phi_y"], {"pi": 1.0, "y": 0.25}) |
Dynare ramsey_model, discretionary_policy: optimal policy |
Model → Policy → Optimal policy… | optimal_policy(mod, "i", {"pi": 1.0, "y": 0.25}) |
Dynare occbin_solver: occasionally binding constraints |
Model → Solution → Occasionally binding constraints… | occbin(mod, {"ey": {1: -3.0}}) |
Dynare perfect_foresight_solver, simul: perfect foresight |
Model → Solution → Solve model… | model.solve(data, ("2020Q1", "2024Q4"), solver=PerfectForesight()) |
Defaults that differ¶
Responses of log variables are log deviations, as in IRIS. Priors are given by mean and standard deviation, as in Dynare. Other differences from other packages are in Defaults, and other packages' defaults.
Different by design¶
- Every step is recorded. Each dialog runs one line of Python, listed in the History and Script windows; File → Export script… saves them as a script that runs in plain Python.
- Results are objects. A solution, an estimate or a posterior is kept under a name, with the settings and data that made it.
- Undo. Edit → Undo (Ctrl+Z) takes back the last dialog step;
session.undo()in code. - Projects rebuild. A project saves the data and the steps and recomputes the results when opened.
Bringing models across¶
read_iris reads .model files (with !for loops, !substitutions and !dtrends), read_mod reads .mod
files (the macro processor, steady_state_model, shocks, estimated_params, varobs and the estimation
options); commands in the file are listed, not run. In the app: Model → Import → IRIS file… and
Model → Import → Dynare file…. Model → Model editor… reads pymetrix's syntax, Dynare's, IRIS's and EViews's,
and its Write as button translates a model into another (Model → Export model…; export_model in code), with
notes on what does not carry across and a check that it solves the same. Data: a databank saved as CSV
(databank.toCSV, dbsave) loads with File → Load data… once the rows of classes and units under the names
are taken out (skiprows=[1, 2] in code); .mat databanks are not read.