How do I…¶
Task pages: each takes one task from start to finish, in the app and in code, says how to check the result, and what goes wrong. The rest of the documentation is mostly reference: the user guide by feature, the help topics by dialog or idea, the course notebooks as lessons, and the case studies as guided labs. A task page starts from what the reader wants done and points into those.
This page is the plan: the pages, the template they follow, how readers reach them, and where they live.
The pages¶
All twenty are written:
- Estimate an equation and test its residuals
- Load data with Browse series (FRED, IMF, ECB, Eurostat, World Bank)
- Estimate a VAR, then impulse responses and a forecast
- Bring an IRIS or Dynare model across, then check and solve it
- Run a forecast round: baseline, judgement, scenarios, report
- Save, reopen and share a project, and replay its script
- Test for cointegration in a short annual sample
- Seasonally adjust a series
- Bring an EViews model across, then check and solve it
- Run a script in the app
- Make a report
- Check a forecast's record (backtest)
- Solve a large backward-looking model
- Reconcile national accounts components to a total
- Translate an EViews program (the
pymetrix-eviewsplugin) - Nowcast GDP
- Estimate the effect of a policy change like a VAT increase
- Check whether a result survives other specifications
- Make a surveillance heatmap
- Evaluate early-warning signals of crises
- Assess debt sustainability (the
pymetrix-fiscalplugin)
The list, by priority: the tasks most readers meet first, then those of one audience. Audiences: new (new to pymetrix and to econometrics software), EViews (experienced EViews users), IRIS/Dynare (MATLAB users of IRIS or Dynare), code (people who work in Python first), forecasters (forecast rounds in an institution).
| # | Task | Audience | Starts from | Status |
|---|---|---|---|---|
| 1 | Estimate an equation and test its residuals | new, EViews | Estimate → Equation… | written |
| 2 | Load data with Browse series (FRED, IMF, ECB, Eurostat, World Bank) | new, everyone | File → Browse series… | written |
| 3 | Estimate a VAR, then impulse responses and a forecast | EViews, IRIS/Dynare | Estimate → VARs and local projections → VAR… | written |
| 4 | Bring an IRIS or Dynare model across, then check and solve it | IRIS/Dynare | Model → Import → IRIS file… | written |
| 5 | Run a forecast round: baseline, judgement, scenarios, report | forecasters | Forecast → Make round… | written |
| 6 | Save, reopen and share a project, and replay its script | everyone, code | File → Save project | written |
| 7 | Test for cointegration in a short annual sample | EViews, applied macro | Test → Run test… | written |
| 8 | Seasonally adjust a series | new, EViews | Data → Transform → Seasonal adjustment… | written |
| 9 | Bring an EViews model across, then check and solve it | EViews | Model → Model editor… | written |
| 10 | Run a script in the app | code, EViews (programs) | File → Open script… | written |
| 11 | Make a report | everyone | View → Report | written |
| 12 | Check a forecast's record (backtest) | forecasters | Forecast → Backtest… | written |
| 13 | Solve a large backward-looking model | forecasters, EViews | Model → Solution → Solve model… | written |
| 14 | Reconcile national accounts components to a total | forecasters | Data → Transform → Reconcile components… | written |
| 15 | Translate an EViews program (the pymetrix-eviews plugin) |
EViews | File → Translate EViews program… | written |
| 16 | Nowcast GDP | forecasters | Estimate → Mixed frequency → Dynamic factor model (nowcasting)… | written |
| 17 | Estimate the effect of a policy change like a VAT increase | forecasters, policy analysts | Estimate → Model selection → Indicator saturation (outliers and breaks)… | written |
| 18 | Check whether a result survives other specifications | applied macroeconomists, policy analysts | Estimate → Model selection → Specification sensitivity… | written |
| 19 | Make a surveillance heatmap | forecasters, policy analysts | Data → Statistics → Surveillance heatmap… | written |
| 20 | Evaluate early-warning signals of crises | financial stability analysts, forecasters | Forecast → Evaluate early-warning signals… | written |
| 21 | Assess debt sustainability (the pymetrix-fiscal plugin) |
fiscal and debt analysts | Fiscal → Debt profile… | written |
Notes on the list:
- Early-warning signals (20) are added for financial stability and macroprudential analysts: which indicators would have warned of crises in time, at what cost in false alarms. The page joins the pre-crisis windows, the AUROC with DeLong and country-bootstrap intervals, the threshold a policymaker's loss picks and the noise-to-signal one, the share of crises called and the lead time, and a logit of several indicators evaluated as one more.
- A surveillance heatmap (19) is added for forecasters and policy analysts: the chart of many indicators at once, each reading coloured by how unusual it is, that central banks and the IMF publish. The page joins the derived growth rates, k-means regimes (with the number of clusters chosen first), the heatmap with groups, flips, percentile ranks over a rolling window and clustered rows, and its latest snapshot; its code adds the saved spec redrawn, a fixed reference period and a report with coloured cells.
- Whether a result survives (18) is added for applied macroeconomists and policy analysts: a conclusion drawn from one VAR (output falls after a tightening) is checked across lag lengths, samples and Cholesky orderings, with the specification curve and the choice that moves the response most. Its data are made on the page from shocks drawn with seeds, so the true response is known.
- A policy change (17) is added for forecasters and policy analysts: finding a break, splitting an effect into its temporary and persistent parts and forecasting as it unwinds come up after every tax or policy change, and the page joins indicator saturation, transfer functions and forecasts, which are documented apart.
- EViews models apart from IRIS and Dynare (9). The route differs: the model editor reads an EViews model's text or program, and an EViews state-space object comes through Model → Import → EViews state-space object…. One page for both would branch at every step.
- Backtest (12) is added to the candidates: forecasters ask it right after a round, and its pitfalls (the sample each forecast may use, revised data) are not in one place now.
- Solve a large model (13) was written before the template, as
docs/solving-large-models.md, with a help topic of its own that summarised it (large-model-solution). It now has the template's sections and lives beside the others; the summary topic is gone, and the help shows the page itself (howto-solve-a-large-backward-looking-model). - Nowcast GDP (16) is added with the nowcasting models' bands and block factors: the data as known on a day, the factor model with global, real and survey blocks, the nowcast with its interval, and the news of the next figures. Its news step is typed in View → Immediate, since no dialog updates a model with newer data yet. Its Pitfalls point to the nowcast backtest by release day, the tracking chart through the quarter and the real-time tools (vintages, release calendars), and its code has a growth-at-risk section (a quantile bridge's backtest).
- Translate an EViews program (15) is added, for EViews users with programs. Its task is a plugin's
(
pymetrix-eviews), but the page is here, in the core package, with the others: the reader who needs it most is the one who does not know the plugin exists, and finds the page in Help → How do I… or with Ctrl+K before installing anything. Its front matter names the plugin (plugin: pymetrix-eviews), the index says the task needs it, and the page starts by saying how to install it. One source and one test module stay: the page's code runs where the plugin is installed and is skipped where it is not (the core-only run), its menu paths are checked where the plugin is installed (the paragraphs name it), and it links no help topic of the plugin's, so the core help has no link it cannot follow. A page in the plugin's package would appear only once the plugin is installed, and would need the index to gather pages from plugins.
The template¶
Each page, in this order:
# Title: the task as the reader would say it ("Estimate an equation and test its residuals").- Goal: the first paragraph, no heading. What is done and why, in two or three sentences.
- Before you start: the data or files needed (always ones shipped with pymetrix, or written out on the page, so the page runs as written), and the decisions to make first.
- In the app: numbered steps. Menu paths as the menus show them (Estimate → Equation…); fields by the label
the dialog shows and the value to give (Formula:
dlog(c) ~ dlog(y), Standard errors: HAC (Newey-West)); the views of the result to read. Choices as the dialog words them, not their codes. - In code: the same steps as one script, in blocks that run in order. Comments give the numbers the page quotes.
- Check the result: what to look at, with the numbers to expect on the page's data, and what to compare with another package.
- Pitfalls: one bold sentence each, then why and what to do.
- See also: help topics (as
pymetrix:topic/...links), other task pages, and the guide's reference sections.
House style as elsewhere: plain, precise, short sentences; no marketing; menu paths written Menu → Item….
Front matter gives each page a summary (one line for the index), its audience and its order in the index. A
file a page's code reads is shown in a fenced block whose info string is text <file name>.
How readers reach the pages¶
- Help → How do I… opens the index: each page with its summary and audience.
- Help contents list them in a section of their own, first.
- Ctrl+K (View → Find anything…) finds each page by any words of its title: the palette lists every page of
the help contents (
ui/palette.py, fromhelp.contents()), so a page is found once it is a help topic, with no separate registration. "residuals", "cointegration short", "dynare" and "how do i" find them. - Help search finds them by any words of their text, as it finds every topic.
- Next ▸. A result's Next ▸ menu (
ui/next_steps.py) offers the next dialogs for its type and then, after a separator, the task pages that carry on from that type ("How do I… Estimate a VAR, then impulse responses and a forecast"), each opening its help topic. The pages are a table,NEXT_PAGES, by type; a test checks that each page it names exists and that its steps open one of the type's next dialogs or the dialog that makes such a result. - Dialog help. A dialog's help page has a "How do I…" section listing the task pages whose In the app steps open
it, found from the menu paths each page writes (
howto.dialogs), so the list follows the pages with nothing to keep in step. File → Load example data… is left out: most pages open it only to have data.
One source: Markdown files in the package¶
The pages are Markdown files in src/pymetrix/howto/, and nowhere else:
- The help shows them as they are.
pymetrix.howtoreads the files when the help loads and registers each as a help topic (howto-<file name>) and an index topic (how-do-i). For the help, links between pages become help links,pymetrix:links stay, and links to the repository's documents become their text. - GitHub shows them as they are. This page links to them;
pymetrix:links show as their text there. - The wheel has them. Files under
src/pymetrixare in the wheel, as the example datasets are, so the help of an installed copy has the pages with no build step. Files underdocs/are not in the wheel, so pages there would need a copy in the package (generated, and checked to match) or a build rule, and two places to look. - Not help topics written in Python. Topics in
help.pyare strings in code: long pages with code blocks are hard to edit there, and GitHub would not show them. - Not a course. Course folders (
help.load_course) are Markdown too, but a course is the user's, loaded from a folder and kept with a project; the task pages are pymetrix's own. The front matter reader is shared.
The tests¶
tests/test_how_do_i.py:
- every page has the template's sections in order, and front matter;
- every page's code runs as written, its blocks in order, with its
textfiles written out first, and gives the numbers the page quotes; - the steps in the app give the same results as the code: each step is run as the dialog's command, with the values the page names, and each field label the page names is checked against the dialog's own;
- every link resolves (files, anchors' files, help topics), and the help's copy has no link it cannot follow;
- Help → How do I… opens the index, the contents list the pages first, and Ctrl+K finds each page.
tests/test_docs_menu_paths.py checks every menu path on the pages and on this plan against the menu bar.
Found while writing the first pages¶
- Check model… did not take an imported model. Its Equations list showed fitted equations and identities only,
so an IRIS or Dynare model could not be chosen, though the "Coming from MATLAB/IRIS and Dynare" table sends
sstate,chksstate,steadyandcheckto Model → Check model…. Since 0.1.0a17 it lists every whole model and checks an imported one with its own shocks and steady-state guesses, so the page no longer has that pitfall. - Help text named a submenu that moved. Four places (the help of Model → Import → IRIS file…, Model → Template model… and Model → Analysis → Kalman filter…, and the shock decomposition topic) said "Model > State space > …"; the submenu is Model → Analysis now, and they say so. The menu-path test checks paths written with "→" only, so paths written with ">" in the help are not checked: writing them with "→", or teaching the test ">", would catch the next move.
- "Mackinnon". The Critical values choice read "Mackinnon"; it now reads "MacKinnon (asymptotic)", and the other choice "Simulated for this sample".
Found while writing the rest¶
- Help text named fields by old labels. The help on solving models, and the docstrings of Solve model…, Add factors… and Import FRB/US XML file…, said "Partial" for Hold only where given, "Errors: sample" for Error draws: The data's residuals, "Workers" for Parallel processes, and "Model > Solve model" or "Model > Add factors" for the entries now under Model → Solution (as did the Forecast… and Compare scenarios dialogs' help). They use the dialogs' own words now. Labels inside help text are not checked by any test; the menu-path test reads "→" only.
- STL's trend length read "Deterministic terms". The shared label for fields named
trend(a VAR's or a unit-root test's constant and trend) was given to STL's trend smoother length, under Seasonal adjustment…'s Method settings; it reads Trend length now. - A dataset loaded from a connector was not kept in the project. A project kept the data of files it loaded, but File → Load from connector… ran again when the project opened, so the data could come back revised. Since then the project keeps it as read, and File → Refresh data… reads it again on request; the pages say so.