$title  Climate Shocks and Energy Demand -- Back of the Envelope 

$ontext

We consider a three commodity general equilibrium model calibrated to
base year transactions and assumptions regarding the Marshallian
elasticities of energy supply and demand.  The model commodities are
energy, energy services and other goods.  The model follows a
Ricardo-Viner structure with three primary factors: labor and two
types of sector-specific capital.

There are two households: workers earn wage income and demand energy
services and non-energy goods.  Owners collect capital earnings demand
non-energy goods. (This simplifying assumption captures the idea that
the income elasticity of demand for energy is less than unity.

Climate change induces changes in the number of heating and cooling
degree days and thereby alters the technology for producing energy
services.  Worker demand fewer energy services when temperature
increases their cost.  

Here we demonstrate the calibration of a general equilibrium model
with respct to assumed elasticities of supply and demand.

Purposes of this model

1. Illustrate the calibration of a general equilibrium model on the
basis of assumptions regarding Marshallian elasticities of supply and
demand for energy.

2. Produce a rough back-of-the envelope estimate of the welfare cost
of climate-induced changes in the efficiency of energy services
provision (i.e., changes in heating degree days).
        
$offtext

parameter       eta     Price elasticity of energy supply /0.2/
                epsilon Price elasticity of energy demand /0.5/

                sigma   Elasticity of substitution (base on epsilon)

                e0      Base year energy demand /6/
                y0      Base year non-energy production /103/
                ls0     Leisure demand /40/
                l0      Labor demand /60/
                k0      Capital demand /43/,
                c0      Worker consumption
                shock   Energy services cost index /1/;

c0 = l0;
sigma = epsilon/(1-e0/c0);

$ontext
$model:heatcool

$sectors:
        C       !       Final consumption by the worker
        E       !       Electricity
        ES      !       Energy services
        Y       !       Other stuff

$commodities:
        PC      !       Price of consumption
        PE      !       Price of energy
        PES     !       Price of energy services 
        PY      !       Price of other stuff
        PL      !       Wage rate
        RK      !       Rental rate of capital
        PR      !       Price of energy resources

$consumers:
        WORKER  !       Representative worker
        OWNER   !       Capitalist and resource owner

$prod:E  s:eta
        o:PE    q:e0
        i:PR    q:(e0/2)
        i:PY    q:(e0/2)

$prod:Y  s:1
        o:PY    q:y0
        i:PL    q:l0
        i:RK    q:k0

$prod:C  s:sigma
        o:PC    Q:c0
        i:PES   q:e0
        i:PY    q:(l0-e0)

$prod:ES
        o:PES   q:e0
        i:PE    q:(shock*e0)

$demand:WORKER  s:1 
        d:PL    q:ls0
        d:PC    q:c0
        e:PL    q:(ls0+l0)

$demand:OWNER
        d:PY    q:(k0+e0/2)
        e:RK    q:k0
        e:PR    Q:(e0/2)

$report:
        v:W_WORKER      w:WORKER
        v:W_OWNER       w:OWNER

$offtext
$sysinclude mpsgeset heatcool

heatcool.iterlim = 0;
$include heatcool.gen
solve heatcool using mcp;
abort$round(heatcool.objval,4) "Model benchmark is inconsistent";
heatcool.iterlim = 10000;

shock = 1.01;
$include heatcool.gen
solve heatcool using mcp;

parameter       report          Summary report;

*       Use a reporting "subroutine":

$onechov >%gams.scrdir%report.scr
report("eta","%1") = eta;
report("epsilon","%1") = epsilon;
report("PE% (energy)","%1") = round(100*(PE.L/PY.L-1),1);
report("PL% (wage)","%1") = round(100*(PL.L/PY.L-1),1);
report("RK% (capital)","%1") = round(100*(RK.L/PY.L-1),1);
report("PR% (energy resources)","%1") = round(100*(PR.L/PY.L-1),1);
report("EV% (utilitarian welfare)","%1") = 100*((c0*W_WORKER.L+(k0+e0/2)*W_OWNER.L) /
                                (c0+k0+e0/2)-1);
report("EV% (worker)","%1") = 100*(W_WORKER.L-1);
report("EV% (owner)","%1") = 100*(W_OWNER.L-1);
report("Energy supply","%1") = round((E.L-1)/(PE.L/PY.L-1),1);
report("Compensated Demand","%1") = round((ES.L/C.L-1)/(PES.L/PY.L-1),1);
report("Uncompensated Demand","%1") = round((ES.L-1)/(PES.L/PY.L-1),1);
$offecho

shock = 1.10;
$include heatcool.gen
solve heatcool using mcp;
$batinclude "%gams.scrdir%report.scr" "10% Shock"

shock = 1.25;
$include heatcool.gen
solve heatcool using mcp;
$batinclude "%gams.scrdir%report.scr" "25% Shock"

shock = 2;
$include heatcool.gen
solve heatcool using mcp;
$batinclude "%gams.scrdir%report.scr" "100% Shock"

shock = 4;
$include heatcool.gen
solve heatcool using mcp;
$batinclude "%gams.scrdir%report.scr" "400% Shock"

option report:1;
display report;

$ontext

----   1247 PARAMETER report  Summary report

                            10% Shock   25% Shock  100% Shock  400% Shock

eta                               0.2         0.2         0.2         0.2
epsilon                           0.5         0.5         0.5         0.5
PE% (energy)                      4.9        11.9        42.2       100.2
PR% (energy resources)            9.9        24.1        87.2       212.1
EV% (utilitarian welfare)        -0.2        -0.5        -1.8        -3.8
EV% (worker)                     -0.9        -2.1        -7.5       -17.4
EV% (owner)                       0.6         1.6         5.7        13.8
Energy supply                     0.2         0.2         0.1         0.1
Compensated Demand               -0.4        -0.4        -0.2        -0.1
Uncompensated Demand             -0.5        -0.5        -0.3        -0.1

$offtext