Browse documentation
Docs/Functionality

Computational economics starters

Use these synthetic teaching models to turn assumptions into inspectable results and saved scenarios. They accompany the 0.66.5 development changes and require a matching application build.…

Computational economics starters

Use these synthetic teaching models to turn assumptions into inspectable results and saved scenarios. They accompany the 0.66.5 development changes and require a matching application build. They do not contain estimates of an actual policy or predictions for an observed economy.

Choose a workflow

Open Models → Templates and search for the starter title. Its source is also available below. Open I/O to see declared inputs, result status and assumptions. Use Jump to and Pop out to inspect an array or complete regression table.

For object inputs, select Edit structured value in I/O. For a text or mixed array, select Open array editor. Edit the JSON draft and select Save value; invalid JSON stays local. These input edits preserve the value type and authored default. Undo, Redo, and Reset operate on the saved override. Numeric arrays can still be edited directly in the inline field.

Starter Inputs to explore Results to review
Tax and redistribution policy Unit tax and revenue share returned to households Buyer/seller prices, quantity, revenue, surplus loss, Gini, poverty gap and three accounting checks
Inference and difference-in-differences Confidence level and the synthetic treatment effect Four covariance conventions, labeled coefficient tables, DID uncertainty and identification assumptions
Macro forecast holdout AR forecast weight and an origin growth shock Calendar growth, fixed training/holdout dates, point forecasts, training-mean benchmark, RMSE and MAE

Readable cells include declared outputs and worksheet cells. The count beside Shown results describes that visible selection; it is not a count of distinct economic findings. Filtering changes the selection. Inspect failed results before interpreting the remaining numbers.

Named results belong to the model, worksheet and revision that requested them. After switching models or changing an input or source, a delayed refresh from the previous context cannot replace the current named results. This also applies to I/O and reactive app surfaces. Reopening a model starts a new view; a reply from its earlier opening cannot replace the values in that view. After an accepted source edit, named results reload for that source, including results that were previously ready or failed. A matrix-shape error must replace the old coefficients and dimensions in the named grid and I/O, including in another open session. This protection does not make external data reproducible; retain the inputs used for a finding.

When opening models or templates from the library, your latest selection takes precedence. A slower earlier open, template download or model-creation reply cannot replace that choice or overwrite its status with an old error. This also protects two models that share source but retain different input assumptions. Leaving the folder or workspace supersedes pending opens. A model already created by the server remains available even if you switch away before its reply arrives. This does not save unsaved drafts; save or copy work you need to retain.

After a library rename or deletion is confirmed, an older background summary cannot restore the old name or put the deleted analysis back in the list. Leaving that model-opening context also discards its pending summary refresh.

A bundled starter that is still loading also belongs to its original New-model choice. Opening a saved scenario abandons that pending starter: its later source, Experience and default sizing cannot be applied to the saved scenario. Experience setup follows the model it was chosen for, including while a new template is being created. A starter load failure is shown only while that starter is current.

Save a reviewable scenario

  1. Inspect the baseline and its checks. Enter a new assumption in I/O and move focus out of the input to apply it. A saved override changes the effective input; the source default remains visible.
  2. Open Saved scenarios, name the current assumptions and select Save scenario. For an input-only scenario, leave Results to capture empty.
  3. Select Save for the Grid document. The named scenario is a file inside that document and travels with its .gridoc export.
  4. Use Reset all inputs to source defaults, review the affected inputs and confirm Reset inputs. Reopen the saved scenario, choose Preview restore, review its input changes and select Restore scenario inputs.
  5. Save the restored document. When reopening or importing the exported document, check its effective inputs, result status and accounting/identity outputs.

After moving from Author to an I/O input, typing stays with the focused field. Enter or leaving the field commits its latest text; Escape cancels the draft. A source-change notice reports the last checked count of stored input overrides. Select Review inputs to inspect them before deciding whether to reset. If the count cannot be verified, Retry inspection checks it again without changing the scenario.

For a concrete policy scenario, change UnitTax from 10 to 20 and RedistributionShare from 0.5 to 0.75. Revenue becomes 880, retained government revenue 220 and surplus loss 240. A tax of −1 is rejected; the previous valid inputs and results remain. Reset returns revenue to 560 and surplus loss to 60.

Scenario restoration checks the source identity and declared package versions. It does not capture an external data feed or guarantee identical results across runtime versions. A source mismatch requires restoring the matching source before applying the scenario. These starters are self-contained and have no external data dependency.

If you remove a named input from the source, its saved value remains dormant in the document. It does not affect a replacement input or prevent inspecting the remaining results. Restoring that name restores its saved value. To discard the old assumption, choose Reset all inputs to source defaults and review the removed input in the preview. After Reset, adding the name again uses its source default. Undo cannot restore a value to a name that is still absent.

When editing model source, Source retained · calculation unavailable means the app confirmed the server's source revision but could not load its results. Your local draft remains in the editor. After the reported runtime problem is resolved, select Save with that source unchanged to retry calculation. Matching source text alone does not clear this warning, and Grid does not automatically keep saving the same failed source. If the app says it could not confirm the server source, copy any unsaved changes before reopening the model. Save waits for an explicit reopen instead of replacing or archiving an uncertain source. Reopening confirms matching source metadata and reloads calculations; a failed confirmation keeps the draft, while a failed result reload keeps the calculation warning. Review loaded result errors and accounting checks before interpreting recovered numbers.

Input refreshes reuse a complete, confirmed worksheet read when updating the view. Incomplete replies still leave the missing results to load. If the input was accepted but its confirmation read fails, Input state retained · calculation unavailable means the assumption and its Undo entry are retained. After resolving the runtime problem, select Save to reload results before archiving, or use Undo to restore the previous assumption.

Known worksheet cells without results show Stale for a stale tile or #LOAD! for a failed load. Unknown coordinates remain … until their tile loads; they are not reported as failed results or confirmed empty cells. A source-calculation failure, including unconfirmed source, marks authored and named values #LOAD!, even after the tile cache is cleared. Background values remain hidden in the grid and Cell inspector until recovery completes. Failed, pending and stale blank snapshots keep their result status instead of displaying a source default. Active editor drafts remain editable, and recovered values replace these unavailable markers.

Input state retained · calculation unavailable means an input edit or reset was accepted, but its results could not be refreshed. The change keeps its Undo entry. After resolving the reported problem, select Save to reload results before archiving, or use Undo to restore the previous input state. I/O shows zero ready results during this recovery; its value fields are unavailable and any unfinished field draft is retained. Successful recovery restores the values and input-override inspection. A rejected input request does not gain a successful edit or an Undo entry.

An open cell popout also withholds unavailable results and regression-table exports. Your local input draft survives background refreshes and missing snapshots. If the input or model changes while you edit, copy the draft if needed, then choose Replace draft with current input before saving another edit. Dated-series previews are invalidated during recovery; review a fresh preview after the input becomes available. Close the dialog to use the model's Save recovery action. Closing discards the local popout draft.

For ordinary cell values, Save value keeps the dialog open until the cell write, required source update and result refresh are confirmed. While saving, duplicate saves and closing are disabled. If confirmation fails, the draft stays open with an explanation; a retained edit keeps its Undo entry. Close the dialog and use model Save when recovery is required. A changed model or newer edit cannot close an older dialog as a successful save. Cell-value confirmation is separate from the model's archive checkpoint.

Multiline text remains editable after saving. Its source representation preserves the entered newlines and trailing whitespace, so recompilation, Undo/Redo and archive reopening do not gain formatting newlines. Existing text is not trimmed or migrated automatically; inspect and edit any previously saved unwanted padding.

Cell and formula edits already queued in the current editor pause with their drafts and Undo entries retained. Save confirms the server revision before resuming those edits, including their changes to cells and pasted ranges. It uses the latest source draft and reloads calculation. If a queued draft is rejected, Save does not report the older restored model as a successful save of that draft. A conflicting or unconfirmed server revision requires review before queued edits can resume.

Archive save not confirmed is a separate notice: the source for that save was accepted, but Grid could not confirm its archive checkpoint. The notice stays visible in the current model session, with Error details and Retry Save. Retry saves your latest changes through the normal Save flow. A failed archive does not turn accepted source into a rejected draft or stop result loading. The notice clears after a successful response that covers the observed live revision. A timeout does not establish whether the server committed the archive; Grid keeps the save unconfirmed instead of claiming success or rollback. If you switch models or edit the source while a saved model's results are still loading, the older refresh does not flash cells or update its summary afterward.

A failed worksheet change can also report errors while restoring its earlier layout. Its error includes the original cause and any rollback failures. Reopen the model and inspect its source, layout and results when rollback is incomplete. If the layout change failed before Grid submitted its source change, recovery leaves independently submitted source edits in place.

Interpret the policy accounts separately

If you choose coercion warn, input edits refresh the warning messages even when every cell has a name rather than a worksheet address. For example, adding zero to a numeric string can calculate successfully while warning about the conversion. Changing that input to a number clears the obsolete warning. Reading the result preserves the current warning. Review these messages along with the calculated accounts before interpreting an edited scenario.

The model equates linear demand and supply with a per-unit tax. Its household cash allocation is a separate assumption: five equal-weight households pay equal amounts, and the four poorest receive rebates. It does not estimate each household's economic incidence from the market's price changes.

The cash budget includes retained government revenue. The market welfare account includes consumer surplus, producer surplus, revenue and deadweight loss. The income-distribution statistics describe cash incomes only; they do not allocate the deadweight loss to individual households.

At tax 20 and redistribution share 0.75, Gini falls from 0.4 to about 0.397776, while the poverty-gap index rises from 0.3 to 0.3022. These measure different aspects of the distribution. Passing the accounting checks does not establish that the policy improves every household's welfare.

Compare inference conventions deliberately

The first comparison uses the same OLS coefficients with classical, HC1, clustered and Newey–West covariance. Classical and HC1 use residual-df t inference; the eight-block cluster example explicitly uses seven inference degrees of freedom. Newey–West uses two lags and a normal reference. The blocks and lag order are teaching assumptions, not an automatic choice for real data.

The separate DID example has 20 groups and two observations per group. The interaction coefficient recovers the synthetic effect, with cluster standard error about 0.0955134 and 19 inference degrees of freedom. At effect 3.5 and 90% confidence, the displayed interval is approximately [3.334845, 3.665155]. The table identifies all four terms and explains its finite-sample correction.

Use a confidence level strictly between zero and one, such as 0.95 for 95%. Zero and one are rejected. Extreme confidence levels retain the selected inference convention; with very few inference degrees of freedom, intervals can be extremely wide even when their numerical calculation is accurate.

The DID interpretation requires parallel average untreated changes, a common adoption date, no anticipation and no spillovers. Two dates cannot establish a pre-trend; 20 clusters are still few. A small p-value does not verify those assumptions. Download HTML retains coefficient labels, uncertainty and method notes in a portable table.

Select a single REGRESS result, such as Robust or PolicyFit, to see Regression fit in the Cell inspector. Use Pop out for more space. The summary shows each named estimate with its standard error, supplied confidence interval and p-value, followed by the sample and inference conventions. You do not need to author a comparison formula just to inspect one fit. Copy table and Download HTML include every term and method note; Next terms pages long summaries. Complete regression fit data opens the original full result, including covariance, fitted values and residuals. Displayed numbers use ten significant digits; the structured result retains its original precision. Failed, pending or stale results withhold the summary and export until recovery.

For source authoring, see the two-predictor matrix example and inference convention example. In Model, select Author to edit the full model; Source shows the selected sheet read-only. Paste the example into Author and inspect I/O after the live update. The matrix example exposes ObservationCount and PredictorCount so you can check six observation rows and two predictor columns before interpreting the fit. Its PositionExample also fills B4:G4, where you can read every mapped value directly.

Each observation is one matrix row. Pass a separate position array when an indexed MAP needs the observation number. Use ClusterId for a cluster column; GROUP is a language keyword. The documented HAC spelling is "newey_west". Select a coefficient with INDEX(Fit.coefficients,1,2) or Fit.coefficients[2]. Negative positions count from the end; out-of-range positions return an error. Use zero only when intentionally selecting a whole row or column, such as INDEX(Predictors,0,1) for the first predictor column.

Keep holdout evaluation separate from model selection

The macro starter contains 32 dated quarterly index observations. It computes 31 quarterly growth rates, excludes the unavailable first growth, trains on 2017 Q2–2022 Q4, and evaluates eight untouched observations in 2023–2024. The 23 training growth values supply 22 lag/lead pairs for the AR fit.

Every forecast starts from the training endpoint and recursively uses the prior prediction. It never substitutes a later holdout actual. The benchmark is the mean of training growth. Growth and forecast errors are quarterly percentage points, not annualized rates.

The baseline AR forecast has RMSE about 0.315908 versus the benchmark's 0.325364, but MAE about 0.279591 versus the benchmark's 0.273061. The preferred model therefore depends on the declared loss measure. Set the weight and shock before examining the holdout; tuning them against these eight outcomes would turn the holdout into model-selection data. Coefficient intervals in the fit table are not forecast intervals.

The series currently uses the existing explicit economic_series object representation. Calendar transformations validate dates and frequency; the example's count check detects a missing quarterly observation. The TS.SERIES constructor has passed native and compiled-source checks in the next-version source. The dedicated editor is implemented in source; full host/app verification is tracked separately. The macro starter retains its checked provider-envelope form until that integration is verified. Do not sort, fill or drop observations merely to make a failing calendar check pass.

When editing a typed dated-series input, invalid dates, duplicate periods or invalid readings now reject the edit and retain the previous input. The error identifies the observation to repair. Batch edits validate every value and target before applying any member. This contract is implemented in the next-version source; current-host execution is recorded separately from source checks. A missing quarter remains missing under "preserve"; "reject" requires complete periods and readings. Neither option silently fills or reorders observations.

This frozen synthetic exercise does not model publication delays or historical data revisions. Retrospective HP/Hamilton filtering is outside its forecast path; a filter fitted to the full history can use information unavailable at the forecast origin.

Edit dated observations

The dated-series authoring example now declares Observations as an editable input. In a matching application build, select Edit dated series in I/O to open its reviewed editor directly. You can also use Jump to, then open the cell popout. The dated-series editor accepts spreadsheet paste or comma-separated text with two columns and no header: YYYY-MM-DD date, then reading.

If a series save is accepted but its results cannot be loaded, the dialog stays open and says that the input was accepted. The change retains its Undo entry. Close the dialog and use the model's Save to retry calculation, or Undo to restore the previous input. Copy any local draft you need before closing. This outcome does not require submitting the accepted edit again. A fresh preview is required before another edit; a review from a different workspace, source draft or superseded source request cannot be committed.

Choose Frequency and Missing data, then Preview series. The example's original history previews as four observations and two columns, from 2024-01-01 to 2025-01-01, with one missing quarterly period and no missing readings. Preserve missingness keeps gaps and missing readings. Require complete data rejects them with the dates that need attention.

Review the summary, then select Save reviewed series. Editing the draft, frequency or policy invalidates its preview. A model change requires a fresh preview before saving; a failed save retains the draft. The source default stays available through Reset, and Undo restores the previous input. Use Grid's Save command to retain the edited document for reopening/export.

Series/source metadata is retained. Observation metadata follows matching dates; new dates create new observations. The editor does not sort, fill or drop rows. An empty value or . marks a missing reading. Series edits are limited to 1 MiB, including their metadata; preview checks the complete value that Save will use. Current series and source metadata shows the original structured value. Computed series remain inspectable; editing requires a declared input. If LevelSeries = Observations, open the declared Observations input to edit the history. Its computed LevelSeries alias cannot be used as a preview target.

This workflow is authored in the next-version source. Component/native-source checks do not establish its availability in an installed build; current-host/app verification remains an explicit implementation item.

Inspect dated results

Select a computed series such as AnnualGrowth to see Dated observations in the Cell inspector, or open its popout for more space. Long formulas have their own scrollable source area; focus it and use the arrow or End keys to read the full expression. The table pairs each stored date with its reading, marks missing entries, and shows the supplied frequency and transformation. Partial aggregates include their supplied coverage counts and Incomplete status. No absent dates are added to the table.

Use Next observations and Previous observations for longer histories. Complete series and source metadata opens the full stored value, including provider and observation metadata. Readings retain their stored precision and numeric text. Unsupported result shapes are identified explicitly; unavailable calculations withhold the dated table until results recover. Computed results remain read-only. Open the declared input's dated-series editor to change data.

This view is implemented in the next-version source and requires a matching app.

Check numerical accuracy before quantitative conclusions

The Solow accuracy comparison solves the same transition at two tolerance settings and compares every output time with the analytical path. At saving rate 0.25, maximum path error is about 8.65×10⁻⁶ with (rtol, atol) = (1e-6, 1e-8) and 2.60×10⁻⁹ with (1e-10, 1e-12). Both use 51 output times and RK45. More displayed time points alone do not tighten internal solver control. Tolerances bound estimated local error, not a guaranteed global path error. The steady state is also distinct from the finite-horizon endpoint.

For a Bellman model, a small iteration residual establishes accuracy relative to the chosen discrete problem, not to a continuous economy. Under a discounted contraction with factor β, residual ε gives a discrete value-error bound ε/(1−β). That bound does not cover state/action grid approximation error.

Before using a discrete saving policy quantitatively, compare 25, 50 and 100 states on the same economic domain; hold feasibility, utility and boundary conventions fixed. Evaluate policies on common states, inspect consumption and binding grid endpoints, and expand the domain if the policy hits its boundary. Report iteration residual and grid-refinement differences separately. For the log-utility, full-depreciation teaching model, the continuous policy k' = α β k^α supplies a useful independent check. Refinement is a required investigation for a new parameterization, not an automatic accuracy guarantee.