search for: cobbdouglas

Displaying 1 result from an estimated 1 matches for "cobbdouglas".

2010 Sep 21
2
Trouble with Optimization in "Alabama" Package
..., I had to include an additional argument to the functions so I could bring the parameters of the utility functions and the initial production into the optimization. I've written the following code but I keep getting strange errors: library(alabama) # y is a vector of initial allocations and CobbDouglas preference parameters #y=c(r1,r2,b1,b2,alpha1,alpha2) y=c(5,50,60,5,.3,.7) # p1=c(r1bar,r1bar,b1bar,b1bar) a feasible allocation p1=c(15,40,50,15) fn=function(x,...){ return(-1*(((x[1]^y[5])*(x[3]^(1-y[5])))*(((x[2]^y[6])*(x[4]^(1-y[6])))))) } hin=function(x,...){ h=rep(NA,2) h[1]=((x...