diff --git a/R/data.R b/R/data.R index fa642885..d8f14c8a 100644 --- a/R/data.R +++ b/R/data.R @@ -10,7 +10,7 @@ #' \item{trial}{Trial identifyier} #' \item{setsize}{The setsize of the data in this row} #' \item{RespErr}{The response error, that is the difference between the reponse -#' given and the target color.} +#' given and the target color in radians.} #' \item{Pos_Lure1, Pos_Lure2, Pos_Lure3, Pos_Lure4, Pos_Lure5}{Position of the lure items relative to the target color.} #' #' } @@ -25,7 +25,7 @@ #' with set size 1 to 8 reported by Oberauer & Lin (2017). #' #' @format ## `OberauerLin_2017` -#' A data frame with 4,000 rows and 9 columns: +#' A data frame with 15,200 rows and 39 columns: #' \describe{ #' \item{ID}{Integer uniquely identifying different subjects} #' \item{Session}{Session number} diff --git a/data/OberauerLin_2017.rda b/data/OberauerLin_2017.rda index 3b3e4c13..599f40b6 100644 Binary files a/data/OberauerLin_2017.rda and b/data/OberauerLin_2017.rda differ diff --git a/data/ZhangLuck_2008.rda b/data/ZhangLuck_2008.rda index ae142ad5..042f335d 100644 Binary files a/data/ZhangLuck_2008.rda and b/data/ZhangLuck_2008.rda differ diff --git a/inst/imm_vignette_fit.rds b/inst/imm_vignette_fit.rds index 67f25843..b1a4f1d9 100644 Binary files a/inst/imm_vignette_fit.rds and b/inst/imm_vignette_fit.rds differ diff --git a/man/OberauerLin_2017.Rd b/man/OberauerLin_2017.Rd index 7d5ac035..f32bb7db 100644 --- a/man/OberauerLin_2017.Rd +++ b/man/OberauerLin_2017.Rd @@ -7,7 +7,7 @@ \format{ \subsection{\code{OberauerLin_2017}}{ -A data frame with 4,000 rows and 9 columns: +A data frame with 15,200 rows and 39 columns: \describe{ \item{ID}{Integer uniquely identifying different subjects} \item{Session}{Session number} diff --git a/man/ZhangLuck_2008.Rd b/man/ZhangLuck_2008.Rd index 80a6158c..d28ed138 100644 --- a/man/ZhangLuck_2008.Rd +++ b/man/ZhangLuck_2008.Rd @@ -13,7 +13,7 @@ A data frame with 4,000 rows and 9 columns: \item{trial}{Trial identifyier} \item{setsize}{The setsize of the data in this row} \item{RespErr}{The response error, that is the difference between the reponse -given and the target color.} +given and the target color in radians.} \item{Pos_Lure1, Pos_Lure2, Pos_Lure3, Pos_Lure4, Pos_Lure5}{Position of the lure items relative to the target color.} } diff --git a/vignettes/IMM.Rmd b/vignettes/IMM.Rmd index a12f5426..1326ef57 100644 --- a/vignettes/IMM.Rmd +++ b/vignettes/IMM.Rmd @@ -160,17 +160,17 @@ simData$cond <- as.factor(simData$cond) To estimate the `IMM` we first need to specify a formula. In this formula, we directly estimate all parameters for each of the four conditions: ```{r} -model_formula <- brms::bf(respErr ~ 1, - c ~ 0 + cond, - a ~ 0 + cond, - s ~ 0 + cond, - kappa ~ 0 + cond) +model_formula <- bmm_formula(c ~ 0 + cond, + a ~ 0 + cond, + s ~ 0 + cond, + kappa ~ 0 + cond) ``` Then, we can specify the model that we want to estimate: ```{r} -model <- IMMfull(non_target = paste0("color_item",2:setsize), +model <- IMMfull(respErr = "respErr", + non_target = paste0("color_item",2:setsize), setsize = setsize, spaPos = paste0("dist_item",2:setsize)) ``` @@ -185,7 +185,8 @@ model = model, parallel = TRUE, chains = 4, iter = 2000, -backend = "cmdstanr" +backend = "cmdstanr", +refresh = 100 ) ``` @@ -217,10 +218,10 @@ fixedFX[startsWith(rownames(fixedFX),"c_"),] fixedFX[startsWith(rownames(fixedFX),"a_"),] # print posterior means for the s parameter -exp(fixedFX[grepl("s_",rownames(fixedFX)),]) +exp(fixedFX[startsWith(rownames(fixedFX),"s_"),]) # print posterior means for the s parameter -exp(fixedFX[grepl("kappa_",rownames(fixedFX)),]) +exp(fixedFX[startsWith(rownames(fixedFX),"kappa_"),]) ``` These results indicate that all parameters, except for `s` were well recovered. As already noted by @oberauerHierarchicalBayesianMeasurement2017, a good recovery of the generalization gradient `s` requires a lot of data. Thus you might consider opting for the simplified version of the IMM without the `s` parameter, the `IMMabc`.