大家能帮我解读一下这段代码么,在R中怎样实现这个优化。毕业论文要用这提到的方程和优化方法,但是却不知道怎样进行这个过程。模型是这样的
Appendix. Optimization procedure###(附件.优化过程)
# 1: main function (which is optimizedlater) ##(主函数(稍后优化))
function sub_optimization(input parameters:αi for each species i)(子优化函数(为每物种输入参数αi))
total_criterion_sum = 0
for each stand p{
#definition of linear programming variables
Amatrix = matrix(ncol=number of species,nrow= number of
inventories in this plot)
#vector corresponding to the sums of Amatrixcolumn
Initializing cvector #vectorsize: number of species
#vector of constraints: all are equal to 1
bvector= [1,1 … 1] #vector size: number ofinventories
for each species i{
for each date t{

}
}
#linear programming (through the R package “solveLP”)
LPresult = linear programming (inputparameters: Amatrix, bvector, cvector)
# computation ofthe criterion (as presentedin Equation 9) for this stand
# the criterion for all stands
total_criterion_sum = total_criterion_sum +criterion_stand
}
return(total_criterion_sum)
} #end of sub_optimization function
#2 : all.LPresult is optimized by amaximum-likelihood estimation. Outputs are αi
for each species i, constrained between 0and 3.
optim( sub_optimization, start = { αi=1.8} , lower=0, upper=3 )
#end of script