MaMaMo
Malaysia Macro Model

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.

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.

INTERACTIVE 8 quarters · real-time simulation

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.

Open playground →

Run the model, fetch data, and build input packs from the terminal. Node.js 18+, zero dependencies.

MODEL SOLVER
Run scenarios
node bin/run-model.mjs \
  --brent 150 --fx 4.20 \
  -o results/oil-shock.json
DATA PIPELINE
Fetch OpenDOSM
node bin/fetch-opendosm.mjs \
  --dataset gdp \
  --start 2015-01
INPUT BUILDER
Build run packs
node bin/build-inputs.mjs \
  --historical data.csv \
  -o data/run-packs/base.json

Roughly 200 equations, identities, and calibration rules across 17 blocks, written in EViews-compatible syntax.

1-3Private consumption, durables, property prices, inventories, business & housing investment, cost of capital
4Labour market — employment, wages, unemployment, participation, foreign workers sub-block (~2M workers)
5-6Exports (E&E, commodities, tourism) and imports (IO-table-derived import content ratios)
7Prices & wages — CPI with administered prices (~22% weight), PPI, ULC, deflators, GST/SST transition
8Commodities — Oil & Gas (Petronas, Brent pass-through) and Palm Oil (CPO, El Nino, export duties)
9-10Government revenue (income tax, PITA, SST, Petronas dividends) and expenditure (emoluments, subsidies, dev expenditure)
11Balance of payments — managed float FX, current account, remittances, FDI/portfolio flows
12Fiscal totals — fiscal balance, primary balance, debt dynamics, 65%-of-GDP ceiling
13-14Monetary policy (OPR to BLR, deposits, MGS yields) and financial sector
15Income accounts — household disposable income, EPF, corporate profits, SOCSO
16GDP identities, output gap, market sector satellite
17Household balance sheet (deposits, EPF, equities, housing loans, hire purchase) and external IIP

This is not just the UK model with labels swapped.

FUEL
Administered prices — RON95, diesel, electricity tariffs treated separately from market-driven CPI
O&G
Petronas — upstream profits, PITA (38%), dividends (~20% of federal revenue) flow to the fiscal block
CPO
Palm oil — CPO production with El Nino sensitivity, sliding-scale export duties, contribution to GVA
E&E
Semiconductor exports — global semicon cycle, ~38% of goods exports, ~52% import content (GVC integration)
EPF
Mandatory savings — 24% contribution modelled as a distinct household wealth channel
LABOUR
Foreign workers — 2 million workers modelled explicitly (absent from advanced-economy models)
SUBSIDY
Fuel subsidies — endogenous: gap between Brent-in-ringgit and administered pump price x volume
TAX
GST/SST transition — time-varying administered price weight and policy dummies for 2015-2018

Crisis dummies for: 1997-98 AFC, 2008-09 GFC, 2013 minimum wage, 2015 oil crash, 2020 COVID.

STRUCTURAL

Error-correction (ECM) framework. Small open economy — price-taker in commodity and capital markets. Managed float exchange rate.

COEFFICIENTS

Calibrated from BNM working papers, IMF Article IV reports, DOSM IO tables. Informed starting points, not fully estimated structural parameters.

POLICY (EXOGENOUS)

OPR, administered fuel price, SST rate, CPO export duty rate, development expenditure growth.

OPERATIONAL STATUS

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.

VISITOR SNAPSHOT

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.

BEST USE TODAY
CLI scenarios + web playground
PUBLIC CLAIM
Runnable research prototype
NEW IN v0.4
Executable model engine
Strong
Model structure

The 17-block architecture is in place and clearly adapted to Malaysian institutions rather than copied over mechanically.

Strong
Documentation

Visitors can inspect the model logic, inputs, assumptions, and studies without relying on hidden institutional context.

Usable Now
Data pipeline

OpenDOSM fetcher pulls GDP, CPI, labour, and trade data. Input pack builder assembles run packs from raw data and defaults.

Usable Now
Model engine

Standalone Node.js solver implements all 17 blocks. Run scenarios from the CLI with JSON output or import as a library.

In Progress
Calibration quality

Many coefficients are informed calibrations from public sources, but not yet fully estimated in a reproducible econometric workflow.

Not Yet
Production readiness

Too many important wedges still sit outside the model for this to be presented as a push-button forecasting system.

Fiscal scenario analysis under different oil/CPO paths OPR transmission analysis Subsidy rationalisation scenarios Minimum wage impact Macro stress testing Teaching structural macro
NOT FOR

Official forecasting, policy sign-off, investment advice, or point-estimate precision claims without separate validation and governed input assumptions.

Contributions welcome. Roughly in priority order:

01
Re-estimate everything — proper econometrics using DOSM/BNM quarterly data
02
Supply side — production function, TFP dynamics, sectoral capital stocks
03
Sectoral disaggregation — manufacturing, services, agriculture, construction, mining
04
Financial accelerator — household debt (~84% of GDP) to NPLs, bank capital, credit supply
05
E&E/GVC granularity — front-end vs back-end semicon, US-China decoupling scenarios
06
Stochastic simulation — fan charts instead of point forecasts
07
BNM API integration — interest rates, monetary aggregates, credit, BOP data
08
Back-testing — validate against AFC, GFC, COVID outturns
09
Forward-looking expectations — rational expectations for inflation and exchange rates
10
Digital economy — capture the ~23% of GDP that's now digital
ROOM FOR IMPROVEMENT

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.

v0.4.0

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.

v0.3.0

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.

v0.2.0

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.

v0.1.0

Initial adaptation from UK OBR model. All 17 blocks rebuilt for Malaysia.

Official data sources

OpenDOSM — Malaysia's open data platform. GDP, inflation, employment, trade under CC BY 4.0. open.dosm.gov.my
DOSM Input-Output Tables 2015 — Basis for import content ratios and cost structure weights. dosm.gov.my
BNM Monthly Statistical Bulletin — Interest rates, monetary aggregates, credit, BOP, financial data. bnm.gov.my

Institutional reports

BNM Annual Report 2024 — Macro outlook, monetary policy review, financial stability. bnm.gov.my
IMF Malaysia: 2025 Article IV — Country Report No. 25/57. Staff report with macro projections. imf.org
IMF Malaysia: 2024 Article IV — Country Report No. 24/70. imf.org
World Bank Malaysia Economic Monitor, Oct 2025 — Digital transformation & public sector productivity. worldbank.org
OBR (UK) Forecast Methodology — Original UK model architecture that MaMaMo adapts. obr.uk

Academic papers

Alp, Elekdag & Lall (2012). "An Assessment of Malaysian Monetary Policy During the GFC." IMF WP No. 12/35. imf.org
BIS (2008). "The Monetary Transmission Mechanism in Malaysia." BIS Papers No. 35. bis.org
Pham & Nguyen (2018). "The Transmission Mechanism of Malaysian Monetary Policy: A TV-VAR Approach." Empirical Economics, 55(2). ideas.repec.org