generalized Generalized Context Model

Share:

Description

Constructs a generalized version of the Generalized Context Model.

Usage

1
2
3
4
5
gGCM(learning,response,level=c("nominal","interval"),distance=c("cityblock",
"euclidian","minkowski"),similarity=c("exponential","gaussian","general"),
sampling=c("uniform","power","exponential"),parameters=list(w=NULL,lambda=1,
r=1,q=1,gamma=NULL,theta=NULL,sdy=NULL,sdr=NULL),fixed,data,subset,ntimes=NULL,
replicate=TRUE,base=NULL,remove.intercept=FALSE)

Arguments

learning

an object of class formula (or one that can be coerced to that class): a symbolic description of the learning model to be fitted. For more details of model speecification, see lm or glm.

response

an object of class formula (or one that can be coerced to that class): a symbolic description of the response model to be fitted. Only the left hand side of the formula will be used. For more details of model specification, see lm or glm.

level

the measurement level of the dependent variable, either nominal or interval.

distance

either the name of a standard distance function, or a function which returns a T*T matrix with distances between the cues. See details.

similarity

either the name of a standard similarity function, or a function which converts the T*T distance matrix to a T*T similarity matrix. See datails.

sampling

either the name of a standard sampling function, or a function which returns a T*T matrix with sampling weights. See details.

parameters

an (optional) named list with (starting) values of the parameters. If no values are supplied, defaults are used.

fixed

a logical vector indicating whether model parameters are fixed or free

data

data frame containing the variables listed in the formula argument.

subset

subset of data to fit model to.

ntimes

a vector with number of observations for each replication.

replicate

logical to indicate whether model parameters are identical for each replication in ntimes.

base

assign one of the levels of the criterion variable the role of base category.

remove.intercept

(logical) should the intercept term be removed from the x matrix of the model?

Details

The Generalized Context Model (Nosofsky, 1986) is an exemplar model. It predicts the value of a criterion at t based on the similarity of a probe cue x[t] to stored cues x[t-k], k = 1,...,t-1.

The GCM can be seen as a mixture model. Each encountered exemplar adds a new component to the mixture. The mixture proportions are defined by the similarities. See the package manual for more information.

The model implemented by gGCM extends the original GCM (Nosofsky, 1986) by allowing (1) a continuous criterion, and (2) memory decay of exemplars.

Value

An object of class gGCMinterval or gGCMnominal.

References

Nosofsky, R.M. (1986). Attention, Similarity, and the Identification-Categorization Relationship. Journal of Experimental Psychology: General, 115, 39-57.

Speekenbrink, M. \& Shanks, D.R. (2010). Learning in a changing environment. Journal of Experimental Psychology: General.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## open weather prediction data
data(WPT)
controls <- subset(WPT,id %in% paste("C",1:16,sep=""))
## initialize model, use remove.intercept=TRUE so that the x matrix will contain
##   four columns.
mod <- gGCM(y~x1+x2+x3+x4,response=r~1,data=controls,ntimes=rep(200,16),remove.intercept=TRUE)
## estimate free parameters
## Not run: mod <- fit(mod)
summary(mod)

# now a model with a general minkowski distance function, and an exponential
#    memory decay. Using numerical predictors and removing the intercept (-1) in
#    the model formula removes the need for the remove.intercept argument.
mod <- gGCM(y~as.numeric(x1==1)+as.numeric(x2==1)+as.numeric(x3==1)+
as.numeric(x4==1)-1,response=r~1,distance="minkowski",sampling="uniform",data=controls,
ntimes=rep(200,16))