/* does kandel stambaugh type calculations */ library pgraph; format /RD 10,2; c = 50000; gam = 2~10~50~100~250; y = 10|100|1000|10000; xc = 1 - (0.5.*(1+y./c)^(1-gam) + 0.5.*(1-y./c)^(1-gam))^(1/(1-gam)); format /RD 10,2; (0~gam)|(y~(xc.*c)); "approximate"; (0~gam)|(y~(0.5.*gam.*c.*(y./c)^2)); /* insurance example */ /* c = 50000; delt = 0.95; gam = 10; p = 0.01; y = 12000/c; /* cy = rent */ delt.*(p.*(1-y)^(1-gam) + (1-p)); "should be less than one"; xa = c.*delt.*p.*y./(1-delt.*(1-p.*y)); x = c.*( 1 - ( (1-delt) ./ (1 - delt.*(p.*(1-y)^(1-gam)+1-p)))^(1/(1-gam)) ); "xa" xa; "x" x; */