Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

SAM Workbench

A browser-based tool for building a social accounting matrix and analysing it.

Define your own accounts, enter your own transactions, and the app derives the expenditure-share matrix, the multiplier matrix and every simulation from them. Nothing is assumed about your economy, your sectors or your units, and no dataset ships with the tool.

Live app: https://atikergit.github.io/SAM/

What it does

  • Accounts — any number, named by you. Add, rename, recode, reorder and delete; classify each as Activity, Factor, Household, Other endogenous or Exogenous.
  • Matrix — an editable square grid. Type into cells, or paste a whole block straight from Excel. Row totals, column totals and residuals update live. A read-only expenditure shares (A) view shows the coefficient matrix with each column's degree of endogeneity and leakage.
  • Checks — duplicate names, unclassified accounts, zero column totals, negative values, unreviewed values, accounts that do not balance, and a base reproduction test proving M · x returns each account's own total. RAS balancing is built in.
  • Simulate — named scenarios; shock one account or a whole class, as an amount, a percentage, or a target level.
  • Results — output, value-added and household income effects; multipliers and backward/forward linkages; the incremental SAM; scenario comparison; and a Working view that decomposes any single number.
  • Chart export — every chart carries PNG image and Excel data buttons: the picture at 2x resolution with its title, legend and date, and an .xlsx workbook of the exact rows the chart plots so it can be rebuilt in Excel.

Method

Accounts marked endogenous form the loop; exogenous accounts supply the injection.

A[i,j] = T[i,j] / columnTotal[j]      column total includes payments to exogenous accounts
M      = (I − A)⁻¹                    Gauss–Jordan with partial pivoting
y      = M · x        Δy = M · Δx     x = row sums across the exogenous columns

Output, value-added and income multipliers are column sums of M over the Activity, Factor and Household rows; the full column sum is the backward linkage and the row sum is the forward linkage.

Assumes fixed prices, fixed expenditure shares, spare capacity, and a single period — a comparison of two equilibria, not a path through time.

Privacy

Everything runs in the visitor's browser. No server, no accounts, no analytics. A workspace is held in that browser's local storage and can be saved to a file the visitor keeps. Nothing is uploaded anywhere.

Running it

It is one self-contained HTML file. Open index.html in any modern browser, or serve the folder from any static host. The only external requests are Google Fonts and, for .xlsx import and export, the SheetJS library from cdnjs — both optional; the app works without them, and falls back to CSV where .xlsx is unavailable.

Editing

Everything lives in index.html: styles at the top, then the model and engine, charts, file import/export, the page views, the matrix grid, the results tabs, and the wiring. There is no build step.

About

Social accounting matrix (SAM) workbench

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages