diff --git a/DESCRIPTION b/DESCRIPTION index b5b99acf..fd0cd0c6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: bmm Title: Easy and Accesible Bayesian Measurement Models using 'brms' -Version: 0.4.5.9000 +Version: 0.4.6.9000 Authors@R: c( person("Vencislav", "Popov", , "vencislav.popov@gmail.com", role = c("aut", "cre", "cph")), person("Gidon", "Frischkorn", , "gidon.frischkorn@psychologie.uzh.ch", role = c("aut", "cph")), diff --git a/NEWS.md b/NEWS.md index 7bdf858c..76637380 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,7 @@ * you can now choose to estimate parameters that are fixed to a constant by default for all models (#145) * default priors for all models are now specified via the configure_prior() S3 method (#145) * `cmdstanr` will be used as the default backend for `brms` if the user has it installed (#145) +* various updates to the documentation and data sets ### Bug fixes * fix a bug preventing the sort_data check from being executed (#72) diff --git a/R/bmm_model_IMM.R b/R/bmm_model_IMM.R index 9a1215ec..8d8acec1 100644 --- a/R/bmm_model_IMM.R +++ b/R/bmm_model_IMM.R @@ -293,6 +293,9 @@ check_data.IMMspatial <- function(model, data, formula) { "The number of columns for non-target distances in the argument \\ 'nt_distances' should equal max(setsize)-1})") + # replace nt_distances + data[,nt_distances][is.na(data[,nt_distances])] <- 999 + stopif(any(data[,nt_distances] < 0), "All non-target distances to the target need to be postive.") diff --git a/data/OberauerLin_2017.rda b/data/OberauerLin_2017.rda index 8f74fe15..09ed3ba4 100644 Binary files a/data/OberauerLin_2017.rda and b/data/OberauerLin_2017.rda differ diff --git a/man/configure_model.Rd b/man/configure_model.Rd index 869bd9d5..3015592e 100644 --- a/man/configure_model.Rd +++ b/man/configure_model.Rd @@ -79,7 +79,8 @@ configure_model.mixture3p <- function(model, data, formula) { for (i in 1:(max_setsize - 1)) { formula <- formula + glue_nlf("{kappa_nts[i]} ~ kappa") + - glue_nlf("{theta_nts[i]} ~ {lure_idx[i]} * (thetant + log(inv_ss)) + (1 - {lure_idx[i]}) * (-100)") + + glue_nlf("{theta_nts[i]} ~ {lure_idx[i]} * (thetant + log(inv_ss)) + ", + "(1 - {lure_idx[i]}) * (-100)") + glue_nlf("{mu_nts[i]} ~ {nt_features[i]}") } diff --git a/tests/testthat/test-bmm_model_IMM.R b/tests/testthat/test-bmm_model_IMM.R index 6fcb43d0..34578bf3 100644 --- a/tests/testthat/test-bmm_model_IMM.R +++ b/tests/testthat/test-bmm_model_IMM.R @@ -147,13 +147,13 @@ test_that('IMM models run when setsize is a predictor and intercept is supressed formula <- bmf( kappa ~ 1, c ~ 1, - s ~ 0+set_size + s ~ 0 + set_size ) model <- IMMbsc(resp_err = 'dev_rad', nt_features = paste0("col_nt",1:7), nt_distances = paste0("dist_nt",1:7), setsize = "set_size") - expect_silent(fit_model(formula, dat, model, backend = 'mock', mock=1, rename = F)) + expect_silent(fit_model(formula, dat, model, backend = 'mock', mock = 1, rename = F)) formula <- bmf(