Class TradeModel

java.lang.Object
org.episteme.social.economics.trade.TradeModel

public class TradeModel extends Object
Implements standard international trade models, such as the Gravity Model of Trade.

The Gravity Model predicts bilateral trade flows based on the economic sizes (often GDP) and distance between two units.

Formula: F_ij = G * (M_i * M_j) / D_ij

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • gravity

      public static Real gravity(Nation nationA, Real gdpA, Nation nationB, Real gdpB, Real distance, Real constantG)
      Calculates the expected trade flow between two nations using the standard Gravity Model.
      Parameters:
      nationA - The first nation.
      gdpA - The GDP of the first nation.
      nationB - The second nation.
      gdpB - The GDP of the second nation.
      distance - The distance between the two nations (in km or similar unit).
      constantG - The gravity constant (empirically determined).
      Returns:
      The predicted trade volume.
    • gravityExtended

      public static Real gravityExtended(Real gdpA, Real gdpB, Real distance, Real constantG, double alpha, double beta, double gamma)
      Extended Gravity Model including population. F_ij = G * (GDP_i^a * GDP_j^b) / D_ij^c
      Parameters:
      gdpA - GDP of nation A
      gdpB - GDP of nation B
      distance - Distance
      constantG - Base constant
      alpha - Exponent for GDP A
      beta - Exponent for GDP B
      gamma - Exponent for Distance (friction)
      Returns:
      Predicted trade volume