read_gpt: Read GPT Object from File

View source: R/read_gpt.R

read_gptR Documentation

Read GPT Object from File

Description

Returns a gpt object and checks model file and parameter restrictions

Usage

read_gpt(file, latent, restrictions = NULL)

Arguments

file

path to model file

latent

type of latent continuous distribution(s) (e.g., "normal", "gamma", "exgauss", etc.). See gpt_fit for details

restrictions

list of restrictions for MPT and continuous parameters, e.g., list("g=.5", "do=dn", "mu1=mu2=mu3")

Details

The model file should have one line per MPT branch, with entries separated by semicolons in the following order:

Tree; Category; MPT equations; Continuous Parameters 1; Cont. Parameters 2

In the model file, the latent distributions are specified by parameters corresponding to the distribution of each processing branch (separated by commas). The definition of the parameters is listed in gpt_fit. An example for latent=c("normal","normal") is:

#tree ; cat ; mpt ; normal 1
; normal 2
tree1 ; hit ; do ; m1_d,s1 ; m2_d,s2
tree1 ; hit ; (1-do)*g ; m1_g,s1 ; m2_g,s2
tree1 ; miss ; (1-do)*(1-g) ; m1_g,s1 ; m2_g,s2
tree2 ; fa ; (1-dn)*g ; m1_g,s1 ; m2_g,s2
tree2 ; cr ; (1-dn)*(1-g) ; m1_g,s1 ; m2_g,s2
tree2 ; cr ; dn ; m1_d,s1 ; m2_d,s2

Examples

file <- paste0(path.package("gpt"), "/models/2htm_2normal.txt")
read_gpt(file=file, latent=c("normal", "normal"))
# with restrictions:
read_gpt(file=file, latent=c("normal", "normal"),
         restrictions=list("g=.5","s1=s2=1", "m1_g=m1_d"))
             
# list of example model files:
list.files(path = paste0(path.package("gpt"),"/models"))

danheck/gpt documentation built on Feb. 12, 2024, 6:21 a.m.