Displaying 1 result from an estimated 1 matches for "b1bar".
Did you mean:
r1bar
2010 Sep 21
2
Trouble with Optimization in "Alabama" Package
...tions 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[1]^y[5])*(x[3]^(1-y[5])))-((y[1]^y[5])*(y[3]^(1-y[5])))
h[2]=((x[2]^y[6])*(x[4]^(1-y[6])))-((y[2]^y[6]...