An open structural quarterly macro model prototype for Malaysia.
Roughly 200 equations, identities, and calibration rules.
A documented research build by shahid rogers with claude + codex, built for transparency, critique, and scenario analysis rather than production forecasting claims.
What is this?
MaMaMo is a structural quarterly macroeconomic model prototype for the Malaysian economy. It adapts the broad architecture of the UK OBR/HM Treasury model and re-specifies its major blocks for Malaysian institutions, trade structure, and policy settings.
BNM and MOF have their own models, but those are proprietary. Academic models tend to be partial. MaMaMo is meant to be something you can open, inspect, critique, extend, and learn from.
It is not a validated production forecasting system. It is a publishable research prototype with enough structure to support serious iteration.
Studies
Scenario Playground
Adjust oil prices, policy rates, exchange rates, and global conditions with live sliders. Watch the macro system respond in real time through all transmission channels.
$200 Oil — Iran War Escalation
Brent crude spikes to $200/bbl on a US/Israel-Iran ground war. Traced through all 17 model blocks, from Petronas profits to fuel subsidies, from the ringgit to household balance sheets.
When Oil Hits $200, Residential Projects Slip
Construction costs, launch deferrals, delivery delays, contractor stress, and LAD under the same oil-war shock.
Command line
Run the model, fetch data, and build input packs from the terminal. Node.js 18+, zero dependencies.
node bin/run-model.mjs \
--brent 150 --fx 4.20 \
-o results/oil-shock.json
node bin/fetch-opendosm.mjs \
--dataset gdp \
--start 2015-01
node bin/build-inputs.mjs \
--historical data.csv \
-o data/run-packs/base.json
What's inside
Roughly 200 equations, identities, and calibration rules across 17 blocks, written in EViews-compatible syntax.
| 1-3 | Private consumption, durables, property prices, inventories, business & housing investment, cost of capital |
| 4 | Labour market — employment, wages, unemployment, participation, foreign workers sub-block (~2M workers) |
| 5-6 | Exports (E&E, commodities, tourism) and imports (IO-table-derived import content ratios) |
| 7 | Prices & wages — CPI with administered prices (~22% weight), PPI, ULC, deflators, GST/SST transition |
| 8 | Commodities — Oil & Gas (Petronas, Brent pass-through) and Palm Oil (CPO, El Nino, export duties) |
| 9-10 | Government revenue (income tax, PITA, SST, Petronas dividends) and expenditure (emoluments, subsidies, dev expenditure) |
| 11 | Balance of payments — managed float FX, current account, remittances, FDI/portfolio flows |
| 12 | Fiscal totals — fiscal balance, primary balance, debt dynamics, 65%-of-GDP ceiling |
| 13-14 | Monetary policy (OPR to BLR, deposits, MGS yields) and financial sector |
| 15 | Income accounts — household disposable income, EPF, corporate profits, SOCSO |
| 16 | GDP identities, output gap, market sector satellite |
| 17 | Household balance sheet (deposits, EPF, equities, housing loans, hire purchase) and external IIP |
What makes it Malaysian
This is not just the UK model with labels swapped.
Crisis dummies for: 1997-98 AFC, 2008-09 GFC, 2013 minimum wage, 2015 oil crash, 2020 COVID.
Key assumptions
Error-correction (ECM) framework. Small open economy — price-taker in commodity and capital markets. Managed float exchange rate.
Calibrated from BNM working papers, IMF Article IV reports, DOSM IO tables. Informed starting points, not fully estimated structural parameters.
OPR, administered fuel price, SST rate, CPO export duty rate, development expenditure growth.
Documented and structurally coherent, but still dependent on some external wedges and preprocessing inputs. Publishable as a research prototype, not yet as a one-command forecasting engine.
Current status
A serious research prototype, not a finished forecasting product.
The model structure is real, the Malaysia-specific institutional detail is real, and the scenario work is already useful. v0.4.0 adds an executable model engine and OpenDOSM data pipeline — you can now run scenarios from the command line with real data. What is still missing is full econometric estimation and back-testing.
The 17-block architecture is in place and clearly adapted to Malaysian institutions rather than copied over mechanically.
Visitors can inspect the model logic, inputs, assumptions, and studies without relying on hidden institutional context.
OpenDOSM fetcher pulls GDP, CPI, labour, and trade data. Input pack builder assembles run packs from raw data and defaults.
Standalone Node.js solver implements all 17 blocks. Run scenarios from the CLI with JSON output or import as a library.
Many coefficients are informed calibrations from public sources, but not yet fully estimated in a reproducible econometric workflow.
Too many important wedges still sit outside the model for this to be presented as a push-button forecasting system.
Use cases
Official forecasting, policy sign-off, investment advice, or point-estimate precision claims without separate validation and governed input assumptions.
What's next
Contributions welcome. Roughly in priority order:
The executable model engine and OpenDOSM data pipeline are now in place. What remains for production quality is full econometric estimation, BNM API integration, better treatment of the big external wedges (CREDIT, MCCI, GOVDEBTADJ, HARAREA), and back-testing against historical episodes.
Changelog
Executable model engine and data pipeline. Added a standalone Node.js solver implementing all 17 blocks, CLI tools for running scenarios, fetching OpenDOSM data, and building input packs. The model can now be run from the command line with JSON output.
Documentation and presentation pass. Repositioned the project as a publishable research prototype, added a one-page summary, architecture diagram, interpretation note, and updated the landing page with inline document modals and clearer visitor-facing status.
Audit pass. Fixed 3 critical undefined variables, added 2008-09 GFC dummies, corrected E&E import content (0.65 → 0.52), defined ~20 previously missing variables, made administered price weight time-varying for GST/SST.
Initial adaptation from UK OBR model. All 17 blocks rebuilt for Malaysia.