import React, { useState } from 'react';
import { ArrowRight, TrendingUp, TrendingDown, LineChart } from 'lucide-react';
const MonetaryPolicyDiagram = () => {
const [activeScenario, setActiveScenario] = useState('expansion');
const [showGraphs, setShowGraphs] = useState(false);
// Graph parameters
const [moneySupply, setMoneySupply] = useState(100);
const [income, setIncome] = useState(100);
const [foreignRate, setForeignRate] = useState(2);
const [inflation, setInflation] = useState(2);
const [outputGap, setOutputGap] = useState(0);
// Calculate equilibrium interest rate from money market
const calcInterestRate = (ms, y) => {
// L(R,Y) = k1*Y - k2*R, where k1=0.5, k2=20
// Money market equilibrium: Ms/P = L(R,Y)
// Assuming P=1 for simplicity: Ms = k1*Y - k2*R
// R = (k1*Y - Ms)/k2
const k1 = 0.5;
const k2 = 20;
const rate = Math.max(0, (k1 * y - ms) / k2);
return rate;
};
// Calculate exchange rate from UIP
const calcExchangeRate = (domesticRate, foreignRate) => {
// Simplified: E = base * (1 + rate_differential)
// Higher domestic rate → currency appreciates → E falls
const base = 1.0;
const rateDiff = domesticRate - foreignRate;
return base * Math.exp(-rateDiff * 0.1); // E decreases when R_dom > R_for
};
// Calculate Taylor Rule rate
const calcTaylorRate = (inflationRate, inflationTarget, outputGap) => {
const rStar = 2; // equilibrium rate
const fPi = 1.5;
const fY = 0.5;
return rStar + fPi * (inflationRate - inflationTarget) + fY * outputGap;
};
const domesticRate = calcInterestRate(moneySupply, income);
const exchangeRate = calcExchangeRate(domesticRate, foreignRate);
const taylorRate = calcTaylorRate(inflation, 2, outputGap);
// Generate points for money demand curve
const generateMoneyDemandCurve = (y) => {
const points = [];
for (let r = 0; r <= 8; r += 0.2) {
const md = 0.5 * y - 20 * r; // L(R,Y) = k1*Y - k2*R
if (md > 0) {
points.push({ r, md });
}
}
return points;
};
// Generate points for UIP curve
const generateUIPCurve = (rFor) => {
const points = [];
for (let rDom = 0; rDom <= 8; rDom += 0.2) {
const e = calcExchangeRate(rDom, rFor);
points.push({ rDom, e });
}
return points;
};
const moneyDemandPoints = generateMoneyDemandCurve(income);
const uipPoints = generateUIPCurve(foreignRate);
const scenarios = {
expansion: {
title: 'Monetary Expansion (Ms ↑)',
color: 'blue',
steps: [
{ label: 'Central Bank', action: 'Increases Money Supply (Ms ↑)', color: 'bg-blue-100' },
{ label: 'Money Market', action: 'Interest Rate Falls (R ↓)', color: 'bg-blue-200' },
{ label: 'FX Market', action: 'Currency Depreciates (E ↑)', color: 'bg-blue-300' },
{ label: 'Real Economy', action: 'Investment ↑, Exports ↑, AD ↑', color: 'bg-blue-400' }
]
},
contraction: {
title: 'Monetary Contraction (Ms ↓)',
color: 'red',
steps: [
{ label: 'Central Bank', action: 'Decreases Money Supply (Ms ↓)', color: 'bg-red-100' },
{ label: 'Money Market', action: 'Interest Rate Rises (R ↑)', color: 'bg-red-200' },
{ label: 'FX Market', action: 'Currency Appreciates (E ↓)', color: 'bg-red-300' },
{ label: 'Real Economy', action: 'Investment ↓, Exports ↓, AD ↓', color: 'bg-red-400' }
]
},
taylor: {
title: 'Taylor Rule Response to High Inflation',
color: 'orange',
steps: [
{ label: 'Shock', action: 'Inflation Above Target (π > π*)', color: 'bg-orange-100' },
{ label: 'Taylor Rule', action: 'R = R* + 1.5(π - π*) + 0.5(y - y*)', color: 'bg-orange-200' },
{ label: 'Policy Action', action: 'Raise R aggressively (by > 1% per 1% inflation)', color: 'bg-orange-300' },
{ label: 'Effect', action: 'Real Rate ↑ → Borrowing ↓ → AD ↓ → π ↓', color: 'bg-orange-400' }
]
}
};
return (
Monetary Policy Transmission Mechanism
{/* Scenario Selector */}
{/* Interactive Graphs Section */}
{showGraphs && (
Interactive Graph Plotter
{/* Controls */}
{/* Money Supply Slider */}
{/* Income Slider */}
{/* Foreign Rate Slider */}
{/* Inflation Slider */}
{/* Output Gap Slider */}
{/* Results Display */}
Current Values:
Interest Rate: {domesticRate.toFixed(2)}%
Exchange Rate: {exchangeRate.toFixed(3)}
Taylor Rate: {taylorRate.toFixed(2)}%
Real Rate: {(domesticRate - inflation).toFixed(2)}%
{/* Graphs */}
{/* Money Market Graph */}
Money Market Equilibrium
Equilibrium: R = {domesticRate.toFixed(2)}% where money supply meets money demand
{/* Exchange Rate Graph */}
Interest Parity & Exchange Rate
UIP: RCHF ({domesticRate.toFixed(2)}%) vs REUR ({foreignRate.toFixed(1)}%)
→ E = {exchangeRate.toFixed(3)} {domesticRate > foreignRate ? '(CHF strong)' : '(CHF weak)'}
{/* Taylor Rule Graph */}
Taylor Rule Policy Response
Taylor Rule: R = 2% + 1.5×({(inflation-2).toFixed(1)}%) + 0.5×({outputGap.toFixed(1)}%) = {taylorRate.toFixed(2)}%
Real rate = {(taylorRate - inflation).toFixed(2)}%
{/* GDP Components Impact */}
Policy Impact on GDP Components
Interest Rate Effect: R↑ reduces C and I (especially I)
Exchange Rate Effect: Strong currency reduces NX
Higher R = {domesticRate.toFixed(2)}% → Tighter policy → Lower GDP
{/* Interactive Tips */}
💡 Try These Scenarios:
📈 Monetary Expansion: Increase money supply to 130 → Watch R fall and E rise (depreciation)
📉 Fight Inflation: Set inflation to 4% → See Taylor rule prescribe higher R to cool economy
🌍 Foreign Rate Shock: Raise foreign rate to 4% → Domestic currency strengthens
📊 Recession Response: Set output gap to -3% → Taylor rule suggests lower rates
)}
{/* Active Scenario Flow */}
{scenarios[activeScenario].title}
{scenarios[activeScenario].steps.map((step, idx) => (
{step.label}
{step.action}
{idx < scenarios[activeScenario].steps.length - 1 && (
)}
))}
{/* Main Relationships Diagram */}
Core Relationships & Formulas
{/* Money Market Equilibrium */}
Money Market Equilibrium
Ms: Money Supply (set by CB)
P: Price Level (sticky short-run)
R: Interest Rate (adjusts to clear market)
Y: Real Income
Key: R ↑ → L(R,Y) ↓ (inverse relationship)
Y ↑ → L(R,Y) ↑ (positive relationship)
{/* Uncovered Interest Parity */}
Uncovered Interest Parity (UIP)
RCHF: Domestic interest rate
REUR: Foreign interest rate
E: Current exchange rate (CHF/EUR)
Ee: Expected future exchange rate
Key: If RCHF ↑ → CHF appreciates (E ↓)
Returns must equalize across currencies
{/* Taylor Rule */}
Taylor Rule
R = R* + fπ(π - π*) + fy(y - y*)
R*: Equilibrium rate
π: Current inflation, π*: Target (2%)
y: Output, y*: Potential output
fπ = 1.5 (inflation response)
fy = 0.5 (output response)
Key: fπ {'>'} 1 ensures real rate rises
when inflation ↑ to cool economy
{/* National Income Identity */}
National Income Identity
Y: GDP/National Income
C: Consumption (~51%)
I: Investment (~27%, most volatile)
G: Government purchases (~12%)
CA: Current Account (~10%)
Saving Identity: S = I + CA
Save domestically (I) or abroad (CA)
{/* Transmission Channels */}
Monetary Policy Transmission Channels
{/* Interest Rate Channel */}
{/* Exchange Rate Channel */}
{/* Wealth/Asset Channel */}
{/* Key Takeaways */}
Key Takeaways
-
•
Money Market: Central bank controls Ms, which determines R through equilibrium condition
-
•
Exchange Rates: Interest rate differentials drive currency movements (UIP)
-
•
Taylor Rule: Systematic policy response to inflation and output gaps (fπ {'>'} 1 is crucial)
-
•
Transmission: Monetary policy affects economy through multiple channels simultaneously
-
•
Real Effects: Changes in R and E both impact aggregate demand (C, I, CA components)
);
};
export default MonetaryPolicyDiagram;