Skip to content

Instantly share code, notes, and snippets.

@trialsolution
trialsolution / non_homothetic_isoquants.plt
Created April 3, 2017 08:56
plot indifference curves of non-homothetic CES variants
# plot the indifference curves of non-homothetic CES variants
# script based on the implicit function plotting trick from:
# http://gnuplot-surprising.blogspot.de/2011/09/assume-three-is-equation-fxygxy-and-we.html
# uncomment in case you want to save it to a file
#set term png enhanced lw 2 font "Times,18"
#set output "ces_share.png"
@trialsolution
trialsolution / ces_elas.plt
Created October 1, 2014 10:14
CES indifference curves with different elasticities
#
# GNUPLOT script to draw CES functions with different parameters
#
# script based on the implicit function plotting trick from:
# http://gnuplot-surprising.blogspot.de/2011/09/assume-three-is-equation-fxygxy-and-we.html
# uncomment in case you want to save it to a file
#set term png enhanced lw 2 font "Times,18"
#set output "ces_elas.png"
@trialsolution
trialsolution / ces_shares.plt
Created October 1, 2014 10:13
CES indifference curves with different value shares
#
# GNUPLOT script to draw CES functions with different parameters
#
# script based on the implicit function plotting trick from:
# http://gnuplot-surprising.blogspot.de/2011/09/assume-three-is-equation-fxygxy-and-we.html
# uncomment in case you want to save it to a file
#set term png enhanced lw 2 font "Times,18"
@trialsolution
trialsolution / draw_PPF.gms
Last active August 29, 2015 14:02
Howto draw a PPF using the GUSS solver option in GAMS
*
* Howto draw a PPF using the GUSS solver option in GAMS
*
* This file is an extension of
* the long-run production problem, as described in Chapter 5 of
* Gilbert and Tower: Introduction to Numerical Simulation for Trade Theory and Policy.
*
* for download of the original model go to
* http://ideas.repec.org/c/uth/gt2013/2012-03.html
*
@trialsolution
trialsolution / nonzero_trade.gms
Created June 3, 2014 10:18
Calibrate the small country HOS model to nonzero trade (Chapter 12, exercise 3 in Gilbert-Tower book)
*
* --- Small country trading equilibrium
*
* Reasons for trade in the single country HO model
* Differences in good and factor prices and factor intensities
*
*
@trialsolution
trialsolution / chap5_gt.gms
Last active August 29, 2015 14:02
Exercise to chapter five of Gilbert and Tower: Introduction to Numerical Simulation for Trade Theory and Policy
*
*
* This file is an extension of
* the long-run production problem, as described in Chapter 5 of
* Gilbert and Tower: Introduction to Numerical Simulation for Trade Theory and Policy.
*
* for download of the original model go to
* http://ideas.repec.org/c/uth/gt2013/2012-03.html
*
@trialsolution
trialsolution / hos_small_open.gms
Created May 31, 2014 15:21
2x2 HOS model for a small open economy
*
* --- Small country trading equilibrium
*
* Different variants of the same model:
*
*
* (1) explicit trade balance condition [import value = export value] or 'nested' budget constraint [max. income = production value]
@trialsolution
trialsolution / salhofer1996.gms
Created February 10, 2014 18:56
Finding efficient policy combinations in an optimization framework, aka Salhofer (1996)
* GAMS code based on the bread grain market model in
* Salhofer (1996), “Efficient Income Redistribution for a Small Country Using Optimal Combined Instruments.”
* Salhofer, K. 1996. “Efficient Income Redistribution for a Small Country Using Optimal Combined Instruments.” Agricultural Economics 13 (3): 191–99. doi:10.1016/0169-5150(95)01162-5.
* The code builds on Salhofer's GAMS example provided in the course "Welfare Economics"
* General idea of the optimization model:
* Maximizes consumers/taxpayers surplus s.t. a given support level and four policy instruments
@trialsolution
trialsolution / bach_martin_2001.gms
Created November 21, 2013 09:41
Numerical example from Bach-Martin (2001): “Would the Right Tariff Aggregator for Policy Analysis Please Stand Up?” Journal of Policy Modeling 23 (6) page 630-632
********************************************************************************
$ontext
CAPRI project
GAMS file : REGAGG.GMS
@purpose :
@author : Mihaly Himics (mihaly.himics@ilr.uni-bonn.de)
@date : 21.11.13
@trialsolution
trialsolution / ces_example.gms
Created November 14, 2013 11:44
Example in Rutherford's Lecture Notes on CES functions, page 4 http://www.gamsworld.eu/mpsge/debreu/ces.pdf
*<%REGION File header%>
*=============================================================================
* File : rutherford_ex1.gms
* Author : mihalyh
* Version : 1.0
* Date : 13.11.2013 10:58:08
* Changed : 13.11.2013 13:13:56
* Changed by: mihalyh
* Remarks :
$ontext