Tune parameters from a specific equation in R This is the first time I am truing to tune model parameters in R. I have a fairly complicated equation with multiple parameters:
wage <- 6375
alfa <- 11.25
beta <- 0.39
phi <- 0.16
psi <- 0
def.labor <- 38/255
ag.cost <- 30
def.cost <- 100
net.carbon <- 418
ag.price <- 1.7*1000
pes <- 5
r <- 0.06

(((wage*beta^(1-(1/phi))*alfa^(-1/phi)*ag.price^(-1/phi)*(-r*def.cost+net.carbon*pes+ag.cost-r*psi*def.labor-r*psi+psi)^((1/phi)-1))/phi)^(phi/(beta+phi-1)))

The equation returns an estimated AREA. I would like to tune the parameters ALFA, BETA, and PHI to approximate the estimated area to a real observed area. I have looked into some model tuning packages available for R but as I understood they do not let me select the functional form of my equation, so I wonder if anyone is aware of a package that would allow me to do so? Thank you in advance.
 A: You are trying to solve one nonlinear equation in 3 variables.  As @whuber pointed out in a comment to the question, there is a two-dimensional (infinity) of solutions to your problem.
Something along the lines of package nleqslv in R might do the trick (I've never tried it). You could also use a function for nonlinear least squares, by taking the square of the difference between left-hand side and 12.5 as the objective function.
I used other methods, which for purposes of this discussion are irrelevant, in order to provide 3 different solutions. For each solution, I fixed 2 of the variables at the original values and solved for the 3rd.  But there is a two-fold infinity of other solutions.
Solution 1: alfa = 13.6714, beta = 0.39, phi = 0.16
Solution 2: alfa = 11.25, beta = 0.4327, phi = 0.16
Solution 3: alfa = 11.25, beta = 0.39, phi = 0.2677
As whuber suggested, you can impose various constraints, or incorporate them into an objective function, if you wish to focus the solutions in a particular way.   You could even put a tolerance around 12.5 and not insist the equation be solved exactly.
