楼主: huahelan
3383 1

[问答] R中的optimx优化 [推广有奖]

  • 0关注
  • 1粉丝

高中生

12%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
494 点
帖子
26
精华
0
在线时间
0 小时
注册时间
2014-12-10
最后登录
2022-5-2

楼主
huahelan 发表于 2014-12-13 13:01:01 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
     大家能帮我解读一下这段代码么,在R中怎样实现这个优化。毕业论文要用这提到的方程和优化方法,但是却不知道怎样进行这个过程。模型是这样的
44.png
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{
11.png    }
   }
22.png

  #linear programming (through the R package “solveLP”)

LPresult = linear programming (inputparameters: Amatrix, bvector, cvector)

# computation ofthe criterion (as presentedin Equation 9) for this stand


33.png
# 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


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Optim OPT Tim Optimization Programming definition procedure function 毕业论文 number

33.png (9.79 KB)

33.png

33.png (9.35 KB)

33.png

沙发
DM小菜鸟 发表于 2015-1-19 15:17:20
稍微解释一下呗~

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-24 12:18