ndlCrossvalidate: Crossvalidation of a Naive Discriminative Learning model.

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

Description

ndlCrossvalidate undertakes a crossvalidation of a Naive Discriminative Learning model fitted using ndlClassify.

Usage

1

Arguments

formula

An object of class formula (or one that can be coerced to that class): a symbolic description of the model to be fitted. If alternatively set to =NA, the data argument is expected to be in the ndl internal format as generated by ndlCuesOutcomes, and ndlCrossvalidate will check that this is the case.

data

A data frame (as in ndlClassify) containing the variables in the formula specifying the model.

frequency

A numeric vector (or the name of a column in the input data frame) with the frequencies of the exemplars. If absent, each exemplar is assigned a frequency equal to 1.

k

The number of folds, by default equal to 10.

folds

A list of user-defined folds, each item on the list representing a vector of indices indicating lines in the data frame to be used for testing a model fitted with the rest of the data. By default NULL, so that the folds are determined with random selection by the function ndlCrossvalidate.

...

Control arguments to be passed along to auxiliary functions, in specific estimateWeights and/or estimateActivations.

Details

Crossvalidation of a Naive Discriminative Learning model.

Value

A list of the class "ndlCrossvalidate" with the following components:

call

The call matched by ndlCrossvalidate

formula

The formula specified for ndlCrossvalidate

fits

A list of individual fits resulting from ndlCrossvalidate

k

The number of folds, by default equal to 10

n.total

The sum frequency of data points

n.train

The size of the training set

n.test

The size of of the testing set

folds

A list with the folds used in the crossvalidation; either selected at random by ndlCrossvalidate or provided by the user.

Author(s)

Antti Arppe

References

Baayen, R. H. and Milin, P. and Filipovic Durdevic, D. and Hendrix, P. and Marelli, M., An amorphous model for morphological processing in visual comprehension based on naive discriminative learning. Psychological Review, 118, 438-482.

Arppe, A. and Baayen, R. H. (in prep.). Statistical modeling and the principles of human learning.

See Also

summary.ndlCrossvalidate, ndlStatistics, ndlCuesOutcomes, cueCoding, estimateWeights, estimateActivations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data(think)
set.seed(314)
think <- think[sample(1:nrow(think),500),]
think.cv5 <- ndlCrossvalidate(Lexeme ~ Agent + Patient, data=think, k=5)
summary(think.cv5)
rm(think)

## Not run: 
data(think)
think.cv10 <- ndlCrossvalidate(Lexeme ~ Person + Number + Agent + Patient + Register,
   data=think, k=10)
summary(think.cv10)

## End(Not run)
## Not run: 
library(languageR)
data(finalDevoicing)
finDev.cv10 <- ndlCrossvalidate(Voice ~ Onset1Type + Onset2Type + VowelType *
   ConsonantType * Obstruent + Nsyll + Stress, data=finalDevoicing, k=10)
summary(finDev.cv10)


## End(Not run)

ndl documentation built on May 2, 2019, 10:28 a.m.