set_params: Set constants for probability parameters and suppress process...

View source: R/set_params.R

set_paramsR Documentation

Set constants for probability parameters and suppress process times in a rtmpt_model list

Description

By using parameter = "probs" you can specify which of the probability parameters should be set to a constant by using values between zero and one. If you use NA the probability will be estimated. By using parameter = "tau_minus" or parameter = "tau_plus" you can suppress process times/rates. Here 0 will suppress the named process and NA allows the process time/rate to be estimated.

Usage

set_params(model, parameter, names, values = NA)

Arguments

model

A list of the class rtmpt_model.

parameter

Character of length one indicating the parameter to change. Allowed characters:

  • "probs": probability parameters

  • "tau_minus": rate parameters of the exponential distribution of the process times that lead to a negative outcome

  • "tau_plus": rate parameters of the exponential distribution of the process times that lead to a positive outcome

names

Character vector with process names.

values

Numerical vector of length length(names). By using parameter = "probs" you have the following options

  • NA: estimate the named probability

  • 0 < values < 1: set the named probability to a constant value between zero and one

Example: set_params(model = model, parameter = "probs", names = c("do", "dn", "g"), values = c(NA, NA, .5)) will set the guessing "old" (g) to the constant 0.5 in the 2HT model. By using parameter = "tau_minus" or parameter = "tau_plus" you have two options:

  • NA: estimate the process time/rate

  • 0: suppress the process time/rate

Example: set_params(model = model, parameter = "tau_minus", names = c("do", "dn", "g"), values = c(NA, NA, 0)) will suppress the process-completion time for guessing "new" in the 2HT model. This of course does not make sense here, but for some models it might be useful if you assume that a time-consuming process is not associated with certain process-outcome pairs (e.g., for technical parameters not corresponding to a psychological process).

Value

A list of the class rtmpt_model.

Author(s)

Raphael Hartmann

See Also

delta2delta

Examples

####################################################################################
# Detect-Guess variant of the Two-High Threshold model.
# The encoding and motor execution times are assumed to be equal for each category.
# The process completion times for both failed detections will be suppressed.
####################################################################################

mdl_2HTM <- "
# targets
do+(1-do)*g
(1-do)*(1-g)

# lures
(1-dn)*g
dn+(1-dn)*(1-g)

# do: detect old; dn: detect new; g: guess
"

model <- to_rtmpt_model(mdl_file = mdl_2HTM)

## removing the process times for the failed detection ("tau_minus") 
## of the detection parameters ("dn", "do")
model <- set_params(model = model, parameter = "tau_minus", 
                    names = c("dn", "do"), values = c(0,0))
                    

rtmpt documentation built on April 10, 2022, 5:05 p.m.