102-2-商業 & 經濟預測期末-上機考3-v2 (模擬考3)


########M TimeToStart = 2010-04-23 15:20:00
#M TimeSpan =1200
M TimeSpan =900
# ---測試用--- M TimeSpan =10
# ----- 回合時間設定: 前 1回合較長, 因為 要分析資料
# V Next Timespan = if(simstep<1,90,90)
V Next Timespan = if(simstep<1,90,60)
# ---測試用--- V Next Timespan = if(simstep<1,10,10)
#### Training for prediction
# 2014.05.29 目前資料是用 Taiwan GDP 2003Q4-2013Q4
# 2014.05.29 在完全猜中時, RMSE 計算會發生錯誤 (因為只取小數2位), 將 err1/err2 的判斷, 改成 abs(err1) # 2014.05.22 修改細節:(1) 第0期預測誤差丶RMSE 顯示為 0,未輸入資料=NONE,predictX=0
# 2010.06.22 時間控制有3個地方要改
# 1. TimeSpan: 前置準備時間 (第0回合)
# 2. Next Timespan=if(simstep<1,t1,t2) t1 是第一回合的時間, t2 是第二回合的時間 # 2010.05.05: 用 DJI 2004年的前40筆資料 # # --------- general system settings --------- # The model runs from 0 to 30 weeks. M StartTime = 0 M EndTime = 20 M InitialSteps=0 M TimeFormat = "day #0" M NumberFormat = "###0.##" M TERMINATE = IF (simstep>=30 , 1 , 0)

v BOB=20
v Close=userrand
p close.label=”實際值”
D predict1 = if(SimStep<1,0,(-10000,31000))
p predict1.label=”你的預測1:”
#D predict2 = (-10000,31000)
D predict2 = if(SimStep<1,0,(-10000,31000))
p predict2.label=”你的預測2:”

v err1=if(SimStep<1,0,close-if(predict1=NONE,0,predict1))
p err1.label=”當期預測誤差1″
v err2=if(SimStep<1,0,close-if(predict2=NONE,0,predict2))
p err2.label=”當期預測誤差2″

v u1sq=if(abs(err1)<0.01,0,err1*err1)
p u1sq.label=”預測誤差1的平方”
v u2sq=if(abs(err2)<0.01,0,err2*err2)
p u2sq.label=”預測誤差2的平方”

v RMSE1 = (ACCUM(u1sq,0)/(simStep))^0.5
v RMSE2 = (ACCUM(u2sq,0)/(simStep))^0.5
v minRMSE=min(RMSE1,RMSE2)
F Figure 1={“Close”,”predict1″,”predict2″}
F Figure 1.label=”Fig. 1實際值 vs 預測值”
F Figure 2={“err1″,”RMSE1″,”err2″,”RMSE2″}
F Figure 2.label=”Fig. 2預測誤差 & RMSE”
T Table 1={“Close”,”predict1″,”err1″,”RMSE1″,”predict2″,”err2″,”RMSE2″}

How to play

<h1>經濟與商業預測模考</h1>
<font size=+1>
注意! 當期來不及輸入預測值資料時,電腦會將該期之預測值自動設為 <font size=+2 color=red>0</font>,但是預測值處仍顯示成空白
</font>
<font size=+2 color=blue>前 20 筆資料:</font>

1533.1
1478.31
1420.33
1410.23
1387.67
1401.08
1379.44
1317.17
1297.74
1305.9
1292.96
1290.8
1316.5
1337.96
1344.18
1310.86
1302.58
1238.89
1203.74
1216.88

 遊戲統計

<h1>預測遊戲已經結束!</h1>

<font size=+2 color=red>
你的 RMSE1 = [[RMSE1]]
你的 RMSE2 = [[RMSE2]]
</font>

,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: