2011-Dutch Auction Experiment (v 1.0)

  • 假設若干人為一組 (3個人似乎比較OK), 每個人每一回合皆隨機取得自身 IPV.
  • 價格由 InitialPrice 開始下降, 每 TimeSpan 秒下降 decrement 元, 下降到 0 元為止. 因此, 每一回合會有 NOTP 期.
  • 受測者每一期皆看到 目前價格, 並作出決策. 決策有二:   拒絕價格 or 接受價格 (Accept 變數).
  • 若於 NTOP 期前, 拍賣已經結束, 則必須等待所有期數後, 始能進入下一回合.
  • 預計進行 NR 回合.

#=============================================================================
# 2011-Dutch auction experiment for 6 persons by yinung
#-----------------------------------------------------------------------------
#    * 假設若干人為一組 (3個人似乎比較OK), 每個人每一回合皆隨機取得自身 IPV.
#    * 價格由 InitialPrice 開始下降, 每 TimeSpan 秒下降 decrement 元, 下降到 0 元為止. 因此, 每一回合會有 NOTP 期.
#    * 受測者每一期皆看到 目前價格, 並作出決策. 決策有二:   拒絕價格 or 接受價格 (Accept 變數).
#    * 若於 NTOP 期前, 拍賣已經結束, 則必須等待所有期數後, 始能進入下一回合.
#    * 預計進行 NR 回合.
#-----------------------------------------------------------------------------
# 2011.04.25
#         使用 dutch.htm 來當做 textinfo
#=============================================================================
M TimeToStart = 2011-05-07 23:06:28
M InitialSteps=0
M ENDTIME = 240
M TERMINATE = if(simStep>=NR*NOTP,1,0)
M NumberFormat = "#,##0.##"
M ROLEASSIGN = "random"
M showidentity=0

# --------- 以下是可能會改的 參數 -----model setting ------------------------------
# --- 控制每一期幾秒
M TimeSpan = 10
# 起始價格
V InitialPrice=10
# 每次降價幅度
V decrement=1
# --- NR = number of rounds 要玩幾輪
V NR=10
# 分組指令: 6 人一組; 要更多人或更少人應該都可以 ...
G person = {"bidder1", "bidder2", "bidder3", "bidder4", "bidder5", "bidder6"}
# 願付價格的上、下界
V upper = 11
V lower = 0
#=============================================================================
# ------------------------------以下程式碼應該不會動到 ---------------------------

# --- NOTP = number of total period, 每一 輪 (round) 所含的期數
V NOTP=round(InitialPrice/decrement)+1
V mySimStep=SimStep + 1
V TimeLeft=NOTP-mod(SimStep,NOTP)
P TimeLeft.label="還有幾期"

#想讓玩家知道遊戲目前進行到第幾輪? (2011.05.07 YNY:改成自動計算 seeRound)
V SeeRound=INT(simStep/NOTP) + 1
#  V SeeRound=INT(simStep/11) + 1
P SeeRound.label="第幾輪"

# ---- V pv = int(randbetween(lower,upper))+(100/4*int(randbetween(1,4.99)))/100
# --- pv 取小數兩位
#   V pv = int(randbetween(lower,upper)*100)/100
V pv = randbetween(lower,upper)
#   V myPV = if(OR(mod(mySimStep,NOTP)=1,mySimStep=1),previous(pv),previous(myPV,0))
V myPV = if(mod(mySimStep,NOTP)=1,previous(pv),previous(myPV,0))
P myPV.label="我的願付價格"

D Accept = if(OR(mySimStep<=0,flag=1),NA,{0,1})
P Accept.label = "我的決策"
P Accept.desc = {"拒絕", "接受此價格"}

V Price=if(mod(mySimStep,NOTP)=1,InitialPrice,Previous(Price,InitialPrice)-decrement)
P Price.label="本期價格"

# ---- subject 看到的是 "下一期價格", 如此下決策才會在下一期呈現, winPrice 和 payoff 也要用此計算
#   V NextPrice=Previous(Price,InitialPrice)
#   P NextPrice.label="下一期價格"

# 用小數點的 decimal 用來決定同時按接受時, 誰得標
V decimal = randbetween(0,0.99)
V Accept0=Accept+decimal

#### 使用 G_sum 來抓群組中, 有誰按「接受」
V flag_accept=if(Accept=1,1,0)
v NumberofAccept=G_sum("flag_Accept")
# --- 2011.04.25: 檢查是否有 2 人以上, 同時按「接受」; 若有, 則以 Accept0 最大者得標
v winner=if(NumberofAccept>1,if(Accept0=G_max("Accept0"),1,0),Accept)
# --- 記住得標價 (只要 winner =0, 表示沒人得標; 若 winner = 1, 則表示有人得標
v winPrice = Previous(Price)*winner
V g_winPrice=G_sum("winPrice")
P g_winPrice.label = "得標價格"
# --- flag = 1 表示此輪中已有人得標, mod(mySimSetp,NTOP) =1 時則重新設 =0
V flag=if(mod(mySimStep,NOTP)=1,0,if(NumberOfAccept>0,1,Previous(flag,0)))

### 以下計算 payoff 的方式為, 在第一回合加入 initial cash balance $5
v payoff= winner*(Previous(myPV,0)-winPrice)
P payoff.label="回合獲利"

v acc_payoff=ACCUM(payoff,0)
P acc_payoff.label="累計獲利"

T table 1={"SeeRound","TimeLeft","Price","myPV","Accept","payoff","acc_payoff","g_winPrice"}
#T table 1={"TimeLeft","Price","myPV","Accept","payoff","acc_payoff","winner","winPrice"}
T table 2={"pv","myPV","Accept","Accept0","winner","winPrice","NumberofAccept","flag","winPrice"}
M TextInformation = "dutch.htm"

  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: