Learn R Programming

rtmpt (version 2.0-3)

theta2theta: Set process probabilities equal

Description

Setting multiple process probabilities (thetas) equal. One of the process probabilities will be estimated and the other named process(es) will be set to equal the former. The equality can be removed by only using one name of a process.

Usage

theta2theta(model, names, keep_consts = FALSE)

set_thetas_equal(model, names, keep_consts = FALSE)

Value

A list of the class ertmpt_model.

Arguments

model

A list of the class ertmpt_model.

names

Character vector giving the names of the processes for which the process probabilities should be equal. If length(names) = 1 then the corresponding process probability will be estimates (i.e., it will be set to NA)

keep_consts

Can be one of the following

  • logical value: FALSE (default) means none of the constants for names in the model will be kept; The probability of the reference process (i.e., first of names in alphabetical order) will be set to NA (i.e., will be estimated) and the others will be set to the name of the reference process (i.e., will be set to equal the reference process probability). TRUE means the constant of the reference process probability (if specified) is used for all other processes.

  • numeric value: index for names. If 1, the constant of the first process in names (in original order defined by the user) is used for all other probabilities of the processes in names. If 2, the constant of the second process is used. And so on.

Author

Raphael Hartmann

See Also

delta2delta, theta2const, tau2zero and tau2tau

Examples

Run this code
####################################################################################
# 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 probabilities for both detection processes ("do" and "dn") will be
# set equal.
####################################################################################

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_ertmpt_model(mdl_file = mdl_2HTM)

## make do = dn
new_model <- theta2theta(model = model, names = c("do", "dn"))
new_model


## make do = dn
new_model <- set_thetas_equal(model = model, names = c("do", "dn"))
new_model

Run the code above in your browser using DataLab