Learn R Programming

GE (version 0.5.0)

General Equilibrium Modeling

Description

Some tools for developing general equilibrium models and some general equilibrium models. These models can be used for teaching economic theory and are built by the methods of new structural economics (see LI Wu, 2019, ISBN: 9787521804225, General Equilibrium and Structural Dynamics: Perspectives of New Structural Economics. Beijing: Economic Science Press). The model form and mathematical methods can be traced back to J. von Neumann (1945, A Model of General Economic Equilibrium. The Review of Economic Studies, 13. pp. 1-9), J. G. Kemeny, O. Morgenstern and G. L. Thompson (1956, A Generalization of the von Neumann Model of an Expanding Economy, Econometrica, 24, pp. 115-135) et al. By the way, J. G. Kemeny is a co-inventor of the computer language BASIC.

Copy Link

Version

Install

install.packages('GE')

Monthly Downloads

357

Version

0.5.0

License

GPL-2 | GPL-3

Maintainer

LI Wu

Last Published

June 20th, 2025

Functions in GE (0.5.0)

CESAK_dc

Demand coefficients of the CESAK Production Function
QL_demand

Quasilinear Demand Functions
CES

CES Function
CRRA

Constant Relative Risk Aversion (CRRA) Utility Function
AMSD

Additive-Mean-Variance Utility Function and Additive-Mean-Standard-Deviation Utility Function
CARA

Constant Absolute Risk Aversion (CARA) Utility Function
SCES

Standard CES Function
MDCES_demand

Modified Displaced CES Demand Function
AMSDP

Additive-Mean-Standard-Deviation Portfolio Utility Function
DCES

Displaced CES Utility Function and Displaced CES Demand Function
gemAssetPricingExample

Some Examples of Asset Pricing
apply_expand.grid

Applying a Function to All Combinations of the Supplied Vectors
convert_ir

Convert between (Primitive) Period Interest Rates and (Primitive) Intraperiod Interest Rates
gemAssetExchange_MatthewEffect_2_2

An Example Illustrating the Matthew Effect of Asset Exchange
demInsufficientDemand_3_3

A Disequilibrium Model Illustrating Insufficient Demand (Supply-demand Structural Mismatch)
ge_tidy

Tidy a General Equilibrium
demCreditPolicy

A Disequilibrium Model with Credit
SCES_A

Standard CES Demand Coefficient Matrix
gemAssetPricing_CUF

Compute Asset Market Equilibria with Commodity Utility Functions for Some Simple Cases
demand_coefficient

Compute Demand Coefficients of an Agent with a Demand Structural Tree
gemCanonicalDynamicMacroeconomic_Sequential_WagePostpayment_4_3

A Canonical Dynamic Macroeconomic General Equilibrium Model in Sequential Form under the Wage Postpayment Assumption (see Torres, 2016)
gemCESAK_Timeline_2_2

Some Timeline Equilibrium Models with CESAK Production Function
gemCanonicalDynamicMacroeconomic_TimeCircle_2_2

A Canonical Dynamic Macroeconomic General Equilibrium Model in Time-circle Form (see Torres, 2016)
gemCanonicalDynamicMacroeconomic_4_3

A Canonical Dynamic Macroeconomic General Equilibrium Model (see Torres, 2016)
gemAssetPricing_PUF

Compute Asset Market Equilibria with Portfolio Utility Functions for Some Simple Cases
gemCoffeeProblem_3_3

Coffee Problem: Some Examples of Equilibrium and Disequilibrium Pure Exchange Economies
gemCapitalAccumulation

Some Examples of Spot Equilibrium Paths with Capital Accumulation
gemCanonicalDynamicMacroeconomic_3_2

A Canonical Dynamic Macroeconomic General Equilibrium Model (see Torres, 2016)
gemCanonicalDynamicMacroeconomic_Timeline_2_2

A Canonical Dynamic Macroeconomic General Equilibrium Model in Timeline Form (see Torres, 2016)
gemBalancedGrowthPath

Some Examples of Balanced Growth Paths
gemEquityShare_3_3

A General Equilibrium Model with Equity Shares
gemExternality_Negative

Some Examples Illustrating Negative Externality
gemDCES_5_3

A Model with a Displaced CES Utility Function
gemExogenousUtilityLevel_EndogenousLaborSupply_3_3

Some Examples with Exogenous Utility Level and Endogenous Labor Supply
gemExogenousPrice

Some Examples with Exogenous Price (Price Control)
gemConstantGrowthPath_TechnologyProgress_3_3

Constant Growth Paths with Technology Progress
gemDualLinearProgramming

General Equilibrium Models and Linear Programming Problems (see Winston, 2003)
gemExogenousPrice_EndogenousLaborSupply_3_3

An Example of Price Regulation and Endogenous Labor Supply (Example 9.5 of Li, 2019)
gemEquityShare_Bond_4_4

A General Equilibrium Model with Equity Shares and Bond
gemDynamicMacroeconomic_SpotTrading_3_2

A Dynamic Macroeconomic General Equilibrium Model with Spot Trading
gemInputOutputTable_2_7_4

A Two-Country General Equilibrium Model
gemHeterogeneousFirms_2_3

Spot equilibrium paths with Heterogeneous Firms
gemInputOutputTable_2_2

A General Equilibrium Model based on a 2×2 (Unbalanced) Input-Output Table
gemInputOutputTable_2_8_4

A Two-Country General Equilibrium Model with Money
gemExternality_Positive

Some Examples Illustrating Positive Externality
gemInputOutputTable_5_4

A General Equilibrium Model based on a 5×4 Input-Output Table (see Zhang Xin, 2017, Table 8.6.1)
gemInputOutputTable_5_5

General Equilibrium Models based on a 5×5 Input-Output Table (see Zhang Xin, 2017, Table 3.2.1)
gemInformation_ProductQuality

An Example Illustrating Product Quality Information
gemInputOutputTable_2_7_2

A Two-Country General Equilibrium Model
gemFirmAsConsumer

Some Examples of Treating Firms as Consumer-Type Agents
gemIntertemporalStochastic_ThreePeriods_2_2

A Three-Period Intertemporal Stochastic Equilibrium Model with a Consumer and a Type of Firm
gemInputOutputTable_easy_5_4

An Easy General Equilibrium Model based on a 5×4 Input-Output Table (see Zhang Xin, 2017, Table 8.6.1)
gemIntertemporalStochastic_Bank_ThreePeriods

An Intertemporal Stochastic Model with a Consumer and Some Banks
gemIntertemporalStochastic_TwoPeriods

Some Examples of a Two-Period Intertemporal Stochastic Equilibrium Model
gemInputOutputTable_Leontief_3_3

A Leontief-type General Equilibrium Model based on a 3×3 Input-Output Table
gemIntertemporalStochastic_Bank_TwoPeriods

An Intertemporal Stochastic Model with a Consumer and a Bank
gemInputOutputTable_7_4

A General Equilibrium Model based on a 7×4 (Standard) Input-Output Table
gemInputOutputTable_8_8

A General Equilibrium Model based on an 8×8 Input-Output Table
gemIntertemporal_1_2

An Example of a 1-by-2 Intertemporal Equilibrium Model
gemInputOutputTable_SCES_3_3

A SCES-type General Equilibrium Model based on an Input-Output Table.
gemIntertemporal_Bank_1_3

Some Examples of an Intertemporal Model with Two Consumers and a Type of Bank
gemIntertemporal_2_2

Some Examples of a 2-by-2 Intertemporal Equilibrium Model
gemIntertemporal_5_5

Some Intertemporal (Timeline and Time-circle) Models with Land, Two Consumers, and Three Types of Firms
gemIntertemporal_4_4

An Intertemporal Model with Land, Two Consumers and Two Types of Firms
gemIntertemporal_AdValoremClaim

Some Intertemporal Models with Ad Valorem Claim
gemIntertemporal_3_3

Some Examples of Intertemporal Models with One Consumer and Two Types of Firms
gemIntertemporal_Bank_1_2

Some Examples of an Intertemporal Model with a Consumer and a Type of Bank
gemIntertemporal_3_4

An Intertemporal Model with Two Consumers and Two Types of Firms
gemIntertemporal_Dividend

The Identical Steady-state Equilibrium: Four Models Illustrating Dividend
gemIntertemporal_Dividend_TechnologicalProgress

The Identical Steady-state Equilibrium: Four Models Illustrating Dividend and Technological Progress
gemIntertemporal_TimeCircle_Bank_1_2

Some Examples of a Time Circle Model with a Consumer and a Type of Bank
gemIntertemporal_TimeCircle_3_4

A Time Circle Model with Two Consumers and Two Types of Firms
gemIntertemporal_EndogenousEquilibriumInterestRate

An Example Illustrating Endogenous Equilibrium Interest Rates in a (Timeline) Transitional Equilibrium Path
gemIntertemporal_TimeCircle_3_3

A Time Circle Model with One Consumer and Two Types of Firms
gemIntertemporal_PublicFirm

Some Examples of Intertemporal (Timeline) Models with Production and Public Firms
gemIntertemporal_TimeCircle_2_2

Some Examples of a 2-by-2 Time Circle Equilibrium Model
gemIntertemporal_Money_Dividend_Example7.5.1

The Identical Steady-state Equilibrium: Three Models with Money and Dividend
gemIntertemporal_TimeCircle_Stochastic_2_2

Some 2-by-2 Time Circle Models with Uncertainty
gemIntertemporal_EndogenousEquilibriumInterestRate_MoneyVelocity

An Example Illustrating Endogenous Equilibrium Interest Rates and the Velocity of Money in a (Timeline) Transitional Equilibrium Path
gemIntertemporal_EndogenousEquilibriumInterestRate_ForeignExchangeRate

An Example Illustrating Endogenous Equilibrium Interest Rates and Foreign Exchange Rates in a Two-country (Timeline) Transitional Equilibrium Path
gemNonexcludability

Some Examples Illustrating Non-excludability
gemMarketClearingPath_2_2

Some Examples of Spot Equilibrium Paths
gemOLGF_PureExchange

Overlapping Generations Financial Sequential Models for Pure Exchange Economies
gemNonrivalry_Uncongestiblity

Some Examples Illustrating Uncongestible Non-rival Goods
gemMoney_3_3

Some 3-by-3 General Equilibrium Models with Money and Exogenous Interest Rate
gemMoney_3_2

A General Equilibrium Model with Money
gemOLGF_OneFirm

Overlapping Generations Financial Sequential Models with One Firm
gemLand_Labor

Some Examples of Spot Equilibrium Paths Involving Land and Labor
gemLand_Labor_Capital_4_3

Some Examples of Spot Equilibrium Paths Involving Land, Labor and Capital
gemNonrivalry_Congestiblity

Some Examples Illustrating Congestible Non-rival Goods
gemOLGF_TwoFirms

Overlapping Generations Financial Sequential Models with Two Firms
gemOLG_Basic

Some Examples of Basic (Timeline) OLG Models with Production
gemOLG_PublicFirm

Some Examples of (Timeline) OLG Models with Production and Public Firms
gemOLG_PureExchange

The Basic Overlapping Generations Pure Exchange Model (see Samuelson, 1958)
gemOLG_PrivateFirm

Overlapping Generations Models with Private Firm
gemOLG_Land_4_3

An Overlapping Generations Model with Land
gemOLG_PureExchange_Bank

Overlapping Generations Pure Exchange Models with Bank
gemOLG_StochasticSequential_3_3

A 3-by-3 OLG Stochastic Sequential General Equilibrium Model
gemOLG_StochasticSpotEquilibrium_3_3

An Example Illustrating OLG Stochastic Spot Equilibrium Paths
gemOLG_TimeCircle

Time-Circle Models (Closed Loop Overlapping Generations Models)
gemRobinson_3_2

A Robinson Crusoe Economy
gemShortTermInvestment_2_3

Some Examples Illustrating Short-Term Investment
gemQuasilinearPureExchange_2_2

A Pure Exchange Economy with a Quasilinear Utility Function
gemResearchDevelopmentIntensity

Some Examples of Spot Equilibrium Paths Illustrating Research and Development Intensity
gemSkill

Some General Equilibrium Models with Skill (i.e. Human Capital)
gemSpotEquilibriumPath_StickyDecisions

Some Examples of Spot Equilibrium Paths with Sticky Decisions
gemPersistentTechnologicalProgress

Some Examples of Spot Equilibrium Paths with Persistent Technological Progress
gemPureExchange

Some Simple Pure Exchange Equilibrium Models
gemOpenEconomy_4_4

A 4-by-4 Open Economy with Bond
gemOpenEconomy_6_6

A 6-by-6 Open Economy with Bond
gemTax_QuasilinearPreference_4_4

A General Equilibrium Model with Tax and Quasilinear Utility Functions.
gemStickyPricePath_2_2

Some Examples Illustrating the Sticky-Price Path and Business Cycles
gemStickyDecisionPath_2_2

An Example Illustrating the Sticky-Decision Path and Business Cycles
gemTax_3_3

Some General Equilibrium Models with Tax
gemTax_VAT_IncomeTax_5_4

A General Equilibrium Model with Value-added Tax and Income Tax
gemTechnologyProgress_PopulationGrowth

Some General Equilibrium Models with Technology Progress and Population Growth
gemTemporaryEquilibriumPath

Some Examples of Temporary Equilibrium Paths
gemTax_5_4

A General Equilibrium Model with Tax (see Cardenete et al., 2012).
gemTax_5_5

A General Equilibrium Model with Tax
gemTax_4_4

Some General Equilibrium Models with Endogenous Tax Rates
gemTwoCountry_Tariff_9_5

An Example of Two-Country Economy with Tariff
gem_3_3

Some Simple 3-by-3 General Equilibrium Models
gemTwoCountry_RealExchangeRateIndex_7_4

Calculating Real Exchange Rate Index
gemTwoIndustries_4_3

A 4-by-3 Economy with Two Industries
gem_3_2

Some Simple 3-by-2 General Equilibrium Models
gemTwoCountryForeignExchangeRate_6_6

Example 7.6 (Foreign Exchange Rate) in Li (2019)
gemTwoCountryPureExchange_Bond

Some Examples of Two-Country Pure Exchange Economy with Bond
gemTwoCountryPureExchange

Some Examples of Two-Country Pure Exchange Economy
gem_2_2

Some Simple 2-by-2 General Equilibrium Models
iterate

Iteration Function
gem_3_4

Some Simple 3-by-4 General Equilibrium Models
gemstEndogenousProductionFunction_2_2

A General Equilibrium Model with Endogenous Production Function
gemstEndogenousLaborSupply_2_2

A General Equilibrium Model with Endogenous Labor Supply
gemstStructuralMultipleEquilibria_2_2

Structural Multiple Equilibria and Structural Transition Policy
gemTwoCountry_Bond_7_4

An Example of Two-Country Economy with Bond
gemstEndogenousUtilityFunction

Some General Equilibrium Models with Endogenous Utility Function
gem_4_4

Some Simple 4-by-4 General Equilibrium Models
makeCountercyclicalProductTax

Make a Countercyclical Product Tax Policy Function
growth_rate

Compute the Growth Rate
marginal_utility

Marginal Utility
matrix_add_by_name

Add Matrices by Names of Columns and Rows
makePolicySupply

Make a Policy of Supply
gemstIntertemporal_EndogenousProductionFunction_2_2

An Intertemporal Equilibrium Model with Endogenous Production Function
makePolicyStickyPrice

Make a Policy of Sticky Price
makePolicyIncomeTax

Make a Policy of Income Tax
makePolicyHeadAdjustment

Make a Policy of Head Adjustment for a Timeline Model
makePolicyHeadTailAdjustment

Make a Policy of Head and/or Tail Adjustment for a Timeline Model
makePolicyTailAdjustment

Make a Policy of Tail Adjustment for a Timeline Model
makePolicyTechnologyChange

Make a Policy of Technology Change
node_insert

Insert Nodes into a Tree
node_new

Create a Tree
makePolicyMeanValue

Make a Mean Value Policy Function
node_plot

Plot a Tree and Show the Type Attribute
node_print

Print a Tree and Its Fields
node_prune

Prune Nodes off a Tree by Names
node_replace

Replace a Node of a Tree
output

Compute the Utility of a Consumer or the Output of a Firm by the Demand Structural Tree
node_set

Create a Tree or Set Attributes for a Node
policyMarketClearingPrice

Market-Clearing-Price Policy Function
matrix_aggregate

Aggregate Some Rows and Columns of a Matrix
matrix_to_dstl

Convert a Matrix into a Demand Structural Tree List
var.p

Population Variance and Population Standard Deviation
rate_to_beta

Conversion between a Rate Vector and a Beta Vector
sdm2

Structural Dynamic Model (alias Structural Growth Model) Version 2
ratio_adjust

Ratio Adjustment
structural_function

Structural Function
sserr

Compute the Return Rate in the Steady State Equilibrium
sdm_dstl

Structural Dynamic Model (alias Structural Growth Model) with a Demand Structure Tree List
policyMeanValue

Mean Value Policy Function