baseline_const_c | R Documentation |
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.
baseline_const_c(formula, const, data, options, discount, ...) baseline_const_d(formula, const, data, ...) baseline_mean_c(formula, data, ...) baseline_mean_d(formula, data, ...)
formula |
A formula, the variable in |
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, |
discount |
A number, how many initial trials to not use during parameter fitting. |
... |
other arguments, ignored. |
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.
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)
.
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.
Jana B. Jarecki, jj@janajarecki.com
Other cognitive models:
bayes()
,
choicerules
,
cpt
,
ebm()
,
hm1988()
,
shift()
,
shortfall
,
threshold()
,
utility
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.