Skip to content

Instantly share code, notes, and snippets.

@trialsolution
Created October 1, 2014 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trialsolution/7d3f5faa0752450b5ef9 to your computer and use it in GitHub Desktop.
Save trialsolution/7d3f5faa0752450b5ef9 to your computer and use it in GitHub Desktop.
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"
#set output "ces_share.png"
set contour
set cntrparam levels discrete 1
set view map
unset surface
set title "Implicit plot of CES functions (different value shares)"
set xrange [0:5]
set yrange [0:5]
sigma = 2
rho = 0.5 # 1-(1/sigma)
f(x,y)=(0.5*x**rho + 0.5*y**rho)**(1/rho)
g(x,y)=(0.4*x**rho + 0.6*y**rho)**(1/rho)
h(x,y)=(0.3*x**rho + 0.7*y**rho)**(1/rho)
i(x,y)=(0.2*x**rho + 0.8*y**rho)**(1/rho)
splot f(x,y),g(x,y),h(x,y),i(x,y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment