I wanted to do a modelling like this, many variables, will simplificate for understanding y1 in [a1,b1] => (weight 1) => number 1.1 y2 in [a1,b1] => (weight 1) => number 1.2 y3 in [a1,b1] => (weight 1) => number 1.3 y4 in [a1,b1] => (weight 1) => number 1.4 y5 in [a1,b1] => (weight 2) => number 2.1 y6 in [a1,b1] => (weight 2) => number 2.2 ... ... ... I have many variables and each of them i restricted to a interval. There are many inputs and a weight to next step ( that problem won't be a single step or maybe will be a more difficult weight). Probably i will put prioris on some of the weights also. The weight is known, or probably will be a priori with parameters inserted. I wanted to estimate the vector (y1,y2,y3,y4,y5,y6) that maximize the sum of numbers 1.1,1.2,1.3,1.4,2.1,2.2...restricted to y1*number 1.1 + y2*number 1.2 + y3*number 1.3 + y4*number 1.4+ y5*number 1.5 + y6*number 1.6 + < H, where H is fixed. Can I do this or is there a problem of identification here? Is there a package in R that do this? Thanks in advance. [[alternative HTML version deleted]]