baseline: Baseline models

baseline_const_cR Documentation

Baseline models

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.

  • baseline_const_c() predicts a constant value for continuous responses.

  • baseline_const_d() predicts a constant value for discrete responses.

  • baseline_mean_c() fits the mean of the observed responses for continuous responses.

  • baseline_mean_d() fits the mean of the observed responses for discrete responses.

Usage

baseline_const_c(formula, const, data, options, discount, ...)

baseline_const_d(formula, const, data, ...)

baseline_mean_c(formula, data, ...)

baseline_mean_d(formula, data, ...)

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.

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.

...

other arguments, ignored.

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

  • baseline_const_c/d has no free parameter

  • baseline_mean_c/d has 1 free parameter, mu, the mean

  • baseline_mean_c, if estimated via log likelihood, has an additional free parameter, sigma, the standard deviation of the normal log likelihood.

Author(s)

Jana B. Jarecki, jj@janajarecki.com

See Also

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

Examples

# 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 Nov. 4, 2022, 5:33 p.m.