Skip to contents

Get information about a cognitive model, for example model m

  • npar(m) gives the number of parameters in the model m

  • coef(m) gives the number of free parameters in the model m

  • nstim(m) gives the number of stimuli in the data that were supplied to model m

  • natt(m) gives the number of attributes that each stimulus has

  • nobs(m) gives the number of observations in the data that the model is fitted on

Usage

npar(object, ...)

# S3 method for cm
npar(object, type = "all", ...)

nobs(object, ...)

# S3 method for cm
nobs(object, ...)

nstim(object, ...)

# S3 method for cm
nstim(object, ...)

natt(object, ...)

# S3 method for cm
natt(object, ...)

# S3 method for cm
coef(object, ...)

Arguments

object

An object of class cm, i.e. a cognitive model

...

ignored

type

A string: "all" counts all parameters, "free" counts the free parameters, "fix" countes the fixed parameters, "constrained" counts constrained parameters.

Examples

## Create data D and amodel
D <- data.frame(x = 1, y = 1, z = 1)
model <- bayes_beta_d(y ~ x + z, D, fix = "start")
## Get information
npar(model) # 3 parameter
#> [1] 3
coef(model) # 0 free parameter
#> NULL
nstim(model) # 1 stimulus
#> [1] 1
natt(model) # 2 attributes (x, z) of the stimulus
#> [1] 2
nobs(model) # 1 observation in the data D
#> [1] 1