npar: Number of Parameters, Attributes, and Stimuli

View source: R/cm-methods.R

nparR Documentation

Number of Parameters, Attributes, and Stimuli

Description

npar(m) counts the parameters in a cm, nstim(m) counts stimuli, natt(m) counts attributes by stimulus, nobs(m) counts observations in the data of a model.

Usage

npar(x)

## S3 method for class 'cm'
npar(x, type = "all", ...)

Arguments

x

a model object

...

ignored

type

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

Examples

D <- data.frame(x = 1, y = 1, z = 1)
M <- bayes_beta(y ~ x + z, D, fix = "start")
npar(M) # 3
npar(M)

JanaJarecki/cogscimodels documentation built on Nov. 4, 2022, 5:33 p.m.