玩控 发表于 2019-9-29 16:04:24

EViews-蒙特卡洛模型代码


脚本 config.png 代码:

!b1=0
!b2=1
matrix(500,3) f

for !k=1 to 500

series u=nrnd
series y= !b1+!b2*temp+u
equation el.ls y=c(1)+c(2)*temp

series y1=constant-y/10.0
series y2=(y1>0)*y1+(y1<0)*0
series hdd=@sum(y2)

f(!k,1)=@sum(hdd)
f(!k,2)=500
f(!k,3)=exp(-0.15)/500*((f(!k,1)>f(!k,2))*(f(!k,1)-f(!k,2)) + ( f(!k,1)<f(!k,2))*0)

next

karstification 发表于 2019-10-7 09:51:40

谢谢你的分享
页: [1]
查看完整版本: EViews-蒙特卡洛模型代码