baseline: Baseline models

Description Usage Arguments Details Value Parameter Author(s) See Also Examples

Description

Fits baseline models. Baseline models are stimulus-agostic models used as sanity checks in cognitive model comparisons. Other cognitive models should beat a baseline model – if not, the other cognitive models don't describe patterns in the responses well.

Usage

1
2
3
4
5
6
7

Arguments

formula

A formula, the variable in data to be modeled. For example, y ~ . models a response variable y (note the ~ . after the variable name).

const

A number, the value to predict.

data

A data frame, the data to be modeled.

...

other arguments, ignored.

options

(optional) A list, list entries change the modeling procedure. For example, list(lb = c(k=0)) changes the lower bound of parameter k to 0, or list(fit_measure = "mse") changes the goodness of fit measure in parameter estimation to mean-squared error, for all options, see cm_options().

discount

A number, how many initial trials to not use during parameter fitting.

Details

baseline_const_c/d predicts the value given in const for all trials. For example const = 0.50 would predict Pr=0.50 for each trial, which is a commmon baseline model for tasks with two-outcome discrete choices.

Value

Returns a cognitive model object, which is an object of class cm. A model, that has been assigned to m, can be summarized with summary(m) or anova(m). The parameter space can be viewed using pa. rspace(m), constraints can be viewed using constraints(m).

Parameter

Author(s)

Jana B. Jarecki, jj@janajarecki.com

See Also

Other cognitive models: bayes(), choicerules, cpt, ebm(), hm1988(), shortfall, utility

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Data D: let y hold the observed responses
# Make a model that predicts Pr = 0.50
D <- data.frame(y = c(1,1,0), x = c(1,2,3))
M <- baseline_const_d(y ~ ., const = 0.50, data = D)
predict(M)                         # predicts 0.5, 0.5, 0.5
npar(M)                            # 0 parameter
logLik(M)                          # log likelihood (binomial)

M <- baseline_mean_d(y ~ ., D)     # Pr = mean(observed variable)
predict(M)                         # predicts 0.66, 0.66, 0.66
coef(M)                            # mean counts as free parameter
npar(M)                            # 1 free parameter, the mean

JanaJarecki/cogscimodels documentation built on Sept. 8, 2020, 7:28 p.m.