Skip to content

Commit

Permalink
change class vwm to circular (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
venpopov authored May 22, 2024
1 parent 81e4389 commit bda555a
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ S3method(add_links,bmmfit)
S3method(add_links,bmmodel)
S3method(bmf2bf,bmmodel)
S3method(check_data,bmmodel)
S3method(check_data,circular)
S3method(check_data,default)
S3method(check_data,imm_bsc)
S3method(check_data,imm_full)
S3method(check_data,non_targets)
S3method(check_data,sdm)
S3method(check_data,vwm)
S3method(check_formula,bmmodel)
S3method(check_formula,default)
S3method(check_formula,non_targets)
Expand Down
4 changes: 2 additions & 2 deletions R/helpers-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' should be defined in the appropriate check_data.* function, where \*
#' corresponds to the shared class. For example, for the .model_imm_abc model,
#' this corresponds to the following order of check_data.* functions:
#' check_data() -> check_data.vwm(), check_data.non_targets() the output of the
#' check_data() -> check_data.circular(), check_data.non_targets() the output of the
#' final function is returned to bmm().
#' @param model A model list object returned from check_model()
#' @param data The user supplied data.frame containing the data to be checked
Expand Down Expand Up @@ -48,7 +48,7 @@ check_data.bmmodel <- function(model, data, formula) {


#' @export
check_data.vwm <- function(model, data, formula) {
check_data.circular <- function(model, data, formula) {
resp_name <- model$resp_vars[[1]]
stopif(not_in(resp_name, colnames(data)),
"The response variable '{resp_name}' is not present in the data.")
Expand Down
2 changes: 1 addition & 1 deletion R/model_imm.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# attributes
regex = regex,
regex_vars = c('nt_features', 'nt_distances'),
class = c("bmmodel", "vwm", "non_targets", "imm", paste0('imm_',version)),
class = c("bmmodel", "circular", "non_targets", "imm", paste0('imm_',version)),
call = call
)

Expand Down
2 changes: 1 addition & 1 deletion R/model_mixture2p.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
),
void_mu = FALSE
),
class = c("bmmodel", "vwm", "mixture2p"),
class = c("bmmodel", "circular", "mixture2p"),
call = call
)
out$links[names(links)] <- links
Expand Down
2 changes: 1 addition & 1 deletion R/model_mixture3p.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
# attributes
regex = regex,
regex_vars = c('nt_features'),
class = c("bmmodel", "vwm", "non_targets", "mixture3p"),
class = c("bmmodel", "circular", "non_targets", "mixture3p"),
call = call
)
out$links[names(links)] <- links
Expand Down
2 changes: 1 addition & 1 deletion R/model_sdm.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
),
void_mu = FALSE
),
class = c('bmmodel', 'vwm', 'sdm', paste0("sdm_", version)),
class = c('bmmodel', 'circular', 'sdm', paste0("sdm_", version)),
call = call
)
out$links[names(links)] <- links
Expand Down
2 changes: 1 addition & 1 deletion man/check_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/internal/generate_ref_model_fits_v0.2.1.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ install_and_load_bmm_version <- function(version) {
library(bmm, lib.loc=path)
}

# Load data for vwm models (Participant 1-10, SetSize 1-4, from oberauer_lin_2017)
# Load data for circular models (Participant 1-10, SetSize 1-4, from oberauer_lin_2017)
# TODO: generalize in the future to allow for different datasets for different models
ref_data <- function() {
withr::local_package('dplyr')
Expand Down
2 changes: 1 addition & 1 deletion vignettes/articles/bmm_bmmformula.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ my_model <- sdm(resp_error = "error")
my_model$fixed_parameters
```

Fixed parameters that can be freely estimated are also listed in the `parameters` of a model, that you can access using `my_model$parameters`. Parameters that are only listed in the `fixed_parameters` but not part of the `parameters` need to be fixed for identification purposes and thus cannot be estimated freely. For example in the `mixture_vwm` models, the location `mu2` and precision `kappa2` of the guessing distributions needs to be fixed for model identification. These parameters are listed in the `fixed_parameters` but not in the `parameters` and therefore cannot be estimated. Only, the internally fixed location of the target responses `mu1` can be estimated freely if needed.
Fixed parameters that can be freely estimated are also listed in the `parameters` of a model, that you can access using `my_model$parameters`. Parameters that are only listed in the `fixed_parameters` but not part of the `parameters` need to be fixed for identification purposes and thus cannot be estimated freely. For example in the `mixture` models for visual working memory, the location `mu2` and precision `kappa2` of the guessing distributions needs to be fixed for model identification. These parameters are listed in the `fixed_parameters` but not in the `parameters` and therefore cannot be estimated. Only, the internally fixed location of the target responses `mu1` can be estimated freely if needed.

```{r}
my_model <- mixture2p(resp_error = "error")
Expand Down

0 comments on commit bda555a

Please sign in to comment.