Skip to main content

FDI, Coexistence, and Jobs: A DSGE Model for Morocco

FDI, Coexistence, and Jobs: A New Economic Model for Morocco

1. The Core Policy Question

We begin with a question critical for many developing economies, including Morocco:

When highly productive multinational corporations (MNCs) invest, what happens to the local economy?

  • Do they drive out domestic firms, capture the entire market, and repatriate profits?
  • Or can they coexist with domestic firms, creating moderate GDP gains and stable jobs?
  • What are the trade-offs for skilled vs. unskilled workers?

To answer this, we must build a model, but not just any model. We need one that is both economically realistic and computationally solvable. This document outlines the structure, key concepts, and findings of such a model.

2. Key Economic Concepts Explained

This model is a DSGE model that combines TANK households with an S&M labor market and CES production. Let's break down what that means.

DSGE (Dynamic Stochastic General Equilibrium):

  • Dynamic: The model evolves over time. Agents make decisions (like saving and investing) that link the present to the future. Capital ($K_t$) accumulates via investment.
  • Stochastic: The model can be hit by random shocks (e.g., a TFP shock or a policy change). Our analysis is a "counterfactual" or "comparative static" exercise, comparing two different steady states (before and after a shock).
  • General Equilibrium: All markets (labor, capital, goods) are modeled and must clear simultaneously. Prices (like the wage, $w$, and interest rate, $r$) are endogenously determined by supply and demand, linking everything together.

TANK (Two-Agent New Keynesian):

  • This describes the household side of the model. Instead of one "representative" household, we have two types, which is crucial for analyzing inequality.
  • "Savers" (Skilled): These households are patient (high $\beta$). They save, own the economy's capital stock ($K$), and smooth their consumption over time, as described by the Euler equation.
  • "Spenders" (Unskilled): These households are "hand-to-mouth." They are impatient and live paycheck-to-paycheck, consuming their entire labor income in each period. This introduces consumption inequality and makes the economy more responsive to labor income shocks.

S&M (Search-and-Matching):

  • This is a realistic model of the labor market, based on Nobel Prize-winning work. It replaces the simple "supply = demand" assumption.
  • In an S&M model, finding a job takes time. Unemployed workers must "search," and firms must post costly "vacancies" (job ads).
  • A "matching function" (like a production function) determines how many new hires are created from the pool of unemployed workers and open vacancies.
  • This process endogenously creates a "natural" rate of unemployment and explains why wages are the result of a Nash Bargaining process between the firm and the worker.

CES (Constant Elasticity of Substitution):

  • This is a flexible functional form used to aggregate different inputs. We use it in two places:
    1. To aggregate skilled ($L_S$) and unskilled ($L_U$) labor into a single "labor composite" ($L_f$).
    2. To aggregate the goods from domestic firms ($Y_D$) and MNCs ($Y_M$) into a final "total GDP" ($Y_{Total}$).
  • The key parameter is $\sigma$, the elasticity of substitution.
    • If $\sigma = \infty$, the goods are perfect substitutes. This leads to "corner solutions," where the most productive firm takes 100% of the market.
    • If $\sigma = 1$, it's a standard Cobb-Douglas function.
    • If $\sigma < \infty$, the goods are imperfect substitutes. This is the key to our model: consumers value variety. Even if MNC goods are cheaper, consumers still want *some* domestic goods, ensuring their survival.

3. The Model's Architecture & Core Equations

Our final, solvable model (`3_5_..._final.py`) combines these features. The "computational trick" to ensure a solution was to fix the economy's total capital stock ($K$) and its allocation, allowing us to focus on the labor market dynamics, which are the core of our policy question.

Model Architecture Overview
Component Feature Economic Rationale
Firms Heterogeneous (`domestic`, `mnc_us`, `mnc_china`) MNCs have different TFP, capital intensity (`p_alpha`), and skill preferences (`p_skill_pref`).
Households Heterogeneous (`savers`, `spenders`) A TANK setup to capture income and consumption inequality.
Labor Dual Markets (`skilled`, `unskilled`) Two separate Search-and-Matching (S&M) markets with frictions, bargaining, and realistic unemployment.
Production Nested CES Aggregation Imperfect substitution is the key. It ensures firms can coexist, preventing "corner solutions."

Mathematical Addendum: Core Model Equations

The following equations (drawn from the "full" DSGE in `3_mar_gamspy_fdi_model.py`) form the economic logic of the model. We solve for the "steady state," where all variables are constant over time.

A. Firm Production (for firm $f$)

1. CES Labor Composite ($L_f$): Aggregates skilled ($L_{f,S}$) and unskilled ($L_{f,U}$) labor, governed by skill preference $\chi_f$ and elasticity parameter $\rho$.

$$L_f = \left[ \chi_f L_{f,S}^{\rho} + (1-\chi_f) L_{f,U}^{\rho} \right]^{1/\rho}$$

2. Production Function ($Y_f$): Cobb-Douglas function combining capital ($K_f$) and the labor composite ($L_f$). $A_f$ is firm-specific TFP. The shares $\alpha_f + \beta_f < 1$ allow for decreasing returns to scale, which helps ensure stable firm sizes.

$$Y_f = A_f K_f^{\alpha_f} L_f^{\beta_f}$$

3. Optimal Capital Demand (FOC): Firms hire capital until its marginal product equals the economy-wide rental rate, $r$.

$$r = \frac{\partial Y_f}{\partial K_f} = \alpha_f \frac{Y_f}{K_f}$$

4. Optimal Labor Demand (FOC): Firms hire each labor type until its marginal product equals its wage ($w_S$ or $w_U$). This is derived using the chain rule on equations (1) and (2).

$$w_S = \frac{\partial Y_f}{\partial L_{f,S}} = \left( \beta_f \frac{Y_f}{L_f} \right) \cdot \left( L_f^{1-\rho} \chi_f L_{f,S}^{\rho-1} \right)$$ $$w_U = \frac{\partial Y_f}{\partial L_{f,U}} = \left( \beta_f \frac{Y_f}{L_f} \right) \cdot \left( L_f^{1-\rho} (1-\chi_f) L_{f,U}^{\rho-1} \right)$$

B. Search & Matching Labor Market (for skill type $s$)

5. Matching Function (Job Finding/Filling): Determines the probability of a worker finding a job, $p(\theta_s)$, and a firm filling a vacancy, $q(\theta_s)$, as a function of labor market "tightness" $\theta_s = V_s/U_s$ (vacancies / unemployed). $\mu_s$ is matching efficiency and $\eta_s$ is elasticity.

$$p(\theta_s) = \mu_s \theta_s^{1-\eta_s} \quad \text{(Job Finding Rate)}$$ $$q(\theta_s) = \mu_s \theta_s^{-\eta_s} \quad \text{(Vacancy Filling Rate)}$$

6. "Bathtub" Model (Unemployment Flow): In steady state, the flow of workers *out* of jobs (separation rate $s_s$ times employment $L_s$) must equal the flow *into* jobs (job finding rate $p(\theta_s)$ times unemployment $U_s$).

$$s_s L_s = p(\theta_s) U_s$$

7. Job Creation Condition (Free Entry): Firms post vacancies until the cost of hiring equals the expected profit from the job. $\kappa_s$ is the vacancy cost. This links the goods market ($MPL_s$) to the labor market.

$$\underbrace{\frac{\kappa_s}{q(\theta_s)}}_{\text{Cost of Hiring}} = \underbrace{\frac{MPL_s - w_s}{r + s_s}}_{\text{Present Value of Profit from Job}}$$

8. Nash Wage Bargain: The wage $w_s$ is the result of a bargain, splitting the total match surplus between the worker (who has bargaining power $\phi_s$) and the firm. $b_s$ is the worker's outside option (unemployment benefit/leisure).

$$w_s = (1-\phi_s) b_s + \phi_s \underbrace{(MPL_s + \kappa_s \theta_s)}_{\text{Total Match Surplus}}$$

C. Household & Macro Closure

9. Euler Equation (Savers): The saver's consumption choice over time, which links the discount factor $\beta$ and the real interest rate $r$ in steady state. $\delta$ is capital depreciation.

$$1 = \beta (1 + r - \delta)$$

10. Spender Budget: Spenders simply consume their entire labor income ($w_U L_U$).

11. Market Clearing: Total capital, labor, and goods produced must equal the sums across all firms and households.

4. Policy Experiments & Key Findings

We run several "counterfactual" scenarios to test the model, starting from a calibrated Baseline (which represents the current Moroccan economy). The charts below show the results of these policy experiments.

Figure 1: Economic outcomes across different policy scenarios

Finding 1: Coexistence is the Default

The "High MNC TFP" shock (a 10% increase in MNC productivity) does not eliminate domestic firms.

  • In the text, a 10% MNC TFP increase only shifts their market share from 60% to 62%.
  • We can see this in Figure 1, Panel B: the "High MNC TFP" bar shows only a tiny increase in MNC share (red) and a tiny decrease in domestic share (blue).
  • Why? The Nested CES structure (Imperfect Substitution) means consumers value the "domestic" good variety. Even if MNCs are more efficient, a domestic market remains. No corner solution.

Finding 2: Moderate Gains, Stable Markets

Figure 2: Percentage changes from baseline for different policy shocks
  • The 10% TFP shock (a large shock!) only increases GDP by ~3% (Figure 2, Panel A). This is a credible, realistic gain, unlike the 147% predictions from simpler, frictionless models.
  • Look at unemployment (Figure 2, Panel B). The changes are tiny, less than 0.5 percentage points. Labor markets are stable because the S&M frictions (job search, matching) dominate. Attracting FDI does not cause mass unemployment.

Finding 3: Policy is About Trade-Offs

Figure 3 is the most critical for policymakers, as it shows the trade-offs of different policy paths.

Figure 3: Policy Trade-offs in the Moroccan Economy
  • Trade-Off 1 (Panel A): Growth vs. Economic "Sovereignty"
    • The "Capital-Int. MNC" scenario (red square) delivers the highest GDP (x-axis), but at the cost of the highest MNC market share (y-axis).
    • "Domestic Catch-Up" (gray square) yields lower GDP but "claws back" market share for domestic firms.
  • Trade-Off 2 (Panel B): Efficiency vs. Inequality
    • The "Skill-Int. MNC" scenario (green square) delivers the highest wage premium (y-axis), dramatically increasing inequality between skilled and unskilled workers.
    • "Better Labor Mkt" (purple square) is the only policy that lowers unemployment (x-axis) and reduces inequality (y-axis) simultaneously, but it has a small GDP impact.

Finding 4: "Good" vs. "Bad" Fragmentation (A Geopolitical Shock)

To model today's geopolitical environment, we introduce a new "Tech Denial" shock, representing FDI fragmentation. In this scenario, we apply a 5% TFP (productivity) penalty to `mnc_china` to simulate technology access restrictions.

This policy successfully reroutes market share, but it comes at a significant macroeconomic cost. The results show a "negative-sum" outcome:

  • Market Share is Rerouted: The `mnc_china` firm's market share falls from 30.0% to 28.4%. This lost share is captured by both `Domestic` firms (whose share rises from 40.0% to 40.9%) and `mnc_us` firms (share rises from 30.0% to 30.7%).
  • The Macroeconomy Shrinks: This is not a "win." The policy-induced inefficiency causes total GDP to fall from 3.785 (Baseline) to 3.726.
  • Labor Market Impact: This drop in national output leads to lower real wages for both skilled (4.573 -> 4.488) and unskilled (3.483 -> 3.445) workers, and a slight rise in unskilled unemployment (3.4% -> 3.5%).

This creates a powerful policy insight when compared to the "Domestic Catch-Up" scenario (see Figure 3, Panel A):

"Good" Fragmentation (Domestic Catch-Up): Domestic firms gain market share (to 41.1%) by *improving their own productivity*. This is a positive-sum outcome: total GDP rises (to 3.828) and so do wages.

"Bad" Fragmentation (Tech Denial): Domestic firms gain market share (to 40.9%) by *having a competitor penalized*. This is a negative-sum outcome: total GDP falls (to 3.726) and so do wages.

This demonstrates that while both policies can *look* similar (a ~1 percentage point gain in domestic market share), their underlying impact on national welfare is completely opposite.

5. Conclusion for Moroccan Policymakers

  1. Welcome FDI: Policymakers can pursue FDI liberalization without fearing the extinction of their domestic industries. The two will coexist in a stable equilibrium.
  2. Be Realistic: The economic gains will be moderate and gradual, not transformative overnight. This model provides credible, realistic effect sizes.
  3. Watch for Inequality: The type of FDI matters. Attracting "skill-intensive" industries (Figure 3, Panel B) may boost overall wages but will significantly worsen the skilled/unskilled wage gap.
  4. Choose Innovation over Penalties: Policies that penalize one source of FDI (like the "Tech Denial" scenario) may successfully increase domestic market share, but they do so at the cost of lower national GDP and lower real wages for everyone. A strategy focused on boosting domestic productivity (like "Domestic Catch-Up") achieves the same market share goal while making the entire country wealthier.

Comments

Popular posts from this blog

Unemployment by state in the USA

Below is a visualization of unemployment rates by county using a powerful Python library called Bokeh . The two maps are for the states of Texas and the Commonwealth of Massachusetts. As the second largest economy in the United States (10th largest in the world), Texas shows interesting county variation in macroeconomic factors such as unemployment. According to Wikipedia , in 2015, Texas was home to six of the top 50 companies on the Fortune 500 list and 51 overall (third most after New York and California). The northern counties were least affected by the financial crisis of 2008/09. Dallas–Fort Worth–Arlington area encompasses 13 counties which constitute the economic and cultural hub of the region commonly called North Texas or North Central Texas. Bokeh Plot The least affected counties in Massachusetts were the southernmost tourist areas of Nantuckett and Dukes County. The ...

Modeling Core PCE inflation: A dual approach

Today's release of the August 2025 Personal Consumption Expenditures (PCE) inflation data drew widespread media attention, with coverage highlighting both the persistence of inflation and its implications for Federal Reserve policy. Across outlets, analysts pointed to resilient consumer spending and income growth as signs of underlying economic strength, even as inflation remains above the Fed's 2% target. The consensus among media reports is that while inflation is not worsening, its stubbornness continues to challenge policymakers navigating a softening labor market and evolving rate expectations. To provide deeper insights into inflation's trajectory, I've developed a forecasting framework that combines two econometric approaches — ARIMA time series modeling and Phillips Curve analysis—to predict Core PCE inflation. This analysis presents a unique opportunity to validate my forecasting methodology against eight months of 2025 data. ...

Malaysia at a Cross Roads: Diagnosing the Constraints to High Income Status

Malaysia at a Crossroads: Diagnosing Constraints to High-Income Status In 2008, Malaysia was recognized by the Growth Commission – a distinguished panel comprising 2 Nobel Prize Winning Economists and other leading development practitioners – as one of thirteen countries that sustained high growth in the post-war period. The 30-year stretch that caught the attention of the Growth Commission was between 1967 and 1997 when Malaysia grew at an average of 7.3% per year. This long stretch of growth was interrupted by periods of external shocks including the Volcker shock of 1986, the Asian Financial crisis in 1997/8, later the so-called Dot Com Bubble of 2001, and more recently the Global Financial Crisis of 2008. Despite these shocks, Malaysia remained resilient - formally earning the title "Upper Middle Income Country" in 1992. (See summary figure that breaks down the country's per capita growth story). As...