Skip to content

Commit 147496a

Browse files
authored
Merge pull request #33 from youngahn/develop
Merge (v0.5.1)
2 parents 09050aa + 6317244 commit 147496a

40 files changed

+19368
-3380
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: hBayesDM
22
Title: Hierarchical Bayesian Modeling of Decision-Making Tasks
3-
Version: 0.5.0
4-
Date: 2017-12-25
3+
Version: 0.5.1
4+
Date: 2018-03-25
55
Authors@R: c(
66
person("Woo-Young", "Ahn", email = "wooyoung.ahn@gmail.com", role = c("aut", "cre")),
77
person("Nate", "Haines", email = "haines.175@osu.edu", role = c("aut")),

NAMESPACE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,17 @@ export(prl_ewa)
3333
export(prl_fictitious)
3434
export(prl_fictitious_multipleB)
3535
export(prl_fictitious_rp)
36+
export(prl_fictitious_rp_woa)
37+
export(prl_fictitious_woa)
3638
export(prl_rp)
3739
export(prl_rp_multipleB)
3840
export(ra_noLA)
3941
export(ra_noRA)
4042
export(ra_prospect)
4143
export(rhat)
44+
export(ts_par4)
45+
export(ts_par6)
46+
export(ts_par7)
4247
export(ug_bayes)
4348
export(ug_delta)
4449
import(Rcpp)

R/hBayesDM.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@
2828
#' Value-Plus_Perseverance --- \link{igt_vpp}}
2929
#' \item{\strong{Peer influence task}}{OCU model --- \link{peer_ocu}}
3030
#' \item{\strong{Probabilistic Reversal Learning}}{Fictitious Update --- \link{prl_fictitious} \cr
31+
#' Fictitious Update w/o alpha (indecision point) --- \link{prl_fictitious_woa} \cr
3132
#' Fictitious Update and multiple blocks per subject --- \link{prl_fictitious_multipleB} \cr
3233
#' Experience-Weighted Attraction --- \link{prl_ewa} \cr
3334
#' Reward-Punishment --- \link{prl_rp} \cr
3435
#' Reward-Punishment and multiple blocks per subject --- \link{prl_rp_multipleB} \cr
35-
#' Fictitious Update with separate learning for Reward-Punishment --- \link{prl_fictitious_rp}}
36+
#' Fictitious Update with separate learning for Reward-Punishment --- \link{prl_fictitious_rp} \cr
37+
#' Fictitious Update with separate learning for Reward-Punishment w/o alpha (indecision point) --- \link{prl_fictitious_rp_woa}}
3638
#' \item{\strong{Risk Aversion}}{Prospect Theory (PT) --- \link{ra_prospect} \cr
3739
#' PT without a loss aversion parameter --- \link{ra_noLA} \cr
3840
#' PT without a risk aversion parameter --- \link{ra_noRA}}
@@ -42,14 +44,18 @@
4244
#' Drift Diffusion Model for single subject --- \link{choiceRT_ddm_single} \cr
4345
#' Linear Ballistic Accumulator --- \link{choiceRT_lba} \cr
4446
#' Linear Ballistic Accumulator for single subject --- \link{choiceRT_lba_single}}
47+
#' \item{\strong{Two-Step task}}{Full model (7 parameters) --- \link{ts_par7} \cr
48+
#' 6 parameter model (without eligibility trace, lambda) --- \link{ts_par6} \cr
49+
#' 4 parameter model --- \link{ts_par4}}
50+
#'
4551
#' }
4652
#'
4753
#' @seealso
4854
#' For tutorials and further readings, visit : \url{http://rpubs.com/CCSL/hBayesDM}.
4955
#'
5056
#' @references
5157
#' Please cite as:
52-
#' Ahn, W.-Y., Haines, N., & Zhang, L. (2017). Revealing neuro-computational mechanisms of reinforcement learning and decision-making with the hBayesDM package. \emph{Computational Psychiatry}. 1:1. https://doi.org/10.1101/064287
58+
#' Ahn, W.-Y., Haines, N., & Zhang, L. (2017). Revealing neuro-computational mechanisms of reinforcement learning and decision-making with the hBayesDM package. \emph{Computational Psychiatry}. 1, 24-57. https://doi.org/10.1162/CPSY_a_00002
5359
#'
5460
#' @author
5561
#' Woo-Young Ahn \email{wooyoung.ahn@@gmail.com}

R/prl_ewa.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#'
33
#' @description
44
#' Hierarchical Bayesian Modeling of the Probabilistic Reversal Learning (PRL) Task using the following parameters: "phi" (1 - learning rate), "rho" (experience decay factor), and "beta" (inverse temperature).
5+
#' Contributor (model-based regressors): Jaeyeong Yang (https://ccs-lab.github.io/team/jaeyeong-yang/) and Harhim Park (https://ccs-lab.github.io/team/harhim-park/)
56
#'
67
#' \strong{MODEL:}
78
#' Experience-Weighted Attraction Model (Ouden et al., 2013, Neuron)

R/prl_fictitious.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#'
33
#' @description
44
#' Hierarchical Bayesian Modeling of the Probabilistic Reversal Learning (PRL) Task using the following parameters: "eta" (learning rate), "alpha" (indecision point), "beta" (inverse temperature).
5+
#' Contributor (for model-based regressors): Jaeyeong Yang (https://ccs-lab.github.io/team/jaeyeong-yang/) and Harhim Park (https://ccs-lab.github.io/team/harhim-park/)
56
#'
67
#' \strong{MODEL:}
78
#' Fictitious Update Model (Glascher et al., 2008, Cerebral Cortex)
@@ -230,7 +231,7 @@ prl_fictitious <- function(data = "choice",
230231
genInitList <- "random"
231232
} else {
232233
if (inits[1] == "fixed") {
233-
inits_fixed <- c(0.5, 0.1, 1.0)
234+
inits_fixed <- c(0.5, 0.0, 1.0)
234235
} else {
235236
if (length(inits) == numPars)
236237
inits_fixed <- inits
@@ -240,10 +241,10 @@ prl_fictitious <- function(data = "choice",
240241

241242
genInitList <- function() {
242243
list(
243-
mu_p = c(qnorm(inits_fixed[1]), qnorm(inits_fixed[2]), qnorm(inits_fixed[3] / 5)),
244+
mu_p = c(qnorm(inits_fixed[1]), inits_fixed[2], qnorm(inits_fixed[3] / 5)),
244245
sigma = c(1.0, 1.0, 1.0),
245246
eta_pr = rep(qnorm(inits_fixed[1]), numSubjs),
246-
alpha_pr = rep(qnorm(inits_fixed[2]), numSubjs),
247+
alpha_pr = rep(inits_fixed[2], numSubjs),
247248
beta_pr = rep(qnorm(inits_fixed[3]/5), numSubjs)
248249
)
249250
}

R/prl_fictitious_multipleB.R

100644100755
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#'
33
#' @description
44
#' Hierarchical Bayesian Modeling of the Probabilistic Reversal Learning (PRL) Task using the following parameters: "eta" (learning rate), "alpha" (indecision point), "beta" (inverse temperature).
5+
#' Contributor (for model-based regressors): Jaeyeong Yang (https://ccs-lab.github.io/team/jaeyeong-yang/) and Harhim Park (https://ccs-lab.github.io/team/harhim-park/)
56
#'
67
#' \strong{MODEL:}
78
#' Fictitious Update Model (Glascher et al., 2008, Cerebral Cortex)
@@ -232,7 +233,7 @@ prl_fictitious_multipleB <- function(data = "choice",
232233
genInitList <- "random"
233234
} else {
234235
if (inits[1] == "fixed") {
235-
inits_fixed <- c(0.5, 0.1, 1.0)
236+
inits_fixed <- c(0.5, 0.0, 1.0)
236237
} else {
237238
if (length(inits) == numPars)
238239
inits_fixed <- inits
@@ -242,10 +243,10 @@ prl_fictitious_multipleB <- function(data = "choice",
242243

243244
genInitList <- function() {
244245
list(
245-
mu_p = c(qnorm(inits_fixed[1]), qnorm(inits_fixed[2]), qnorm(inits_fixed[3] / 10)),
246+
mu_p = c(qnorm(inits_fixed[1]), inits_fixed[2], qnorm(inits_fixed[3] / 10)),
246247
sigma = c(1.0, 1.0, 1.0),
247248
eta_pr = rep(qnorm(inits_fixed[1]), numSubjs),
248-
alpha_pr = rep(qnorm(inits_fixed[2]), numSubjs),
249+
alpha_pr = rep(inits_fixed[2], numSubjs),
249250
beta_pr = rep(qnorm(inits_fixed[3]/10), numSubjs)
250251
)
251252
}

R/prl_fictitious_rp.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#'
33
#' @description
44
#' Hierarchical Bayesian Modeling of the Probabilistic Reversal Learning (PRL) Task using the following parameters: "eta_pos" (learning rate, +PE), "eta_neg" (learning rate, -PE), "alpha" (indecision point), "beta" (inverse temperature).
5+
#' Contributor (for model-based regressors): Jaeyeong Yang (https://ccs-lab.github.io/team/jaeyeong-yang/) and Harhim Park (https://ccs-lab.github.io/team/harhim-park/)
56
#'
67
#' \strong{MODEL:}
78
#' Fictitious Update Model (Glascher et al., 2008, Cerebral Cortex) + separate learning rates for + and - prediction error (PE)
@@ -233,7 +234,7 @@ prl_fictitious_rp <- function(data = "choice",
233234
genInitList <- "random"
234235
} else {
235236
if (inits[1] == "fixed") {
236-
inits_fixed <- c(0.5, 0.5, 0.1, 1.0)
237+
inits_fixed <- c(0.5, 0.5, 0.0, 1.0)
237238
} else {
238239
if (length(inits) == numPars)
239240
inits_fixed <- inits
@@ -243,11 +244,11 @@ prl_fictitious_rp <- function(data = "choice",
243244

244245
genInitList <- function() {
245246
list(
246-
mu_p = c(qnorm(inits_fixed[1]), qnorm(inits_fixed[2]), qnorm(inits_fixed[3]), qnorm(inits_fixed[4] / 5)),
247+
mu_p = c(qnorm(inits_fixed[1]), qnorm(inits_fixed[2]), inits_fixed[3], qnorm(inits_fixed[4] / 5)),
247248
sigma = c(1.0, 1.0, 1.0, 1.0),
248249
eta_pos_pr = rep(qnorm(inits_fixed[1]), numSubjs),
249250
eta_neg_pr = rep(qnorm(inits_fixed[2]), numSubjs),
250-
alpha_pr = rep(qnorm(inits_fixed[3]), numSubjs),
251+
alpha_pr = rep(inits_fixed[3], numSubjs),
251252
beta_pr = rep(qnorm(inits_fixed[4]/5), numSubjs)
252253
)
253254
}

0 commit comments

Comments
 (0)