I need to minimize the objective function shown below, the variables in green boxes will be introduced to the formula and the variables in red boxes needed to be optimized and there will be a starting value for each. as of yet the optimization is not constrained. I put the formula here not to wait for a code but for the responses to have an idea about the function. What I've done so far: I searched the threads, I've tried the nlm
command on a toy function:
fn =function(x,a) {sum(100*a+(2*x^2+5*x-7))}
nlm(fn , a<-c(10),x<- c(100), hessian=TRUE)
but I couldn't get the value for the optimum (a) and I doubt that I've some errors in the formula, I am using this formula as a starting point to tackle the formula below. What I am looking for is can any one point me to the suitable function in R that I will start from.