|
new;cls;
library pgraph;
graphset;
print "Simulating Data for a Cobb-Douglas Production Function:y = K^a L^b V";
print " V = noise term, where V = exp(e), and e ~ N(0, sigma2).";
print "NOTE: V has a Log-Normal Distribution with E[V]=exp(sigma2/2), and";
print " var(V) = exp(2*sigma2) - exp(sigma2).";
a = 0.25;
b = 0.75;
sigma2 = 0.25;
/* Generate the capital and labor inputs */
K = 2 .* rndu(30,1);
L = 2 .* rndu(30,1);
/* Form the production signal and noise components */
ysig = K^a .* L^b;
v = exp(sqrt(sigma2)*rndn(30,1));
y = ysig .* v;
/* Compute the sample averages and form the conditional production levels */
AvgK = meanc(K);
AvgL = meanc(L);
ysigK = K^a .* AvgL^b;
ysigL = AvgK^a .* L^b;
/* Form the input sequences and the production surface */
SeqK = seqa(0.025,0.025,79)';
SeqL = seqa(0.025,0.025,79);
ySurf = SeqK^a .* SeqL^b;
plotdata:
_paxht = 0.25;
_ptitlht = 0.2;
_pcolor = {2 4};
_pypmax = 3;
_pzclr = {1, 9, 4, 12, 2, 10, 14};
let _plctrl = -1;
_plegctl = {2 5 1.1 4.7};
_plegstr = "Median function\000Noisy observations";
title("Cobb-Douglas Production Data (Labor fixed)");
xlabel("Capital (K)");
ylabel("Quantity Produced (Y)");
xy(K~K,ysigK~y);
waitc;
title("Cobb-Douglas Production Data (Capital fixed)");
xlabel("Labor (L)");
xy(L~L,ysigL~y);
_plegctl = 0;
|